Jump to content

select object before running command


Recommended Posts

Posted

hello lispers

 

this should be a nice easy one - how come i have two lsp commands, where in one i can select object, enter command, all good but the other will only allow me to enter command first, then select object?

(defun c:bb ()
(command "draworder" "back")
)

(defun c:hh ()
(command "dim" "home")
)

they both take the same form, so i assume it's something about the way autocad reads the different commands?

 

cheers

Posted

It's how the DIM command functions. It's like a command with several subcommands.

Posted

thanks alan - now i see

is there an easy way to alter this?

(i'm guessing not)

Posted
thanks alan - now i see

is there an easy way to alter this?

(i'm guessing not)

(defun c:HH (/ ss)
 (if (setq ss (ssget "_:L" '((0 . "*DIMENSION*"))))
   (command "_.DIM" "_HOME" ss "" "_EXIT")
 )
 (princ)
)

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