PDA

View Full Version : Lisp within Lisp


OIIIIIIIO
2008-07-21, 07:18 PM
Is this possible?

Each LSP works when I run them individually. I can get a button to start the basic CAD commands like line, copy, etc... it will even throw an alert out if I want. I just can't get it to run the specific LSP that I created by pressing a button another LSP routine generated.

What am I missing?!?! Why can't I get it to run the splash.lsp by pressing VPbutton1? If I change 'splash to 'line it works just fine... but I want it to run the lisp routine I wrote.

(defun c:SetVPlayers ()

(vl-load-com)

(setq dcl_id (load_dialog "VPButtons.dcl"))

(if (not (new_dialog "Set_VP" dcl_id))
(exit)
)
(action_tile "VPbutton1" "(done_dialog 1)")
(action_tile "VPbutton2" "(done_dialog 2)")
(action_tile "VPbutton3" "(done_dialog 3)")
(action_tile "VPbutton4" "(done_dialog 4)")
(action_tile "VPbutton5" "(done_dialog 5)")
(action_tile "cancel" "(done_dialog 0)")
(setq DiaRtn (start_dialog))
(cond
((= DiaRtn 1)
(load "splash.lsp")
(command 'splash)
)
((= DiaRtn 2)
(alert "Button \"Test2\" was pushed.")
)
((= DiaRtn 3)
(alert "Button \"Test3\" was pushed.")
)
((= DiaRtn 4)
(alert "Button \"Test4\" was pushed.")
)
((= DiaRtn 5)
(alert "Button \"Test5\" was pushed.")
)
(t
)
)
(princ)
)


button code

//This is a dialog box that would set the viewport layer states in a drawing

Set_VP : dialog { label = "Select viewport plan type:";

: row {
: button {
label = "Floor Plan";
key = "VPbutton1";
}
: button {
label = "Finish Floor Plan";
key = "VPbutton2";
}
}
: row {
: button {
label = "Ceiling Plan";
key = "VPbutton3";
fixed_width = true;
}
: button {
label = "FFE Plan";
key = "VPbutton4";
fixed_width = true;
}
: button {
label = "Key Plan";
key = "VPbutton5";
fixed_width = true;
}
}
: button {
label = "Cancel";
key = "cancel";
is_cancel = true;
fixed_width = true;
alignment = centered;
}
}


and the imbedded lisp

(defun c:Splash ()
(ALERT " The selected viewport is now set to \"splash\"\n\n

This routine captures 90% of layer states\.\nVerify settings per

your project's specific requirements. ")
(princ)
)

CADmium
2008-07-21, 07:41 PM
not (command 'splash) !!
use
(c:splash)

OIIIIIIIO
2008-07-21, 07:53 PM
THANK YOU!!

It's alive. It's alive!!

Thank you so very much!