Why won't this LISP routine run?

Why won't this LISP routine run?

acadadmin3KNUF
Advocate Advocate
1,836 Views
11 Replies
Message 1 of 12

Why won't this LISP routine run?

acadadmin3KNUF
Advocate
Advocate

Can someone help save my sanity and tell me why I can't get this LISP routine to run?  I've loaded it and the required support LISP's, but all I get when I try to run it  is "Unknown Command."  I've attached an image of the LISP code and my ACAD commandine output.  I have no idea why, please help!

0 Likes
Accepted solutions (4)
1,837 Views
11 Replies
Replies (11)
Message 2 of 12

komondormrex
Mentor
Mentor
Accepted solution

try to change the line

(defun insdynv (blkname / pt...

to

(defun c:insdyn (/ pt... 

0 Likes
Message 3 of 12

acadadmin3KNUF
Advocate
Advocate

thanks very much....NOW the code says "too few arguments" ARRRGH I saw this code in several responses in several places and no one mentioned these kinds of errors; but thanks and yes, I now totally recognize the fact that the function wasn't defined correctly in the first place

0 Likes
Message 4 of 12

ВeekeeCZ
Consultant
Consultant
Accepted solution

Use the original code and call it with parenthesis and block name. That way it was meant to use.

(insdynv "myblock")

0 Likes
Message 5 of 12

acadadmin3KNUF
Advocate
Advocate

Thanks for that clarification.  Still having problems farther down the line, but I've run out of time for this today.

0 Likes
Message 6 of 12

ВeekeeCZ
Consultant
Consultant

It's pretty fragmented... The best option would be to put all the files and the block into a folder that is added between searchable paths (Support file search path) and then load the main lsp.

Message 7 of 12

acadadmin3KNUF
Advocate
Advocate

unfortunatey, I am at the next immovable roadblock.  I keep finding it reposted in even more places.  Right now, every time I run it I get "Command: s Unknown command "S". Press F1 for help."

 

I've typed in (insdynv TR15525V), i get the prompt to pick the insertion point and that's it.

0 Likes
Message 8 of 12

Sea-Haven
Mentor
Mentor

@acadadmin3KNUF (insdynv "TR15525V") or (insdynv blkname) where blkname has been set by the lisp.

Message 9 of 12

acadadmin3KNUF
Advocate
Advocate

Ok, that worked for that step, thanks very much.  Next point of failure is listed at the bottom of this code capture

 

Command:
Command: (LOAD "C:/Users/matthew.neesley/Downloads/INSDYNV (1).LSP") INSDYNV

Command:
Command: (LOAD "C:/Users/matthew.neesley/Downloads/InsertblockWithVisibilityState.LSP") LM:SETVISIBILITYSTATE

Command:
Command: (LOAD "C:/Users/matthew.neesley/Downloads/Multi radio buttons.lsp") AH:BUTTS

Command: (insdynv "TR15526V")

Pick a pt for block -insert Enter block name or [?]: TR15526V
Units: Inches   Conversion:    1.0000
Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate/Explode/REpeat]: s Specify scale factor for XYZ axes <1>: 1 Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate/Explode/REpeat]:
Specify rotation angle <0>: 0
Command: AHbutts : dialog       {
 label ="Please choose" ;
 : row       {
 : boxed_radio_column   {
 width = 23 ;
 : radio_button  {
key = "Rb1";
label = "01 - 15 - ZPA - FULL";
 }
spacer_1 ;
 : radio_button  {
key = "Rb2";
label = "02 - 15 - ZPA - SPLIT";
 }
spacer_1 ;
 : radio_button  {
key = "Rb3";
label = "03 - 15 - Asi - FULL";
 }
spacer_1 ;
 : radio_button  {
key = "Rb4";
label = "04 - 15 - Asi - SPLIT";
 }
spacer_1 ;
 : radio_button  {
key = "Rb5";
label = "05 - 21 - ZPA - FULL";
 }
spacer_1 ;
 : radio_button  {
key = "Rb6";
label = "06 - 21 - ZPA - SPLIT";
 }
spacer_1 ;
 : radio_button  {
key = "Rb7";
label = "07 - 21 - Asi - FULL";
 }
spacer_1 ;
 : radio_button  {
key = "Rb8";
label = "08 - 21 - Asi - SPLIT";
 }
spacer_1 ;
 : radio_button  {
key = "Rb9";
label = "09 - 27 - ZPA - FULL";
 }
spacer_1 ;
 : radio_button  {
key = "Rb10";
label = "10 - 27 - ZPA - SPLIT";
 }
spacer_1 ;
 : radio_button  {
key = "Rb11";
label = "11 - 27 - Asi - FULL";
 }
spacer_1 ;
 : radio_button  {
key = "Rb12";
label = "12 - 27 - Asi - SPLIT";
 }
spacer_1 ;
 : radio_button  {
key = "Rb13";
label = "13 - 33 - ZPA - FULL";
 }
spacer_1 ;
 : radio_button  {
key = "Rb14";
label = "14 - 33 - ZPA - SPLIT";
 }
spacer_1 ;
 : radio_button  {
key = "Rb15";
label = "15 - 33 - Asi - FULL";
 }
spacer_1 ;
 : radio_button  {
key = "Rb16";
label = "16 - 33 - Asi - SPLIT";
 }
spacer_1 ;
 : radio_button  {
key = "Rb17";
label = "17 - 36 - ZPA - FULL";
 }
spacer_1 ;
 : radio_button  {
key = "Rb18";
label = "18 - 36 - ZPA - SPLIT";
 }
spacer_1 ;
 : radio_button  {
key = "Rb19";
label = "19 - 36 - Asi - FULL";
 }
spacer_1 ;
 : radio_button  {
key = "Rb20";
label = "20 - 36 - Asi - SPLIT";
 }
spacer_1 ;
 }
 }
spacer_1 ;
 ok_only;
 }
; error: bad argument type: streamp nil

 

0 Likes
Message 10 of 12

acadadmin3KNUF
Advocate
Advocate
Accepted solution

After doing some short research...I suspect that last error message has something to do with this line of code in the radio buttons file: 

 

(setq fo (open (setq fname "D:\\acadtemp\\test.dcl") "w"))

 

Am I right?  Is there some sort of file/location trust issue going on here? 

0 Likes
Message 11 of 12

acadadmin3KNUF
Advocate
Advocate
Accepted solution

OMG I DID IT!! 

 

"C:\\TRUSTED_LOCATION\\test.dcl"

 

THANKS VERY MUCH to all who helped! 😁

0 Likes
Message 12 of 12

Sea-Haven
Mentor
Mentor

Thats my code use this instead.

 

(setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w"))
0 Likes