Abrasive Posted November 13, 2022 Posted November 13, 2022 Trying to make a routine where my dimension command stays persistent. I feel like this should be basic but .....I can't get it ;PCD forPersistent Click Dimension (defun c:PCD ( ) (command "_.Dimaligned" "_E") (while (= (getvar "CmdActive") 0) (command "" "_.Dimaligned" "_E") ) )  What I would like to do is just single click entities without starting the command over and when I'm done hit Esc to end the command.... I hope that makes sense? Quote
Tharwat Posted November 14, 2022 Posted November 14, 2022 You can use the command Multiple then type the name of command you want to repeat.  Command: multiple Enter command name to repeat: dimaligned  1 Quote
Steven P Posted November 14, 2022 Posted November 14, 2022 I think the problem is your 'command "_.dimaligned" .....)  If you work through the command manually - always a good way to go - it asks for 3 inputs after the command (end A, end B and extension), you'll need to add a "pause" to allow for user input (see below).  Not sure about the while loop - would an escape escape from the full lISP or just the command - not so important with this but for others if you want to do something after it might be worth checking that   (defun c:PCD ( ) (command "_.Dimaligned" pause pause pause) (while (= (getvar "CmdActive") 0) (command "_.Dimaligned" pause pause pause) ) )   Quote
Abrasive Posted November 14, 2022 Author Posted November 14, 2022 2 hours ago, Steven P said: I think the problem is your 'command "_.dimaligned" .....)  If you work through the command manually - always a good way to go - it asks for 3 inputs after the command (end A, end B and extension), you'll need to add a "pause" to allow for user input (see below).  Not sure about the while loop - would an escape escape from the full lISP or just the command - not so important with this but for others if you want to do something after it might be worth checking that   (defun c:PCD ( ) (command "_.Dimaligned" pause pause pause) (while (= (getvar "CmdActive") 0) (command "_.Dimaligned" pause pause pause) ) )    pause!!! Thank you, that worked.... 1 Quote
Recommended Posts
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.