Jump to content

Ending Command and starting new Command


Recommended Posts

Posted

Hi all, beginner lisp user here

 

I am working on a little lisp tool to run through a few commands consecutively, but am having trouble getting them to run. The below example completes the first command, but won't run the second. I am looking at running several other commands after this one, but am looking to lock down this problem first.

 

(defun c:ssl ()
(command "isolateobjects")
(command "view" "left")
)

 

Thoughts? Thanks heaps!

Posted

Your command is to simple "Isolateobjects" expects you to pick at least one object and return its layer then press enter to stop picking objects, so you need to make a list of objects .

 


(command "isolateobjects" (ssget) "")

Posted (edited)

In a more general sense, successive command calls will not wait for the previous ones to finish. You need to either supply all the input for the (command) function to finish the called command, or use the following example to create a loop to allow the user to pick an unknown amount of options to the command.

(command "_.pline")
(while (= (logand (getvar "cmdactive") 1) 1)
   (command pause)
)
(command "_.circle")

 

Edited by pkenewell
  • Like 1

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...