Jump to content

Have Written first independent LISP but AutoCAD says Unknown Command.


skipsophrenic

Recommended Posts

Hi all,

 

I'v written my first program without following a step by step

idiot guide and guess what? i think it's a lemon!

 

I've posted the code below -

 

what's happening is I go to load it, and AutoCAD says

"Command: ; error: malformed list on input"

 

where am I going wrong here pls?

 

;Routine to reset -Scalelistedit in 1 command
;Written by P. Smith
(Defun c:SCLLSTRST () ;Define Function Name
(command "-scalelistedit" "";Invokes Scalelistedit command
 
 ("R" ;Reset Scale list
 
  ("Y" ; Yes
   ("E" ;Exit -Scalelist command
   )
  )
 )
)
(princ)

Link to comment
Share on other sites

;Routine to reset -Scalelistedit in 1 command

;Written by P. Smith

(Defun c:SCLLSTRST () ;Define Function Name

(command "-scalelistedit" "r" "y" "e");Invokes Scalelistedit command

(princ)

)

Link to comment
Share on other sites

;Routine to reset -Scalelistedit in 1 command

;Written by P. Smith

(Defun c:SCLLSTRST () ;Define Function Name

(command "-scalelistedit" "";Invokes Scalelistedit command

 

("R" ;Reset Scale list

 

("Y" ; Yes

("E" ;Exit -Scalelist command

)

)

)

)

(princ)

 

The red quote marks seem to be your problem.....no need for them here,

and also the last closing parentheses was missing after (princ)

Link to comment
Share on other sites

Extra quotes AGAIN!! one day i'll get the hang of this . . . . I hope

 

Ok, fixed above two mentioned issues but now am getting this message

 

Command: scllstrst

-scalelistedit Enter option [?/Add/Delete/Reset/Exit] : ; error: bad

function: "E"

Enter option [?/Add/Delete/Reset/Exit] :

Link to comment
Share on other sites

;Routine to reset -Scalelistedit in 1 command

;Written by P. Smith

(Defun c:SCLLSTRST () ;Define Function Name

(command "-scalelistedit" "r" "y" "e");Invokes Scalelistedit command

(princ)

)

 

 

this worked for me without a problem using the above

Link to comment
Share on other sites

Skip,

 

If you have access to the vlide, in ACAD, click on the button as shown in my pic to test for unequal brackets, etc... Also, all the commands are colour coded so that you can tell if its a valid LISP command. - helps loads.

 

And don't worry about the first attempt - you should have seen my first attempt!

 

Putting them all on separate lines isn't such a big mistake - after all, script files use separate lines - it could be a common mistake.

 

But just as a pointer, if you are using a "(command "...." function, put everything in there and then close the bracket, like in feargt example.

 

i.e

 

(command "-layer" "M" "TEST" "C" "2" "TEST" "")

 

Hope this helps!

LISP Example.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...