Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
*Nagel, Eric
Message 1 of 13 (65 Views)

LISP QUESTION

65 Views, 12 Replies
10-19-1999 02:11 PM
Greetings All !
I am having an odd problem that I cannot seem to figure out. I am
hoping someone will be able to help me out with this...Notice that I do
not have an "mspace" command anywhere in my code. Any pointers would be
thanked...
Thanks,
Eric

Here is the error message that I am getting:

Command: ls2 error: incorrect request for command list data
(COMMAND ".mspace")
(MAIN)
((LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN) (DONE_DIALOG)) (<>

#33e116c> "1") (<> "accept") (<> "") (<>

#33e116c> 1) (<> 16) (<> 7))
(APPLY (QUOTE (LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN)
(DONE_DIALOG)))
(QUOTE ("1" "accept" "" 1 16 7)))
(START_DIALOG)
(PROGN (ACTION_TILE "accept" "(MAIN) (done_dialog)") (ACTION_TILE
"cancel"
"(done_dialog)") (START_DIALOG) (UNLOAD_DIALOG DCL_ID) (LAYER))
(IF (NEW_DIALOG "ls2" DCL_ID) (PROGN (ACTION_TILE "accept" "(MAIN)
(done_dialog)") (ACTION_TILE "cancel" "(done_dialog)") (START_DIALOG)
(UNLOAD_DIALOG DCL_ID) (LAYER)))
(C:LS2)

Here is my .lsp file:

(defun c:LS2 (/)
(setq dcl_id (load_dialog "ls2.dcl"))
(if (new_dialog "ls2" dcl_id)
(progn
(action_tile "accept" "(MAIN) (done_dialog)")
(action_tile "cancel" "(done_dialog)")
(start_dialog)
(unload_dialog dcl_id)
(LAYER)
)
)
(princ)
)

(defun MAIN ()

(setq FP (get_tile "key_FP"))
(setq CP (get_tile "key_CP"))
(setq EL (get_tile "key_EL"))
(setq EQ (get_tile "key_EQ"))
(setq FM (get_tile "key_FM"))
(setq GP (get_tile "key_GP"))
(setq DET (get_tile "key_details"))

(princ)
)

(defun LAYER (/ DET_MVIEW_SS FLR_MVIEW_SS)
(setvar "CMDECHO" 0)
(setq DET_MVIEW_SS (ssget "X" (list (cons 8 "DET_MVIEW"))))
(setq FLR_MVIEW_SS (ssget "X" (list (cons 8 "FLR_MVIEW"))))
(progn
(cond
;; FLOOR PLAN ***************
((= FP "1")
(setq CHECK (tblsearch "LAYER" "T_TITLE"))
(setq ONOFF (assoc 62 CHECK))
(setq ONOFF (cdr ONOFF))
(if (< ONOFF 0)
(command "LAYER" "ON" "T_cutline,T_misc,T_text,T_title" "")
)
(command "mview" "on" FLR_MVIEW_SS "")
(command "-layer" "on" "FLR_MVIEW" "")
(command "mview" "off" DET_MVIEW_SS "")
(command "-layer" "off" "DET_MVIEW" "")
(command "LAYER" "SET" "0" "")
(command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")

(command "LAYER" "ON" "A_*" "")
(command "LAYER" "ON" "EQ_*" "")
)
;; CABLE PLAN ***************
(( = CP "1")
(command "mview" "on" FLR_MVIEW_SS "")
(command "-layer" "on" "FLR_MVIEW" "")
(command "mview" "off" DET_MVIEW_SS "")
(command "-layer" "off" "DET_MVIEW" "")
(command "LAYER" "SET" "0" "")
(command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")

(command "LAYER" "ON" "A_*" "")
(command "LAYER" "ON" "C_*" "")
(command "LAYER" "ON" "EQ_*" "")
(command "LAYER" "OFF" "EQ_DIM" "")
(command "LAYER" "OFF" "EQ_TEXT" "")
(command "LAYER" "OFF" "A_TEXT" "")
(command "LAYER" "OFF" "A_dim" "")
(command "LAYER" "OFF" "A_STRUCT_GRID" "")
)
;; ELECTRICAL PLAN ***************
(( = EL "1")
(command "mview" "on" FLR_MVIEW_SS "")
(command "-layer" "on" "FLR_MVIEW" "")
(command "mview" "off" DET_MVIEW_SS "")
(command "-layer" "off" "DET_MVIEW" "")
(command "LAYER" "SET" "0" "")
(command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")

(command "LAYER" "ON" "A_*" "")
(command "LAYER" "ON" "E_*" "")
(command "LAYER" "ON" "EQ_*" "")
(command "LAYER" "OFF" "EQ_DIM" "")
(command "LAYER" "OFF" "EQ_TEXT" "")
(command "LAYER" "OFF" "A_TEXT" "")
(command "LAYER" "OFF" "A_STRUCT_GRID" "")
)
;; FIBER MANAGEMENT PLAN ***************
(( = FM "1")
(command "mview" "on" FLR_MVIEW_SS "")
(command "-layer" "on" "FLR_MVIEW" "")
(command "mview" "off" DET_MVIEW_SS "")
(command "-layer" "off" "DET_MVIEW" "")
(command "LAYER" "SET" "0" "")
(command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")

(command "LAYER" "ON" "A_*" "")
(command "LAYER" "ON" "EQ_*" "")
(command "LAYER" "ON" "FM_*" "")
(command "LAYER" "OFF" "EQ_DIM" "")
(command "LAYER" "OFF" "EQ_TEXT" "")
(command "LAYER" "OFF" "A_TEXT" "")
(command "LAYER" "OFF" "A_dim" "")
(command "LAYER" "OFF" "A_STRUCT_GRID" "")
)
;; GROUNDING PLAN ***************
(( = GP "1")
(command "mview" "on" FLR_MVIEW_SS "")
(command "-layer" "on" "FLR_MVIEW" "")
(command "mview" "off" DET_MVIEW_SS "")
(command "-layer" "off" "DET_MVIEW" "")
(command "LAYER" "SET" "0" "")
(command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")

(command "LAYER" "ON" "A_*" "")
(command "LAYER" "ON" "EQ_*" "")
(command "LAYER" "ON" "G_*" "")
(command "LAYER" "OFF" "EQ_DIM" "")
(command "LAYER" "OFF" "EQ_TEXT" "")
(command "LAYER" "OFF" "A_TEXT" "")
(command "LAYER" "OFF" "A_STRUCT_GRID" "")
)
;; DETAILS SHEET *****************
(( = DET "1")
(setvar "CMDECHO" 0)
(command "LAYER" "SET" "0" "")
(command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")

(command "-LAYER" "OFF" "T_MISC" "")
(command "mview" "on" DET_MVIEW_SS "")
(command "-layer" "on" "DET_MVIEW" "")
(command "mview" "off" FLR_MVIEW_SS "")
(command "-layer" "off" "FLR_MVIEW" "")
(command "-layer" "on" "D_*" "")
(princ)
)
)
(setvar "CMDECHO" 1)
)
(princ)
)

And finally, my .dcl file:

ls2 : dialog {
label = "Layer Management v2.0";
: text {
label = "- Developed for Electric Lightwave, Inc.";
}
: text {
label = "- Created by Eric Nagel (rev. 09/15/99)";
}
: boxed_row {
label = "LAYERSET";
: radio_column {
: radio_button {
label = "Floor Plan / Equipment Layout";
key = "key_FP";
}
: radio_button {
label = "Cable Rack Plan";
key = "key_CP";
}
: radio_button {
label = "Electrical Plan";
key = "key_EL";
}
: radio_button {
label = "Fiber Management";
key = "key_FM";
}
: radio_button {
label = "Grounding Plan";
key = "key_GP";
}
: radio_button {
label = "Details";
key = "key_details";
}
}
}
ok_cancel;
}

--
Eric Nagel
Electric Lightwave, Inc.
eric_nagel@eli.net
*Nagel, Eric
Message 2 of 13 (65 Views)

Re: LISP QUESTION

10-19-1999 02:26 PM in reply to: *Nagel, Eric
I forgot to mention that that I am loading this routine thru my
'acadr14.lsp' file. When I appload the file, it works just fine...I'm
stumped...

Eric Nagel wrote:

> Greetings All !
> I am having an odd problem that I cannot seem to figure out. I am
> hoping someone will be able to help me out with this...Notice that I do
> not have an "mspace" command anywhere in my code. Any pointers would be
> thanked...
> Thanks,
> Eric
>
> Here is the error message that I am getting:
>
> Command: ls2 error: incorrect request for command list data
> (COMMAND ".mspace")
> (MAIN)
> ((LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN) (DONE_DIALOG)) (<>
>
> #33e116c> "1") (<> "accept") (<> "") (<>
>
> #33e116c> 1) (<> 16) (<> 7))
> (APPLY (QUOTE (LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN)
> (DONE_DIALOG)))
> (QUOTE ("1" "accept" "" 1 16 7)))
> (START_DIALOG)
> (PROGN (ACTION_TILE "accept" "(MAIN) (done_dialog)") (ACTION_TILE
> "cancel"
> "(done_dialog)") (START_DIALOG) (UNLOAD_DIALOG DCL_ID) (LAYER))
> (IF (NEW_DIALOG "ls2" DCL_ID) (PROGN (ACTION_TILE "accept" "(MAIN)
> (done_dialog)") (ACTION_TILE "cancel" "(done_dialog)") (START_DIALOG)
> (UNLOAD_DIALOG DCL_ID) (LAYER)))
> (C:LS2)
>
> Here is my .lsp file:
>
> (defun c:LS2 (/)
> (setq dcl_id (load_dialog "ls2.dcl"))
> (if (new_dialog "ls2" dcl_id)
> (progn
> (action_tile "accept" "(MAIN) (done_dialog)")
> (action_tile "cancel" "(done_dialog)")
> (start_dialog)
> (unload_dialog dcl_id)
> (LAYER)
> )
> )
> (princ)
> )
>
> (defun MAIN ()
>
> (setq FP (get_tile "key_FP"))
> (setq CP (get_tile "key_CP"))
> (setq EL (get_tile "key_EL"))
> (setq EQ (get_tile "key_EQ"))
> (setq FM (get_tile "key_FM"))
> (setq GP (get_tile "key_GP"))
> (setq DET (get_tile "key_details"))
>
> (princ)
> )
>
> (defun LAYER (/ DET_MVIEW_SS FLR_MVIEW_SS)
> (setvar "CMDECHO" 0)
> (setq DET_MVIEW_SS (ssget "X" (list (cons 8 "DET_MVIEW"))))
> (setq FLR_MVIEW_SS (ssget "X" (list (cons 8 "FLR_MVIEW"))))
> (progn
> (cond
> ;; FLOOR PLAN ***************
> ((= FP "1")
> (setq CHECK (tblsearch "LAYER" "T_TITLE"))
> (setq ONOFF (assoc 62 CHECK))
> (setq ONOFF (cdr ONOFF))
> (if (< ONOFF 0)
> (command "LAYER" "ON" "T_cutline,T_misc,T_text,T_title" "")
> )
> (command "mview" "on" FLR_MVIEW_SS "")
> (command "-layer" "on" "FLR_MVIEW" "")
> (command "mview" "off" DET_MVIEW_SS "")
> (command "-layer" "off" "DET_MVIEW" "")
> (command "LAYER" "SET" "0" "")
> (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")
>
> (command "LAYER" "ON" "A_*" "")
> (command "LAYER" "ON" "EQ_*" "")
> )
> ;; CABLE PLAN ***************
> (( = CP "1")
> (command "mview" "on" FLR_MVIEW_SS "")
> (command "-layer" "on" "FLR_MVIEW" "")
> (command "mview" "off" DET_MVIEW_SS "")
> (command "-layer" "off" "DET_MVIEW" "")
> (command "LAYER" "SET" "0" "")
> (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")
>
> (command "LAYER" "ON" "A_*" "")
> (command "LAYER" "ON" "C_*" "")
> (command "LAYER" "ON" "EQ_*" "")
> (command "LAYER" "OFF" "EQ_DIM" "")
> (command "LAYER" "OFF" "EQ_TEXT" "")
> (command "LAYER" "OFF" "A_TEXT" "")
> (command "LAYER" "OFF" "A_dim" "")
> (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> )
> ;; ELECTRICAL PLAN ***************
> (( = EL "1")
> (command "mview" "on" FLR_MVIEW_SS "")
> (command "-layer" "on" "FLR_MVIEW" "")
> (command "mview" "off" DET_MVIEW_SS "")
> (command "-layer" "off" "DET_MVIEW" "")
> (command "LAYER" "SET" "0" "")
> (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")
>
> (command "LAYER" "ON" "A_*" "")
> (command "LAYER" "ON" "E_*" "")
> (command "LAYER" "ON" "EQ_*" "")
> (command "LAYER" "OFF" "EQ_DIM" "")
> (command "LAYER" "OFF" "EQ_TEXT" "")
> (command "LAYER" "OFF" "A_TEXT" "")
> (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> )
> ;; FIBER MANAGEMENT PLAN ***************
> (( = FM "1")
> (command "mview" "on" FLR_MVIEW_SS "")
> (command "-layer" "on" "FLR_MVIEW" "")
> (command "mview" "off" DET_MVIEW_SS "")
> (command "-layer" "off" "DET_MVIEW" "")
> (command "LAYER" "SET" "0" "")
> (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")
>
> (command "LAYER" "ON" "A_*" "")
> (command "LAYER" "ON" "EQ_*" "")
> (command "LAYER" "ON" "FM_*" "")
> (command "LAYER" "OFF" "EQ_DIM" "")
> (command "LAYER" "OFF" "EQ_TEXT" "")
> (command "LAYER" "OFF" "A_TEXT" "")
> (command "LAYER" "OFF" "A_dim" "")
> (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> )
> ;; GROUNDING PLAN ***************
> (( = GP "1")
> (command "mview" "on" FLR_MVIEW_SS "")
> (command "-layer" "on" "FLR_MVIEW" "")
> (command "mview" "off" DET_MVIEW_SS "")
> (command "-layer" "off" "DET_MVIEW" "")
> (command "LAYER" "SET" "0" "")
> (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")
>
> (command "LAYER" "ON" "A_*" "")
> (command "LAYER" "ON" "EQ_*" "")
> (command "LAYER" "ON" "G_*" "")
> (command "LAYER" "OFF" "EQ_DIM" "")
> (command "LAYER" "OFF" "EQ_TEXT" "")
> (command "LAYER" "OFF" "A_TEXT" "")
> (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> )
> ;; DETAILS SHEET *****************
> (( = DET "1")
> (setvar "CMDECHO" 0)
> (command "LAYER" "SET" "0" "")
> (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")
>
> (command "-LAYER" "OFF" "T_MISC" "")
> (command "mview" "on" DET_MVIEW_SS "")
> (command "-layer" "on" "DET_MVIEW" "")
> (command "mview" "off" FLR_MVIEW_SS "")
> (command "-layer" "off" "FLR_MVIEW" "")
> (command "-layer" "on" "D_*" "")
> (princ)
> )
> )
> (setvar "CMDECHO" 1)
> )
> (princ)
> )
>
> And finally, my .dcl file:
>
> ls2 : dialog {
> label = "Layer Management v2.0";
> : text {
> label = "- Developed for Electric Lightwave, Inc.";
> }
> : text {
> label = "- Created by Eric Nagel (rev. 09/15/99)";
> }
> : boxed_row {
> label = "LAYERSET";
> : radio_column {
> : radio_button {
> label = "Floor Plan / Equipment Layout";
> key = "key_FP";
> }
> : radio_button {
> label = "Cable Rack Plan";
> key = "key_CP";
> }
> : radio_button {
> label = "Electrical Plan";
> key = "key_EL";
> }
> : radio_button {
> label = "Fiber Management";
> key = "key_FM";
> }
> : radio_button {
> label = "Grounding Plan";
> key = "key_GP";
> }
> : radio_button {
> label = "Details";
> key = "key_details";
> }
> }
> }
> ok_cancel;
> }
>
> --
> Eric Nagel
> Electric Lightwave, Inc.
> eric_nagel@eli.net

--
Eric Nagel
Electric Lightwave, Inc.
eric_nagel@eli.net
*Doane, David
Message 3 of 13 (65 Views)

Re:

10-19-1999 03:20 PM in reply to: *Nagel, Eric
Eric,

I'm thinking that AutoCAD is not ready to evaluate any "command" statements
when 'acadr14' is being loaded, or even when 'acad.lsp' is loaded unless it
is in the S::smileyfrustrated:tartup section.

Actually, 'acadr14' is for Autodesk use and you should put nothing in it.
Any external AutoLISP programs should have a stub loader, or an autoloading
statement, in your 'acad.lsp'. That way the program isn't actually loaded
and evaluated until you are ready to use it. There are also other means of
loading external programs as well.

If you would like more information on loading methods, please indicate such
and someone will respond.
--
Dave D

Eric Nagel wrote in article <380CE20A.37162685@eli.net>...
> I forgot to mention that that I am loading this routine thru my
> 'acadr14.lsp' file. When I appload the file, it works just fine...I'm
> stumped...
>
> Eric Nagel wrote:
>
> > Greetings All !
> > I am having an odd problem that I cannot seem to figure out. I am
> > hoping someone will be able to help me out with this...Notice that I do
> > not have an "mspace" command anywhere in my code. Any pointers would
be
> > thanked...
> > Thanks,
> > Eric
> >
> > Here is the error message that I am getting:
> >
> > Command: ls2 error: incorrect request for command list data
> > (COMMAND ".mspace")
> > (MAIN)
> > ((LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN) (DONE_DIALOG))
(<>
> >
> > #33e116c> "1") (<> "accept") (<> "")
(<>
> >
> > #33e116c> 1) (<> 16) (<> 7))
> > (APPLY (QUOTE (LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN)
> > (DONE_DIALOG)))
> > (QUOTE ("1" "accept" "" 1 16 7)))
> > (START_DIALOG)
> > (PROGN (ACTION_TILE "accept" "(MAIN) (done_dialog)") (ACTION_TILE
> > "cancel"
> > "(done_dialog)") (START_DIALOG) (UNLOAD_DIALOG DCL_ID) (LAYER))
> > (IF (NEW_DIALOG "ls2" DCL_ID) (PROGN (ACTION_TILE "accept" "(MAIN)
> > (done_dialog)") (ACTION_TILE "cancel" "(done_dialog)") (START_DIALOG)
> > (UNLOAD_DIALOG DCL_ID) (LAYER)))
> > (C:LS2)
> >
> > Here is my .lsp file:
> >
> > (defun c:LS2 (/)
> > (setq dcl_id (load_dialog "ls2.dcl"))
> > (if (new_dialog "ls2" dcl_id)
> > (progn
> > (action_tile "accept" "(MAIN) (done_dialog)")
> > (action_tile "cancel" "(done_dialog)")
> > (start_dialog)
> > (unload_dialog dcl_id)
> > (LAYER)
> > )
> > )
> > (princ)
> > )
> >
> > (defun MAIN ()
> >
> > (setq FP (get_tile "key_FP"))
> > (setq CP (get_tile "key_CP"))
> > (setq EL (get_tile "key_EL"))
> > (setq EQ (get_tile "key_EQ"))
> > (setq FM (get_tile "key_FM"))
> > (setq GP (get_tile "key_GP"))
> > (setq DET (get_tile "key_details"))
> >
> > (princ)
> > )
> >
> > (defun LAYER (/ DET_MVIEW_SS FLR_MVIEW_SS)
> > (setvar "CMDECHO" 0)
> > (setq DET_MVIEW_SS (ssget "X" (list (cons 8 "DET_MVIEW"))))
> > (setq FLR_MVIEW_SS (ssget "X" (list (cons 8 "FLR_MVIEW"))))
> > (progn
> > (cond
> > ;; FLOOR PLAN ***************
> > ((= FP "1")
> > (setq CHECK (tblsearch "LAYER" "T_TITLE"))
> > (setq ONOFF (assoc 62 CHECK))
> > (setq ONOFF (cdr ONOFF))
> > (if (< ONOFF 0)
> > (command "LAYER" "ON" "T_cutline,T_misc,T_text,T_title" "")
> > )
> > (command "mview" "on" FLR_MVIEW_SS "")
> > (command "-layer" "on" "FLR_MVIEW" "")
> > (command "mview" "off" DET_MVIEW_SS "")
> > (command "-layer" "off" "DET_MVIEW" "")
> > (command "LAYER" "SET" "0" "")
> > (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
"")
> >
> > (command "LAYER" "ON" "A_*" "")
> > (command "LAYER" "ON" "EQ_*" "")
> > )
> > ;; CABLE PLAN ***************
> > (( = CP "1")
> > (command "mview" "on" FLR_MVIEW_SS "")
> > (command "-layer" "on" "FLR_MVIEW" "")
> > (command "mview" "off" DET_MVIEW_SS "")
> > (command "-layer" "off" "DET_MVIEW" "")
> > (command "LAYER" "SET" "0" "")
> > (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
"")
> >
> > (command "LAYER" "ON" "A_*" "")
> > (command "LAYER" "ON" "C_*" "")
> > (command "LAYER" "ON" "EQ_*" "")
> > (command "LAYER" "OFF" "EQ_DIM" "")
> > (command "LAYER" "OFF" "EQ_TEXT" "")
> > (command "LAYER" "OFF" "A_TEXT" "")
> > (command "LAYER" "OFF" "A_dim" "")
> > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > )
> > ;; ELECTRICAL PLAN ***************
> > (( = EL "1")
> > (command "mview" "on" FLR_MVIEW_SS "")
> > (command "-layer" "on" "FLR_MVIEW" "")
> > (command "mview" "off" DET_MVIEW_SS "")
> > (command "-layer" "off" "DET_MVIEW" "")
> > (command "LAYER" "SET" "0" "")
> > (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
"")
> >
> > (command "LAYER" "ON" "A_*" "")
> > (command "LAYER" "ON" "E_*" "")
> > (command "LAYER" "ON" "EQ_*" "")
> > (command "LAYER" "OFF" "EQ_DIM" "")
> > (command "LAYER" "OFF" "EQ_TEXT" "")
> > (command "LAYER" "OFF" "A_TEXT" "")
> > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > )
> > ;; FIBER MANAGEMENT PLAN ***************
> > (( = FM "1")
> > (command "mview" "on" FLR_MVIEW_SS "")
> > (command "-layer" "on" "FLR_MVIEW" "")
> > (command "mview" "off" DET_MVIEW_SS "")
> > (command "-layer" "off" "DET_MVIEW" "")
> > (command "LAYER" "SET" "0" "")
> > (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
"")
> >
> > (command "LAYER" "ON" "A_*" "")
> > (command "LAYER" "ON" "EQ_*" "")
> > (command "LAYER" "ON" "FM_*" "")
> > (command "LAYER" "OFF" "EQ_DIM" "")
> > (command "LAYER" "OFF" "EQ_TEXT" "")
> > (command "LAYER" "OFF" "A_TEXT" "")
> > (command "LAYER" "OFF" "A_dim" "")
> > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > )
> > ;; GROUNDING PLAN ***************
> > (( = GP "1")
> > (command "mview" "on" FLR_MVIEW_SS "")
> > (command "-layer" "on" "FLR_MVIEW" "")
> > (command "mview" "off" DET_MVIEW_SS "")
> > (command "-layer" "off" "DET_MVIEW" "")
> > (command "LAYER" "SET" "0" "")
> > (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
"")
> >
> > (command "LAYER" "ON" "A_*" "")
> > (command "LAYER" "ON" "EQ_*" "")
> > (command "LAYER" "ON" "G_*" "")
> > (command "LAYER" "OFF" "EQ_DIM" "")
> > (command "LAYER" "OFF" "EQ_TEXT" "")
> > (command "LAYER" "OFF" "A_TEXT" "")
> > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > )
> > ;; DETAILS SHEET *****************
> > (( = DET "1")
> > (setvar "CMDECHO" 0)
> > (command "LAYER" "SET" "0" "")
> > (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
"")
> >
> > (command "-LAYER" "OFF" "T_MISC" "")
> > (command "mview" "on" DET_MVIEW_SS "")
> > (command "-layer" "on" "DET_MVIEW" "")
> > (command "mview" "off" FLR_MVIEW_SS "")
> > (command "-layer" "off" "FLR_MVIEW" "")
> > (command "-layer" "on" "D_*" "")
> > (princ)
> > )
> > )
> > (setvar "CMDECHO" 1)
> > )
> > (princ)
> > )
> >
> > And finally, my .dcl file:
> >
> > ls2 : dialog {
> > label = "Layer Management v2.0";
> > : text {
> > label = "- Developed for Electric Lightwave, Inc.";
> > }
> > : text {
> > label = "- Created by Eric Nagel (rev. 09/15/99)";
> > }
> > : boxed_row {
> > label = "LAYERSET";
> > : radio_column {
> > : radio_button {
> > label = "Floor Plan / Equipment Layout";
> > key = "key_FP";
> > }
> > : radio_button {
> > label = "Cable Rack Plan";
> > key = "key_CP";
> > }
> > : radio_button {
> > label = "Electrical Plan";
> > key = "key_EL";
> > }
> > : radio_button {
> > label = "Fiber Management";
> > key = "key_FM";
> > }
> > : radio_button {
> > label = "Grounding Plan";
> > key = "key_GP";
> > }
> > : radio_button {
> > label = "Details";
> > key = "key_details";
> > }
> > }
> > }
> > ok_cancel;
> > }
> >
> > --
> > Eric Nagel
> > Electric Lightwave, Inc.
> > eric_nagel@eli.net
>
> --
> Eric Nagel
> Electric Lightwave, Inc.
> eric_nagel@eli.net
>
>
>
*Nagel, Eric
Message 4 of 13 (65 Views)

Re:

10-19-1999 03:56 PM in reply to: *Nagel, Eric
David,
I cut my load statements out of my acadr14.lsp file and pasted them into my
acad.lsp file and restarted my AutoCAD, tried running my routine again, which I
have a button for, and the same error message came up again. I guess I would
like to look at some different options for loading AutoLISP routine...This has
really got me confused...it was working last Friday, and now...nothing...???
Eric

David Doane wrote:

> Eric,
>
> I'm thinking that AutoCAD is not ready to evaluate any "command" statements
> when 'acadr14' is being loaded, or even when 'acad.lsp' is loaded unless it
> is in the S::smileyfrustrated:tartup section.
>
> Actually, 'acadr14' is for Autodesk use and you should put nothing in it.
> Any external AutoLISP programs should have a stub loader, or an autoloading
> statement, in your 'acad.lsp'. That way the program isn't actually loaded
> and evaluated until you are ready to use it. There are also other means of
> loading external programs as well.
>
> If you would like more information on loading methods, please indicate such
> and someone will respond.
> --
> Dave D
>
> Eric Nagel wrote in article <380CE20A.37162685@eli.net>...
> > I forgot to mention that that I am loading this routine thru my
> > 'acadr14.lsp' file. When I appload the file, it works just fine...I'm
> > stumped...
> >
> > Eric Nagel wrote:
> >
> > > Greetings All !
> > > I am having an odd problem that I cannot seem to figure out. I am
> > > hoping someone will be able to help me out with this...Notice that I do
> > > not have an "mspace" command anywhere in my code. Any pointers would
> be
> > > thanked...
> > > Thanks,
> > > Eric
> > >
> > > Here is the error message that I am getting:
> > >
> > > Command: ls2 error: incorrect request for command list data
> > > (COMMAND ".mspace")
> > > (MAIN)
> > > ((LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN) (DONE_DIALOG))
> (<>
> > >
> > > #33e116c> "1") (<> "accept") (<> "")
> (<>
> > >
> > > #33e116c> 1) (<> 16) (<> 7))
> > > (APPLY (QUOTE (LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN)
> > > (DONE_DIALOG)))
> > > (QUOTE ("1" "accept" "" 1 16 7)))
> > > (START_DIALOG)
> > > (PROGN (ACTION_TILE "accept" "(MAIN) (done_dialog)") (ACTION_TILE
> > > "cancel"
> > > "(done_dialog)") (START_DIALOG) (UNLOAD_DIALOG DCL_ID) (LAYER))
> > > (IF (NEW_DIALOG "ls2" DCL_ID) (PROGN (ACTION_TILE "accept" "(MAIN)
> > > (done_dialog)") (ACTION_TILE "cancel" "(done_dialog)") (START_DIALOG)
> > > (UNLOAD_DIALOG DCL_ID) (LAYER)))
> > > (C:LS2)
> > >
> > > Here is my .lsp file:
> > >
> > > (defun c:LS2 (/)
> > > (setq dcl_id (load_dialog "ls2.dcl"))
> > > (if (new_dialog "ls2" dcl_id)
> > > (progn
> > > (action_tile "accept" "(MAIN) (done_dialog)")
> > > (action_tile "cancel" "(done_dialog)")
> > > (start_dialog)
> > > (unload_dialog dcl_id)
> > > (LAYER)
> > > )
> > > )
> > > (princ)
> > > )
> > >
> > > (defun MAIN ()
> > >
> > > (setq FP (get_tile "key_FP"))
> > > (setq CP (get_tile "key_CP"))
> > > (setq EL (get_tile "key_EL"))
> > > (setq EQ (get_tile "key_EQ"))
> > > (setq FM (get_tile "key_FM"))
> > > (setq GP (get_tile "key_GP"))
> > > (setq DET (get_tile "key_details"))
> > >
> > > (princ)
> > > )
> > >
> > > (defun LAYER (/ DET_MVIEW_SS FLR_MVIEW_SS)
> > > (setvar "CMDECHO" 0)
> > > (setq DET_MVIEW_SS (ssget "X" (list (cons 8 "DET_MVIEW"))))
> > > (setq FLR_MVIEW_SS (ssget "X" (list (cons 8 "FLR_MVIEW"))))
> > > (progn
> > > (cond
> > > ;; FLOOR PLAN ***************
> > > ((= FP "1")
> > > (setq CHECK (tblsearch "LAYER" "T_TITLE"))
> > > (setq ONOFF (assoc 62 CHECK))
> > > (setq ONOFF (cdr ONOFF))
> > > (if (< ONOFF 0)
> > > (command "LAYER" "ON" "T_cutline,T_misc,T_text,T_title" "")
> > > )
> > > (command "mview" "on" FLR_MVIEW_SS "")
> > > (command "-layer" "on" "FLR_MVIEW" "")
> > > (command "mview" "off" DET_MVIEW_SS "")
> > > (command "-layer" "off" "DET_MVIEW" "")
> > > (command "LAYER" "SET" "0" "")
> > > (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> "")
> > >
> > > (command "LAYER" "ON" "A_*" "")
> > > (command "LAYER" "ON" "EQ_*" "")
> > > )
> > > ;; CABLE PLAN ***************
> > > (( = CP "1")
> > > (command "mview" "on" FLR_MVIEW_SS "")
> > > (command "-layer" "on" "FLR_MVIEW" "")
> > > (command "mview" "off" DET_MVIEW_SS "")
> > > (command "-layer" "off" "DET_MVIEW" "")
> > > (command "LAYER" "SET" "0" "")
> > > (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> "")
> > >
> > > (command "LAYER" "ON" "A_*" "")
> > > (command "LAYER" "ON" "C_*" "")
> > > (command "LAYER" "ON" "EQ_*" "")
> > > (command "LAYER" "OFF" "EQ_DIM" "")
> > > (command "LAYER" "OFF" "EQ_TEXT" "")
> > > (command "LAYER" "OFF" "A_TEXT" "")
> > > (command "LAYER" "OFF" "A_dim" "")
> > > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > > )
> > > ;; ELECTRICAL PLAN ***************
> > > (( = EL "1")
> > > (command "mview" "on" FLR_MVIEW_SS "")
> > > (command "-layer" "on" "FLR_MVIEW" "")
> > > (command "mview" "off" DET_MVIEW_SS "")
> > > (command "-layer" "off" "DET_MVIEW" "")
> > > (command "LAYER" "SET" "0" "")
> > > (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> "")
> > >
> > > (command "LAYER" "ON" "A_*" "")
> > > (command "LAYER" "ON" "E_*" "")
> > > (command "LAYER" "ON" "EQ_*" "")
> > > (command "LAYER" "OFF" "EQ_DIM" "")
> > > (command "LAYER" "OFF" "EQ_TEXT" "")
> > > (command "LAYER" "OFF" "A_TEXT" "")
> > > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > > )
> > > ;; FIBER MANAGEMENT PLAN ***************
> > > (( = FM "1")
> > > (command "mview" "on" FLR_MVIEW_SS "")
> > > (command "-layer" "on" "FLR_MVIEW" "")
> > > (command "mview" "off" DET_MVIEW_SS "")
> > > (command "-layer" "off" "DET_MVIEW" "")
> > > (command "LAYER" "SET" "0" "")
> > > (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> "")
> > >
> > > (command "LAYER" "ON" "A_*" "")
> > > (command "LAYER" "ON" "EQ_*" "")
> > > (command "LAYER" "ON" "FM_*" "")
> > > (command "LAYER" "OFF" "EQ_DIM" "")
> > > (command "LAYER" "OFF" "EQ_TEXT" "")
> > > (command "LAYER" "OFF" "A_TEXT" "")
> > > (command "LAYER" "OFF" "A_dim" "")
> > > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > > )
> > > ;; GROUNDING PLAN ***************
> > > (( = GP "1")
> > > (command "mview" "on" FLR_MVIEW_SS "")
> > > (command "-layer" "on" "FLR_MVIEW" "")
> > > (command "mview" "off" DET_MVIEW_SS "")
> > > (command "-layer" "off" "DET_MVIEW" "")
> > > (command "LAYER" "SET" "0" "")
> > > (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> "")
> > >
> > > (command "LAYER" "ON" "A_*" "")
> > > (command "LAYER" "ON" "EQ_*" "")
> > > (command "LAYER" "ON" "G_*" "")
> > > (command "LAYER" "OFF" "EQ_DIM" "")
> > > (command "LAYER" "OFF" "EQ_TEXT" "")
> > > (command "LAYER" "OFF" "A_TEXT" "")
> > > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > > )
> > > ;; DETAILS SHEET *****************
> > > (( = DET "1")
> > > (setvar "CMDECHO" 0)
> > > (command "LAYER" "SET" "0" "")
> > > (command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> "")
> > >
> > > (command "-LAYER" "OFF" "T_MISC" "")
> > > (command "mview" "on" DET_MVIEW_SS "")
> > > (command "-layer" "on" "DET_MVIEW" "")
> > > (command "mview" "off" FLR_MVIEW_SS "")
> > > (command "-layer" "off" "FLR_MVIEW" "")
> > > (command "-layer" "on" "D_*" "")
> > > (princ)
> > > )
> > > )
> > > (setvar "CMDECHO" 1)
> > > )
> > > (princ)
> > > )
> > >
> > > And finally, my .dcl file:
> > >
> > > ls2 : dialog {
> > > label = "Layer Management v2.0";
> > > : text {
> > > label = "- Developed for Electric Lightwave, Inc.";
> > > }
> > > : text {
> > > label = "- Created by Eric Nagel (rev. 09/15/99)";
> > > }
> > > : boxed_row {
> > > label = "LAYERSET";
> > > : radio_column {
> > > : radio_button {
> > > label = "Floor Plan / Equipment Layout";
> > > key = "key_FP";
> > > }
> > > : radio_button {
> > > label = "Cable Rack Plan";
> > > key = "key_CP";
> > > }
> > > : radio_button {
> > > label = "Electrical Plan";
> > > key = "key_EL";
> > > }
> > > : radio_button {
> > > label = "Fiber Management";
> > > key = "key_FM";
> > > }
> > > : radio_button {
> > > label = "Grounding Plan";
> > > key = "key_GP";
> > > }
> > > : radio_button {
> > > label = "Details";
> > > key = "key_details";
> > > }
> > > }
> > > }
> > > ok_cancel;
> > > }
> > >
> > > --
> > > Eric Nagel
> > > Electric Lightwave, Inc.
> > > eric_nagel@eli.net
> >
> > --
> > Eric Nagel
> > Electric Lightwave, Inc.
> > eric_nagel@eli.net
> >
> >
> >

--
Eric Nagel
Electric Lightwave, Inc.
eric_nagel@eli.net
*Doane, David
Message 5 of 13 (65 Views)

Re:

10-19-1999 06:41 PM in reply to: *Nagel, Eric
Eric,

In part, perhaps I misunderstood how you were loading the program as I
thought you were pasting the whole program in 'acadr14' and not just a
loader. However, by advice still stands as far as placing anything in
'acadr14'.

I would have to see the load statement in your 'acad.lsp' to evaluate it.
If it's a case of (load "LS2") in the main body, it should be in the
S::smileyfrustrated:tartup section. However, I would still suggest loading on an as need
basis.

Also, as I am not versed in the DCL language, I cannot help you much there,
but there are others that surely can. While you do not use the command
'mspace' in your program, nor do you use 'lambda', and since the error
message points out six subroutines in succession, you might look at
something you are doing in a multiple of six. Just an idea. Also, I am
not familiar with 'command list data' either, but that is the key.

I have other thoughts, but they depend on whether you are pasting the whole
program in 'acad.lsp' or just a loader. However, at this point take a look
at the stub and autoloading information that I will paste below. If you
are familiar with it all, we'll both have a good laugh on me. When
you get this working, I would like to make some other suggestions
concerning the use of multiple instances of 'command' and 'setq', but one
thing at a time.

Here is the info written in general terms for R14 and A2K. Let us know if
it helps.

----------------------------------------------------------------------------
-------

The most efficient way is with (autoload file cmdlist), which can be placed
in any one of several files. Since I use a partial menu to override a
portion the ACAD.mnu, which I never alter, I use an accompanying .mnl file
for the overwrite instructions, and to hold my autoloader extension.
However, it will work great if just placed in Acad.lsp for R14, or
AcadDOC.lsp for AutoCAD 2000.

In AutoCAD 2000, Acad.lsp is just loaded when entering AutoCAD (unless
'lispasdoc' is set to 1), and AcadDOC.lsp is loaded with each drawing.

If you don't have an Acad.lsp or an AcadDOC.lsp, create a simple text file
with the extension .lsp and place it anywhere in the AutoCAD support path.
Your entry will look like this:

(autoload "filename" '("commandname"))

filename being without the .lsp extension, and commandname being the defun
name, as C:ENTLIST, as in the example:

(autoload "entlist" '("entlist"))
(autoload "nentlist" '("nentlist"))
(autoload "multilist" '("multilist"))

When you have multiple programs in one file, you would use:

(autoload "entlist" '("entlist" "nentlist" "multilist"))
(autoload "pie" '("apple" "peach" "pear" "pumpkin" "potato"))

Which in this case has three & five commands (programs) within each file.

This way the program files are not loaded until you need them, and the
loading is completely automatic. If you are using a menu, or at the
command prompt, the entry is simply the command, such as: entlist

If you wonder how it works, the autoloader engine has already been fired up
by AutoCAD, and you are just extending its capabilities.

Another way is to place a stub loader in your Acad.lsp or AcadDOC.lsp as:

(defun C:ENTLIST ()
(load "C:/alisp/entlist") (c:entlist)
)

The first time you invoke the command, the stub loader loads it and runs
the program. Afterward, the program just runs because the stub had been
superseded by the program.

I hope the heck all this makes sense.
--
Dave D
------------------------------------------------------
Eric Nagel wrote in article <380CF704.9B50C958@eli.net>...
> David,
> I cut my load statements out of my acadr14.lsp file and pasted them into
my
> acad.lsp file and restarted my AutoCAD, tried running my routine again,
which I
> have a button for, and the same error message came up again. I guess I
would
> like to look at some different options for loading AutoLISP
routine...This has
> really got me confused...it was working last Friday, and
now...nothing...???
> Eric
>
> David Doane wrote:
>
> > Eric,
> >
> > I'm thinking that AutoCAD is not ready to evaluate any "command"
statements
> > when 'acadr14' is being loaded, or even when 'acad.lsp' is loaded
unless it
> > is in the S::smileyfrustrated:tartup section.
> >
> > Actually, 'acadr14' is for Autodesk use and you should put nothing in
it.
> > Any external AutoLISP programs should have a stub loader, or an
autoloading
> > statement, in your 'acad.lsp'. That way the program isn't actually
loaded
> > and evaluated until you are ready to use it. There are also other
means of
> > loading external programs as well.
> >
> > If you would like more information on loading methods, please indicate
such
> > and someone will respond.
> > --
> > Dave D
> >
> > Eric Nagel wrote in article
<380CE20A.37162685@eli.net>...
> > > I forgot to mention that that I am loading this routine thru my
> > > 'acadr14.lsp' file. When I appload the file, it works just
fine...I'm
> > > stumped...
> > >
> > > Eric Nagel wrote:
> > >
> > > > Greetings All !
> > > > I am having an odd problem that I cannot seem to figure out. I am
> > > > hoping someone will be able to help me out with this...Notice that
I do
> > > > not have an "mspace" command anywhere in my code. Any pointers
would
> > be
> > > > thanked...
> > > > Thanks,
> > > > Eric
> > > >
> > > > Here is the error message that I am getting:
> > > >
> > > > Command: ls2 error: incorrect request for command list data
> > > > (COMMAND ".mspace")
> > > > (MAIN)
> > > > ((LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN) (DONE_DIALOG))
> > (<>
> > > >
> > > > #33e116c> "1") (<> "accept") (<> "")
> > (<>
> > > >
> > > > #33e116c> 1) (<> 16) (<> 7))
> > > > (APPLY (QUOTE (LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN)
> > > > (DONE_DIALOG)))
> > > > (QUOTE ("1" "accept" "" 1 16 7)))
> > > > (START_DIALOG)
> > > > (PROGN (ACTION_TILE "accept" "(MAIN) (done_dialog)") (ACTION_TILE
> > > > "cancel"
> > > > "(done_dialog)") (START_DIALOG) (UNLOAD_DIALOG DCL_ID) (LAYER))
> > > > (IF (NEW_DIALOG "ls2" DCL_ID) (PROGN (ACTION_TILE "accept" "(MAIN)
> > > > (done_dialog)") (ACTION_TILE "cancel" "(done_dialog)")
(START_DIALOG)
> > > > (UNLOAD_DIALOG DCL_ID) (LAYER)))
> > > > (C:LS2)
> > > >
> > > > Here is my .lsp file:
> > > >
> > > > (defun c:LS2 (/)
> > > > (setq dcl_id (load_dialog "ls2.dcl"))
> > > > (if (new_dialog "ls2" dcl_id)
> > > > (progn
> > > > (action_tile "accept" "(MAIN) (done_dialog)")
> > > > (action_tile "cancel" "(done_dialog)")
> > > > (start_dialog)
> > > > (unload_dialog dcl_id)
> > > > (LAYER)
> > > > )
> > > > )
> > > > (princ)
> > > > )
> > > >
> > > > (defun MAIN ()
> > > >
> > > > (setq FP (get_tile "key_FP"))
> > > > (setq CP (get_tile "key_CP"))
> > > > (setq EL (get_tile "key_EL"))
> > > > (setq EQ (get_tile "key_EQ"))
> > > > (setq FM (get_tile "key_FM"))
> > > > (setq GP (get_tile "key_GP"))
> > > > (setq DET (get_tile "key_details"))
> > > >
> > > > (princ)
> > > > )
> > > >
> > > > (defun LAYER (/ DET_MVIEW_SS FLR_MVIEW_SS)
> > > > (setvar "CMDECHO" 0)
> > > > (setq DET_MVIEW_SS (ssget "X" (list (cons 8 "DET_MVIEW"))))
> > > > (setq FLR_MVIEW_SS (ssget "X" (list (cons 8 "FLR_MVIEW"))))
> > > > (progn
> > > > (cond
> > > > ;; FLOOR PLAN ***************
> > > > ((= FP "1")
> > > > (setq CHECK (tblsearch "LAYER" "T_TITLE"))
> > > > (setq ONOFF (assoc 62 CHECK))
> > > > (setq ONOFF (cdr ONOFF))
> > > > (if (< ONOFF 0)
> > > > (command "LAYER" "ON" "T_cutline,T_misc,T_text,T_title" "")
> > > > )
> > > > (command "mview" "on" FLR_MVIEW_SS "")
> > > > (command "-layer" "on" "FLR_MVIEW" "")
> > > > (command "mview" "off" DET_MVIEW_SS "")
> > > > (command "-layer" "off" "DET_MVIEW" "")
> > > > (command "LAYER" "SET" "0" "")
> > > > (command "LAYER" "OFF"
"A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> > "")
> > > >
> > > > (command "LAYER" "ON" "A_*" "")
> > > > (command "LAYER" "ON" "EQ_*" "")
> > > > )
> > > > ;; CABLE PLAN ***************
> > > > (( = CP "1")
> > > > (command "mview" "on" FLR_MVIEW_SS "")
> > > > (command "-layer" "on" "FLR_MVIEW" "")
> > > > (command "mview" "off" DET_MVIEW_SS "")
> > > > (command "-layer" "off" "DET_MVIEW" "")
> > > > (command "LAYER" "SET" "0" "")
> > > > (command "LAYER" "OFF"
"A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> > "")
> > > >
> > > > (command "LAYER" "ON" "A_*" "")
> > > > (command "LAYER" "ON" "C_*" "")
> > > > (command "LAYER" "ON" "EQ_*" "")
> > > > (command "LAYER" "OFF" "EQ_DIM" "")
> > > > (command "LAYER" "OFF" "EQ_TEXT" "")
> > > > (command "LAYER" "OFF" "A_TEXT" "")
> > > > (command "LAYER" "OFF" "A_dim" "")
> > > > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > > > )
> > > > ;; ELECTRICAL PLAN ***************
> > > > (( = EL "1")
> > > > (command "mview" "on" FLR_MVIEW_SS "")
> > > > (command "-layer" "on" "FLR_MVIEW" "")
> > > > (command "mview" "off" DET_MVIEW_SS "")
> > > > (command "-layer" "off" "DET_MVIEW" "")
> > > > (command "LAYER" "SET" "0" "")
> > > > (command "LAYER" "OFF"
"A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> > "")
> > > >
> > > > (command "LAYER" "ON" "A_*" "")
> > > > (command "LAYER" "ON" "E_*" "")
> > > > (command "LAYER" "ON" "EQ_*" "")
> > > > (command "LAYER" "OFF" "EQ_DIM" "")
> > > > (command "LAYER" "OFF" "EQ_TEXT" "")
> > > > (command "LAYER" "OFF" "A_TEXT" "")
> > > > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > > > )
> > > > ;; FIBER MANAGEMENT PLAN ***************
> > > > (( = FM "1")
> > > > (command "mview" "on" FLR_MVIEW_SS "")
> > > > (command "-layer" "on" "FLR_MVIEW" "")
> > > > (command "mview" "off" DET_MVIEW_SS "")
> > > > (command "-layer" "off" "DET_MVIEW" "")
> > > > (command "LAYER" "SET" "0" "")
> > > > (command "LAYER" "OFF"
"A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> > "")
> > > >
> > > > (command "LAYER" "ON" "A_*" "")
> > > > (command "LAYER" "ON" "EQ_*" "")
> > > > (command "LAYER" "ON" "FM_*" "")
> > > > (command "LAYER" "OFF" "EQ_DIM" "")
> > > > (command "LAYER" "OFF" "EQ_TEXT" "")
> > > > (command "LAYER" "OFF" "A_TEXT" "")
> > > > (command "LAYER" "OFF" "A_dim" "")
> > > > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > > > )
> > > > ;; GROUNDING PLAN ***************
> > > > (( = GP "1")
> > > > (command "mview" "on" FLR_MVIEW_SS "")
> > > > (command "-layer" "on" "FLR_MVIEW" "")
> > > > (command "mview" "off" DET_MVIEW_SS "")
> > > > (command "-layer" "off" "DET_MVIEW" "")
> > > > (command "LAYER" "SET" "0" "")
> > > > (command "LAYER" "OFF"
"A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> > "")
> > > >
> > > > (command "LAYER" "ON" "A_*" "")
> > > > (command "LAYER" "ON" "EQ_*" "")
> > > > (command "LAYER" "ON" "G_*" "")
> > > > (command "LAYER" "OFF" "EQ_DIM" "")
> > > > (command "LAYER" "OFF" "EQ_TEXT" "")
> > > > (command "LAYER" "OFF" "A_TEXT" "")
> > > > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > > > )
> > > > ;; DETAILS SHEET *****************
> > > > (( = DET "1")
> > > > (setvar "CMDECHO" 0)
> > > > (command "LAYER" "SET" "0" "")
> > > > (command "LAYER" "OFF"
"A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> > "")
> > > >
> > > > (command "-LAYER" "OFF" "T_MISC" "")
> > > > (command "mview" "on" DET_MVIEW_SS "")
> > > > (command "-layer" "on" "DET_MVIEW" "")
> > > > (command "mview" "off" FLR_MVIEW_SS "")
> > > > (command "-layer" "off" "FLR_MVIEW" "")
> > > > (command "-layer" "on" "D_*" "")
> > > > (princ)
> > > > )
> > > > )
> > > > (setvar "CMDECHO" 1)
> > > > )
> > > > (princ)
> > > > )
> > > >
> > > > And finally, my .dcl file:
> > > >
> > > > ls2 : dialog {
> > > > label = "Layer Management v2.0";
> > > > : text {
> > > > label = "- Developed for Electric Lightwave, Inc.";
> > > > }
> > > > : text {
> > > > label = "- Created by Eric Nagel (rev. 09/15/99)";
> > > > }
> > > > : boxed_row {
> > > > label = "LAYERSET";
> > > > : radio_column {
> > > > : radio_button {
> > > > label = "Floor Plan / Equipment Layout";
> > > > key = "key_FP";
> > > > }
> > > > : radio_button {
> > > > label = "Cable Rack Plan";
> > > > key = "key_CP";
> > > > }
> > > > : radio_button {
> > > > label = "Electrical Plan";
> > > > key = "key_EL";
> > > > }
> > > > : radio_button {
> > > > label = "Fiber Management";
> > > > key = "key_FM";
> > > > }
> > > > : radio_button {
> > > > label = "Grounding Plan";
> > > > key = "key_GP";
> > > > }
> > > > : radio_button {
> > > > label = "Details";
> > > > key = "key_details";
> > > > }
> > > > }
> > > > }
> > > > ok_cancel;
> > > > }
> > > >
> > > > --
> > > > Eric Nagel
> > > > Electric Lightwave, Inc.
> > > > eric_nagel@eli.net
> > >
> > > --
> > > Eric Nagel
> > > Electric Lightwave, Inc.
> > > eric_nagel@eli.net
> > >
> > >
> > >
>
> --
> Eric Nagel
> Electric Lightwave, Inc.
> eric_nagel@eli.net
>
>
>
*Puckett, Michael
Message 6 of 13 (65 Views)

Re: LISP QUESTION

10-19-1999 11:20 PM in reply to: *Nagel, Eric
The error you quote occurs when you call any function not valid while a dialog
is active, e.g. (command ..), (entmake ...) etc. Yet it appears the only
function that is called while the dialog is active is (main) which does not make
any calls to (command ..) or other functions not allowed during dialog activity
(see the customization guide).

_________

However, just persuing your code I found the following:

In (main) you have used the symbol name 'eg' as a variable, redefining a
standard function. Any subsequent call to the eq function will result in the
calling function bombing, be it your code, someone else's code, or an AutoLISP
behind the scenes call. I find you reference all other variables defined as
globals in (main) from (layers), but not 'eq'. Is this a typo?

_________

General stuff I noticed ---

In (layers) you are using the progn function superfluously as the parent nest of
a cond statement.

You have:

(progn
(cond
( (= FP "1")
...
)
...
)
)

All that's needed is:

(cond
( (= FP "1")
...
)
...
)

_________

In (layers) you assume layer "t_title" exists, and if it's off, turn on a bunch
of layers ---

Your code:

(setq CHECK (tblsearch "LAYER" "T_TITLE"))
(setq ONOFF (assoc 62 CHECK))
(setq ONOFF (cdr ONOFF))
(if (< ONOFF 0)
(command "LAYER" "ON" "T_cutline,T_misc,T_text,T_title" "")
)

A suggestion ---

(command "._layer")
(foreach x '("t_cutline" "t_misc" "t_text" "t_title")
(if (setq check (tblsearch "layer" x))
(if (minusp (cdr (assoc 62 check)))
(command "_on" x)
)
(command "_new" x)
)
)
(command "")

This way the layer is turned on if it exists and is off, otherwise it is
created (if it doesn't exist). I'm guessing by your code you need
these layers. If not, the (command ".new" x) is not required.
Since there is only one call to command it will also be faster than
individual calls like (command "._layer" "_on" x ""), a technique
much of your subsequent code could benefit from.

< I actually use entmake/entmod, but I think I'll not suggest that here >.
If you want details I'll provide them in another post.

_________

You have many calls to (command ...). Some of these calls require object
selection ---

Your code:

(command "mview" "on" DET_MVIEW_SS "")

If det_mview_ss is not set to a valid selection set, the command may not
terminate correctly. Anytime (command ...) does not teminate correctly, there
is the chance the next call to (command ...), or a call to terminate a command
=> (command "") <= in fact recalls the last thing that was called via command
prior to execution of this program (c:ls2), be it by the user or another lisp
program. Said previous command could be 'mspace'.

The method you are using to make a selection set of viewports, is not fullproof,
nor do you test the variable before using it:

Your code:

(setq DET_MVIEW_SS (ssget "X" (list (cons 8 "DET_MVIEW"))))

All this does is grab all the objects on the noted layer. How can you be sure
only viewports are grabbed, and that any viewports were actually found?

A suggestion is to be more explicit in your selection set creation, and test it
before you use it:

(setq
det_mview_ss
(ssget "x"
'( (8 . "det_mview")
; only grab viewports
(0 . "viewport")
; don't grab paperspace viewport
; which is always vport 1
(-4 . "")
)
)
)

Later in your code test the variable before using:

(if det_mview_ss (command "._mview" "_on" det_mview_ss ""))

I generally create selection sets right where I'm going to use them, as part of
the test:

(if
(setq
det_mview_ss
(ssget "x"
'((8 . "det_mview")(0 . "viewport")(-4 . ""))
)
)
(command "._mview" "_on" det_mview_ss "")
)

_________

More stuff ---

Question --- Why do you jump back and forth between (command "layer" ...) and
(command "-layer" ...) ?

Question --- Why turn off, and then back on, some of the same layer wildcard
specs? Aren't you finding your screen flashing a lot as a result of this code?
Perhaps some logical regrouping, and then a reduction in calls to the layer
command can reduce the flashing and speed up the routine. See the following.

Suggestion --- The use of foreach could significantly reduce the amount of code
you have for all the turning on and off of layers, and make management of your
code easier, and if set up correctly, will be much faster, particularly if you
limit yourself to one call to (command "._layer ...). An example was provided
near the beginning of this message.

(Entmod ...) may also be an alternative in the future.

_________

All in all, this does not solve your problem, but it does offer other details
you may be interested in at some point.

Well that just about exhausts my welcome, and oh look, time to crash.

Cheers.

________________________________

puckettm@cadvision.com
> Not < a Member of the AutoDESK
Discussion Forum Moderator Program
Imagination makes all things possible.
________________________________

Eric Nagel wrote in message news:380CDE80.889BA16B@eli.net...
Greetings All !
I am having an odd problem that I cannot seem to figure out. I am
hoping someone will be able to help me out with this...Notice that I do
not have an "mspace" command anywhere in my code. Any pointers would be
thanked...
Thanks,
Eric

Here is the error message that I am getting:

Command: ls2 error: incorrect request for command list data
(COMMAND ".mspace")
(MAIN)
((LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN) (DONE_DIALOG)) (<>

#33e116c> "1") (<> "accept") (<> "") (<>

#33e116c> 1) (<> 16) (<> 7))
(APPLY (QUOTE (LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN)
(DONE_DIALOG)))
(QUOTE ("1" "accept" "" 1 16 7)))
(START_DIALOG)
(PROGN (ACTION_TILE "accept" "(MAIN) (done_dialog)") (ACTION_TILE
"cancel"
"(done_dialog)") (START_DIALOG) (UNLOAD_DIALOG DCL_ID) (LAYER))
(IF (NEW_DIALOG "ls2" DCL_ID) (PROGN (ACTION_TILE "accept" "(MAIN)
(done_dialog)") (ACTION_TILE "cancel" "(done_dialog)") (START_DIALOG)
(UNLOAD_DIALOG DCL_ID) (LAYER)))
(C:LS2)

Here is my .lsp file:

(defun c:LS2 (/)
(setq dcl_id (load_dialog "ls2.dcl"))
(if (new_dialog "ls2" dcl_id)
(progn
(action_tile "accept" "(MAIN) (done_dialog)")
(action_tile "cancel" "(done_dialog)")
(start_dialog)
(unload_dialog dcl_id)
(LAYER)
)
)
(princ)
)

(defun MAIN ()

(setq FP (get_tile "key_FP"))
(setq CP (get_tile "key_CP"))
(setq EL (get_tile "key_EL"))
(setq EQ (get_tile "key_EQ"))
(setq FM (get_tile "key_FM"))
(setq GP (get_tile "key_GP"))
(setq DET (get_tile "key_details"))

(princ)
)

(defun LAYER (/ DET_MVIEW_SS FLR_MVIEW_SS)
(setvar "CMDECHO" 0)
(setq DET_MVIEW_SS (ssget "X" (list (cons 8 "DET_MVIEW"))))
(setq FLR_MVIEW_SS (ssget "X" (list (cons 8 "FLR_MVIEW"))))
(progn
(cond
;; FLOOR PLAN ***************
((= FP "1")
(setq CHECK (tblsearch "LAYER" "T_TITLE"))
(setq ONOFF (assoc 62 CHECK))
(setq ONOFF (cdr ONOFF))
(if (< ONOFF 0)
(command "LAYER" "ON" "T_cutline,T_misc,T_text,T_title" "")
)
(command "mview" "on" FLR_MVIEW_SS "")
(command "-layer" "on" "FLR_MVIEW" "")
(command "mview" "off" DET_MVIEW_SS "")
(command "-layer" "off" "DET_MVIEW" "")
(command "LAYER" "SET" "0" "")
(command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")

(command "LAYER" "ON" "A_*" "")
(command "LAYER" "ON" "EQ_*" "")
)
;; CABLE PLAN ***************
(( = CP "1")
(command "mview" "on" FLR_MVIEW_SS "")
(command "-layer" "on" "FLR_MVIEW" "")
(command "mview" "off" DET_MVIEW_SS "")
(command "-layer" "off" "DET_MVIEW" "")
(command "LAYER" "SET" "0" "")
(command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")

(command "LAYER" "ON" "A_*" "")
(command "LAYER" "ON" "C_*" "")
(command "LAYER" "ON" "EQ_*" "")
(command "LAYER" "OFF" "EQ_DIM" "")
(command "LAYER" "OFF" "EQ_TEXT" "")
(command "LAYER" "OFF" "A_TEXT" "")
(command "LAYER" "OFF" "A_dim" "")
(command "LAYER" "OFF" "A_STRUCT_GRID" "")
)
;; ELECTRICAL PLAN ***************
(( = EL "1")
(command "mview" "on" FLR_MVIEW_SS "")
(command "-layer" "on" "FLR_MVIEW" "")
(command "mview" "off" DET_MVIEW_SS "")
(command "-layer" "off" "DET_MVIEW" "")
(command "LAYER" "SET" "0" "")
(command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")

(command "LAYER" "ON" "A_*" "")
(command "LAYER" "ON" "E_*" "")
(command "LAYER" "ON" "EQ_*" "")
(command "LAYER" "OFF" "EQ_DIM" "")
(command "LAYER" "OFF" "EQ_TEXT" "")
(command "LAYER" "OFF" "A_TEXT" "")
(command "LAYER" "OFF" "A_STRUCT_GRID" "")
)
;; FIBER MANAGEMENT PLAN ***************
(( = FM "1")
(command "mview" "on" FLR_MVIEW_SS "")
(command "-layer" "on" "FLR_MVIEW" "")
(command "mview" "off" DET_MVIEW_SS "")
(command "-layer" "off" "DET_MVIEW" "")
(command "LAYER" "SET" "0" "")
(command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")

(command "LAYER" "ON" "A_*" "")
(command "LAYER" "ON" "EQ_*" "")
(command "LAYER" "ON" "FM_*" "")
(command "LAYER" "OFF" "EQ_DIM" "")
(command "LAYER" "OFF" "EQ_TEXT" "")
(command "LAYER" "OFF" "A_TEXT" "")
(command "LAYER" "OFF" "A_dim" "")
(command "LAYER" "OFF" "A_STRUCT_GRID" "")
)
;; GROUNDING PLAN ***************
(( = GP "1")
(command "mview" "on" FLR_MVIEW_SS "")
(command "-layer" "on" "FLR_MVIEW" "")
(command "mview" "off" DET_MVIEW_SS "")
(command "-layer" "off" "DET_MVIEW" "")
(command "LAYER" "SET" "0" "")
(command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")

(command "LAYER" "ON" "A_*" "")
(command "LAYER" "ON" "EQ_*" "")
(command "LAYER" "ON" "G_*" "")
(command "LAYER" "OFF" "EQ_DIM" "")
(command "LAYER" "OFF" "EQ_TEXT" "")
(command "LAYER" "OFF" "A_TEXT" "")
(command "LAYER" "OFF" "A_STRUCT_GRID" "")
)
;; DETAILS SHEET *****************
(( = DET "1")
(setvar "CMDECHO" 0)
(command "LAYER" "SET" "0" "")
(command "LAYER" "OFF" "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER" "")

(command "-LAYER" "OFF" "T_MISC" "")
(command "mview" "on" DET_MVIEW_SS "")
(command "-layer" "on" "DET_MVIEW" "")
(command "mview" "off" FLR_MVIEW_SS "")
(command "-layer" "off" "FLR_MVIEW" "")
(command "-layer" "on" "D_*" "")
(princ)
)
)
(setvar "CMDECHO" 1)
)
(princ)
)

And finally, my .dcl file:

ls2 : dialog {
label = "Layer Management v2.0";
: text {
label = "- Developed for Electric Lightwave, Inc.";
}
: text {
label = "- Created by Eric Nagel (rev. 09/15/99)";
}
: boxed_row {
label = "LAYERSET";
: radio_column {
: radio_button {
label = "Floor Plan / Equipment Layout";
key = "key_FP";
}
: radio_button {
label = "Cable Rack Plan";
key = "key_CP";
}
: radio_button {
label = "Electrical Plan";
key = "key_EL";
}
: radio_button {
label = "Fiber Management";
key = "key_FM";
}
: radio_button {
label = "Grounding Plan";
key = "key_GP";
}
: radio_button {
label = "Details";
key = "key_details";
}
}
}
ok_cancel;
}

--
Eric Nagel
Electric Lightwave, Inc.
eric_nagel@eli.net
*Keller, Rick
Message 7 of 13 (65 Views)

Re:

10-20-1999 04:38 AM in reply to: *Nagel, Eric
Question:
Your not in mspace when trying to mview, are you?

Rick

David Doane wrote in message
news:01bf1a9c$54aff020$3b876ace@lms-1...
> Eric,
>
> In part, perhaps I misunderstood how you were loading the program as I
> thought you were pasting the whole program in 'acadr14' and not just a
> loader. However, by advice still stands as far as placing anything in
> 'acadr14'.
>
> I would have to see the load statement in your 'acad.lsp' to evaluate it.
> If it's a case of (load "LS2") in the main body, it should be in the
> S::smileyfrustrated:tartup section. However, I would still suggest loading on an as need
> basis.
>
> Also, as I am not versed in the DCL language, I cannot help you much
there,
> but there are others that surely can. While you do not use the command
> 'mspace' in your program, nor do you use 'lambda', and since the error
> message points out six subroutines in succession, you might look at
> something you are doing in a multiple of six. Just an idea. Also, I am
> not familiar with 'command list data' either, but that is the key.
>
> I have other thoughts, but they depend on whether you are pasting the
whole
> program in 'acad.lsp' or just a loader. However, at this point take a
look
> at the stub and autoloading information that I will paste below. If you
> are familiar with it all, we'll both have a good laugh on me. When
> you get this working, I would like to make some other suggestions
> concerning the use of multiple instances of 'command' and 'setq', but one
> thing at a time.
>
> Here is the info written in general terms for R14 and A2K. Let us know if
> it helps.
>
> --------------------------------------------------------------------------
--
> -------
>
> The most efficient way is with (autoload file cmdlist), which can be
placed
> in any one of several files. Since I use a partial menu to override a
> portion the ACAD.mnu, which I never alter, I use an accompanying .mnl file
> for the overwrite instructions, and to hold my autoloader extension.
> However, it will work great if just placed in Acad.lsp for R14, or
> AcadDOC.lsp for AutoCAD 2000.
>
> In AutoCAD 2000, Acad.lsp is just loaded when entering AutoCAD (unless
> 'lispasdoc' is set to 1), and AcadDOC.lsp is loaded with each drawing.
>
> If you don't have an Acad.lsp or an AcadDOC.lsp, create a simple text file
> with the extension .lsp and place it anywhere in the AutoCAD support path.
> Your entry will look like this:
>
> (autoload "filename" '("commandname"))
>
> filename being without the .lsp extension, and commandname being the defun
> name, as C:ENTLIST, as in the example:
>
> (autoload "entlist" '("entlist"))
> (autoload "nentlist" '("nentlist"))
> (autoload "multilist" '("multilist"))
>
> When you have multiple programs in one file, you would use:
>
> (autoload "entlist" '("entlist" "nentlist" "multilist"))
> (autoload "pie" '("apple" "peach" "pear" "pumpkin" "potato"))
>
> Which in this case has three & five commands (programs) within each file.
>
> This way the program files are not loaded until you need them, and the
> loading is completely automatic. If you are using a menu, or at the
> command prompt, the entry is simply the command, such as: entlist
>
> If you wonder how it works, the autoloader engine has already been fired
up
> by AutoCAD, and you are just extending its capabilities.
>
> Another way is to place a stub loader in your Acad.lsp or AcadDOC.lsp as:
>
> (defun C:ENTLIST ()
> (load "C:/alisp/entlist") (c:entlist)
> )
>
> The first time you invoke the command, the stub loader loads it and runs
> the program. Afterward, the program just runs because the stub had been
> superseded by the program.
>
> I hope the heck all this makes sense.
> --
> Dave D
> ------------------------------------------------------
> Eric Nagel wrote in article
<380CF704.9B50C958@eli.net>...
> > David,
> > I cut my load statements out of my acadr14.lsp file and pasted them into
> my
> > acad.lsp file and restarted my AutoCAD, tried running my routine again,
> which I
> > have a button for, and the same error message came up again. I guess I
> would
> > like to look at some different options for loading AutoLISP
> routine...This has
> > really got me confused...it was working last Friday, and
> now...nothing...???
> > Eric
> >
> > David Doane wrote:
> >
> > > Eric,
> > >
> > > I'm thinking that AutoCAD is not ready to evaluate any "command"
> statements
> > > when 'acadr14' is being loaded, or even when 'acad.lsp' is loaded
> unless it
> > > is in the S::smileyfrustrated:tartup section.
> > >
> > > Actually, 'acadr14' is for Autodesk use and you should put nothing in
> it.
> > > Any external AutoLISP programs should have a stub loader, or an
> autoloading
> > > statement, in your 'acad.lsp'. That way the program isn't actually
> loaded
> > > and evaluated until you are ready to use it. There are also other
> means of
> > > loading external programs as well.
> > >
> > > If you would like more information on loading methods, please indicate
> such
> > > and someone will respond.
> > > --
> > > Dave D
> > >
> > > Eric Nagel wrote in article
> <380CE20A.37162685@eli.net>...
> > > > I forgot to mention that that I am loading this routine thru my
> > > > 'acadr14.lsp' file. When I appload the file, it works just
> fine...I'm
> > > > stumped...
> > > >
> > > > Eric Nagel wrote:
> > > >
> > > > > Greetings All !
> > > > > I am having an odd problem that I cannot seem to figure out. I am
> > > > > hoping someone will be able to help me out with this...Notice that
> I do
> > > > > not have an "mspace" command anywhere in my code. Any pointers
> would
> > > be
> > > > > thanked...
> > > > > Thanks,
> > > > > Eric
> > > > >
> > > > > Here is the error message that I am getting:
> > > > >
> > > > > Command: ls2 error: incorrect request for command list data
> > > > > (COMMAND ".mspace")
> > > > > (MAIN)
> > > > > ((LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN) (DONE_DIALOG))
> > > (<>
> > > > >
> > > > > #33e116c> "1") (<> "accept") (<> "")
> > > (<>
> > > > >
> > > > > #33e116c> 1) (<> 16) (<> 7))
> > > > > (APPLY (QUOTE (LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN)
> > > > > (DONE_DIALOG)))
> > > > > (QUOTE ("1" "accept" "" 1 16 7)))
> > > > > (START_DIALOG)
> > > > > (PROGN (ACTION_TILE "accept" "(MAIN) (done_dialog)") (ACTION_TILE
> > > > > "cancel"
> > > > > "(done_dialog)") (START_DIALOG) (UNLOAD_DIALOG DCL_ID) (LAYER))
> > > > > (IF (NEW_DIALOG "ls2" DCL_ID) (PROGN (ACTION_TILE "accept" "(MAIN)
> > > > > (done_dialog)") (ACTION_TILE "cancel" "(done_dialog)")
> (START_DIALOG)
> > > > > (UNLOAD_DIALOG DCL_ID) (LAYER)))
> > > > > (C:LS2)
> > > > >
> > > > > Here is my .lsp file:
> > > > >
> > > > > (defun c:LS2 (/)
> > > > > (setq dcl_id (load_dialog "ls2.dcl"))
> > > > > (if (new_dialog "ls2" dcl_id)
> > > > > (progn
> > > > > (action_tile "accept" "(MAIN) (done_dialog)")
> > > > > (action_tile "cancel" "(done_dialog)")
> > > > > (start_dialog)
> > > > > (unload_dialog dcl_id)
> > > > > (LAYER)
> > > > > )
> > > > > )
> > > > > (princ)
> > > > > )
> > > > >
> > > > > (defun MAIN ()
> > > > >
> > > > > (setq FP (get_tile "key_FP"))
> > > > > (setq CP (get_tile "key_CP"))
> > > > > (setq EL (get_tile "key_EL"))
> > > > > (setq EQ (get_tile "key_EQ"))
> > > > > (setq FM (get_tile "key_FM"))
> > > > > (setq GP (get_tile "key_GP"))
> > > > > (setq DET (get_tile "key_details"))
> > > > >
> > > > > (princ)
> > > > > )
> > > > >
> > > > > (defun LAYER (/ DET_MVIEW_SS FLR_MVIEW_SS)
> > > > > (setvar "CMDECHO" 0)
> > > > > (setq DET_MVIEW_SS (ssget "X" (list (cons 8 "DET_MVIEW"))))
> > > > > (setq FLR_MVIEW_SS (ssget "X" (list (cons 8 "FLR_MVIEW"))))
> > > > > (progn
> > > > > (cond
> > > > > ;; FLOOR PLAN ***************
> > > > > ((= FP "1")
> > > > > (setq CHECK (tblsearch "LAYER" "T_TITLE"))
> > > > > (setq ONOFF (assoc 62 CHECK))
> > > > > (setq ONOFF (cdr ONOFF))
> > > > > (if (< ONOFF 0)
> > > > > (command "LAYER" "ON" "T_cutline,T_misc,T_text,T_title" "")
> > > > > )
> > > > > (command "mview" "on" FLR_MVIEW_SS "")
> > > > > (command "-layer" "on" "FLR_MVIEW" "")
> > > > > (command "mview" "off" DET_MVIEW_SS "")
> > > > > (command "-layer" "off" "DET_MVIEW" "")
> > > > > (command "LAYER" "SET" "0" "")
> > > > > (command "LAYER" "OFF"
> "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> > > "")
> > > > >
> > > > > (command "LAYER" "ON" "A_*" "")
> > > > > (command "LAYER" "ON" "EQ_*" "")
> > > > > )
> > > > > ;; CABLE PLAN ***************
> > > > > (( = CP "1")
> > > > > (command "mview" "on" FLR_MVIEW_SS "")
> > > > > (command "-layer" "on" "FLR_MVIEW" "")
> > > > > (command "mview" "off" DET_MVIEW_SS "")
> > > > > (command "-layer" "off" "DET_MVIEW" "")
> > > > > (command "LAYER" "SET" "0" "")
> > > > > (command "LAYER" "OFF"
> "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> > > "")
> > > > >
> > > > > (command "LAYER" "ON" "A_*" "")
> > > > > (command "LAYER" "ON" "C_*" "")
> > > > > (command "LAYER" "ON" "EQ_*" "")
> > > > > (command "LAYER" "OFF" "EQ_DIM" "")
> > > > > (command "LAYER" "OFF" "EQ_TEXT" "")
> > > > > (command "LAYER" "OFF" "A_TEXT" "")
> > > > > (command "LAYER" "OFF" "A_dim" "")
> > > > > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > > > > )
> > > > > ;; ELECTRICAL PLAN ***************
> > > > > (( = EL "1")
> > > > > (command "mview" "on" FLR_MVIEW_SS "")
> > > > > (command "-layer" "on" "FLR_MVIEW" "")
> > > > > (command "mview" "off" DET_MVIEW_SS "")
> > > > > (command "-layer" "off" "DET_MVIEW" "")
> > > > > (command "LAYER" "SET" "0" "")
> > > > > (command "LAYER" "OFF"
> "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> > > "")
> > > > >
> > > > > (command "LAYER" "ON" "A_*" "")
> > > > > (command "LAYER" "ON" "E_*" "")
> > > > > (command "LAYER" "ON" "EQ_*" "")
> > > > > (command "LAYER" "OFF" "EQ_DIM" "")
> > > > > (command "LAYER" "OFF" "EQ_TEXT" "")
> > > > > (command "LAYER" "OFF" "A_TEXT" "")
> > > > > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > > > > )
> > > > > ;; FIBER MANAGEMENT PLAN ***************
> > > > > (( = FM "1")
> > > > > (command "mview" "on" FLR_MVIEW_SS "")
> > > > > (command "-layer" "on" "FLR_MVIEW" "")
> > > > > (command "mview" "off" DET_MVIEW_SS "")
> > > > > (command "-layer" "off" "DET_MVIEW" "")
> > > > > (command "LAYER" "SET" "0" "")
> > > > > (command "LAYER" "OFF"
> "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> > > "")
> > > > >
> > > > > (command "LAYER" "ON" "A_*" "")
> > > > > (command "LAYER" "ON" "EQ_*" "")
> > > > > (command "LAYER" "ON" "FM_*" "")
> > > > > (command "LAYER" "OFF" "EQ_DIM" "")
> > > > > (command "LAYER" "OFF" "EQ_TEXT" "")
> > > > > (command "LAYER" "OFF" "A_TEXT" "")
> > > > > (command "LAYER" "OFF" "A_dim" "")
> > > > > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > > > > )
> > > > > ;; GROUNDING PLAN ***************
> > > > > (( = GP "1")
> > > > > (command "mview" "on" FLR_MVIEW_SS "")
> > > > > (command "-layer" "on" "FLR_MVIEW" "")
> > > > > (command "mview" "off" DET_MVIEW_SS "")
> > > > > (command "-layer" "off" "DET_MVIEW" "")
> > > > > (command "LAYER" "SET" "0" "")
> > > > > (command "LAYER" "OFF"
> "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> > > "")
> > > > >
> > > > > (command "LAYER" "ON" "A_*" "")
> > > > > (command "LAYER" "ON" "EQ_*" "")
> > > > > (command "LAYER" "ON" "G_*" "")
> > > > > (command "LAYER" "OFF" "EQ_DIM" "")
> > > > > (command "LAYER" "OFF" "EQ_TEXT" "")
> > > > > (command "LAYER" "OFF" "A_TEXT" "")
> > > > > (command "LAYER" "OFF" "A_STRUCT_GRID" "")
> > > > > )
> > > > > ;; DETAILS SHEET *****************
> > > > > (( = DET "1")
> > > > > (setvar "CMDECHO" 0)
> > > > > (command "LAYER" "SET" "0" "")
> > > > > (command "LAYER" "OFF"
> "A_*,C_*,D_*,E_*,EQ_*,FM_*,G_*,URLLAYER"
> > > "")
> > > > >
> > > > > (command "-LAYER" "OFF" "T_MISC" "")
> > > > > (command "mview" "on" DET_MVIEW_SS "")
> > > > > (command "-layer" "on" "DET_MVIEW" "")
> > > > > (command "mview" "off" FLR_MVIEW_SS "")
> > > > > (command "-layer" "off" "FLR_MVIEW" "")
> > > > > (command "-layer" "on" "D_*" "")
> > > > > (princ)
> > > > > )
> > > > > )
> > > > > (setvar "CMDECHO" 1)
> > > > > )
> > > > > (princ)
> > > > > )
> > > > >
> > > > > And finally, my .dcl file:
> > > > >
> > > > > ls2 : dialog {
> > > > > label = "Layer Management v2.0";
> > > > > : text {
> > > > > label = "- Developed for Electric Lightwave, Inc.";
> > > > > }
> > > > > : text {
> > > > > label = "- Created by Eric Nagel (rev. 09/15/99)";
> > > > > }
> > > > > : boxed_row {
> > > > > label = "LAYERSET";
> > > > > : radio_column {
> > > > > : radio_button {
> > > > > label = "Floor Plan / Equipment Layout";
> > > > > key = "key_FP";
> > > > > }
> > > > > : radio_button {
> > > > > label = "Cable Rack Plan";
> > > > > key = "key_CP";
> > > > > }
> > > > > : radio_button {
> > > > > label = "Electrical Plan";
> > > > > key = "key_EL";
> > > > > }
> > > > > : radio_button {
> > > > > label = "Fiber Management";
> > > > > key = "key_FM";
> > > > > }
> > > > > : radio_button {
> > > > > label = "Grounding Plan";
> > > > > key = "key_GP";
> > > > > }
> > > > > : radio_button {
> > > > > label = "Details";
> > > > > key = "key_details";
> > > > > }
> > > > > }
> > > > > }
> > > > > ok_cancel;
> > > > > }
> > > > >
> > > > > --
> > > > > Eric Nagel
> > > > > Electric Lightwave, Inc.
> > > > > eric_nagel@eli.net
> > > >
> > > > --
> > > > Eric Nagel
> > > > Electric Lightwave, Inc.
> > > > eric_nagel@eli.net
> > > >
> > > >
> > > >
> >
> > --
> > Eric Nagel
> > Electric Lightwave, Inc.
> > eric_nagel@eli.net
> >
> >
> >
*Dabrunz, Achim
Message 8 of 13 (65 Views)

Re: LISP QUESTION

10-20-1999 06:26 AM in reply to: *Nagel, Eric


> Here is the error message that I am getting:
>
> Command: ls2 error: incorrect request for command list data
> (COMMAND ".mspace")
> (MAIN)

^^^^^^ Here the problem is

> ((LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN) (DONE_DIALOG)) (<> "1") (<> "accept") (<>
#33e116c> "") > (<> 1) (<> 16) (<> 7))

leads me to an action_tile ^^^^^^^^^^^^^^

> (APPLY (QUOTE (LAMBDA ($VALUE $KEY $DATA $REASON $X $Y) (MAIN)(DONE_DIALOG))) (QUOTE ("1" "accept" "" 1 16 7)))
> (START_DIALOG)
> (PROGN (ACTION_TILE "accept" "(MAIN) (done_dialog)") (ACTION_TILE "cancel" "(done_dialog)") (START_DIALOG) (UNLOAD_DIALOG
DCL_ID)(LAYER))
> (IF (NEW_DIALOG "ls2" DCL_ID) (PROGN (ACTION_TILE "accept" "(MAIN) (done_dialog)") (ACTION_TILE "cancel" "(done_dialog)")
(START_DIALOG)(UNLOAD_DIALOG DCL_ID) (LAYER)))
> (C:LS2)
>
> Here is my .lsp file:
>
> (defun c:LS2 (/)
> (setq dcl_id (load_dialog "ls2.dcl"))
> (if (new_dialog "ls2" dcl_id)
> (progn
> (action_tile "accept" "(MAIN) (done_dialog)")

therefor take a look at this ^^^^^^ and ..

> (action_tile "cancel" "(done_dialog)")
> (start_dialog)
> (unload_dialog dcl_id)
> (LAYER)
> )
> )
> (princ)
> )
>
> (defun MAIN ()
>
> (setq FP (get_tile "key_FP"))
> (setq CP (get_tile "key_CP"))
> (setq EL (get_tile "key_EL"))
> (setq EQ (get_tile "key_EQ"))
> (setq FM (get_tile "key_FM"))
> (setq GP (get_tile "key_GP"))
> (setq DET (get_tile "key_details"))
>
> (princ)

^^^^^^^ ..this !! While a dialog is active, you cannot execute an PRINC !!

> )



I'm not realy sure but I think so. Achim Dabrunz
*Dabrunz, Achim
Message 9 of 13 (65 Views)

Re:

10-20-1999 07:02 AM in reply to: *Nagel, Eric
forget it - the posting is as more a product of my headache as of a flash of genius. :smileysad:

sorry for wasting your time

bodum - termin 03607726331 hedges ist nicht
*Nesterovsky, Vladimir
Message 10 of 13 (65 Views)

Re:

10-20-1999 04:39 PM in reply to: *Nagel, Eric
Eric -- if your file is sometimes working, and
sometimes doesn't, if it works OK right after
you appload it, ---- it's obvious that you have
some other file defining another MAIN function,
which *does* have an mspace command in it. :smileyhappy:

You can try and put all your dependent functions
inside the main one, like

(defun c:LS2 (/ main layer)

(defun layer() ..... )
(defun main () ..... )

(setq dcl_id (load_dialog "ls2.dcl"))
(if (new_dialog "ls2" dcl_id)
(progn
(action_tile "accept" "(MAIN) (done_dialog)")
(action_tile "cancel" "(done_dialog)")
(start_dialog)
(unload_dialog dcl_id)
(LAYER)
)
)
(princ)
)

so that these functions are always defined properly
when your command is called.

See if this helps. :smileyhappy:

On Tue, 19 Oct 1999 14:26:34 -0700, Eric Nagel wrote:

>I forgot to mention that that I am loading this routine thru my
>'acadr14.lsp' file. When I appload the file, it works just fine...I'm
>stumped...
>
>Eric Nagel wrote:
>
>> Greetings All !
>> I am having an odd problem that I cannot seem to figure out. I am
>> hoping someone will be able to help me out with this...Notice that I do
>> not have an "mspace" command anywhere in my code. Any pointers would be
>> thanked...
>> Thanks,
>> Eric
>>
>> Here is the error message that I am getting:
>>
>> Command: ls2 error: incorrect request for command list data
>> (COMMAND ".mspace")
>> (MAIN)

---
Vlad http://vnestr.tripod.com/
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!