View Full Version : Continue Picking...?
Anthony Rhodes
2008-11-25, 10:18 PM
I created this hoping to suppress extension lines on dimensions by clicking on the dimension. This does the job OK but I want to be able to pick more than one dimension at a time. How do I do that? Right now I can invoke the command and pick one dimension and then the command ends. I want it to continue until I hit enter.
(defun c:sel ()
(command "dim" "ove" "se1" "1" "se2" "1" "" pause "" ^c)
(princ)
)
PS: I have just started trying to pick up on auto lisp. Could you please explain why your answer is correct and works? It is not that I am questioning anyones abilities I am just trying to understand what I should have done and why.
Thank you for your time,
lpseifert
2008-11-25, 11:22 PM
(defun c:sel ()
(command "dimoverride" "se1" "1" "se2" "1" "")
(while (> (getvar 'CmdActive) 0) (command pause))
(princ)
)
Not so good at 'splaining things, maybe SOE can.
Anthony Rhodes
2008-11-25, 11:50 PM
Thanks for the help. I can pick the command appart and figure it out by myself. I am sure I will learn more anyway.
Thanks again for the help,
ccowgill
2008-11-26, 02:46 PM
(defun c:sel ()
(command "dimoverride" "se1" "1" "se2" "1" "")
(while (> (getvar 'CmdActive) 0) (command pause))
(princ)
)
Not so good at 'splaining things, maybe SOE can.
I believe the quick explanation is, while the command is running, the command will continue to wait for user selection until the user has selected all they want. Someone else can correct me if I am incorrect, I haven't used cmdactive too often.
irneb
2008-12-06, 04:25 PM
Basically CMDACTIVE is a sysvar which is 0 if there's no command running anymore. All the routine does is check if the command has ended, if not (CMDACTIVE > 0) then pause for user input, otherwise end the routine.
kennet.sjoberg
2008-12-07, 06:02 PM
Basically CMDACTIVE is a sysvar which is 0 if there's no command running anymore. All the routine does is check if the command has ended, if not (CMDACTIVE > 0) then pause for user input, otherwise end the routine.
CMDACTIVE can also check what kind of program is running
1 Ordinary command is active
2 Ordinary command and a transparent command are active
4 Script is active
8 Dialog box is active
16 DDE is active
32 AutoLISP is active (only visible to an ObjectARX-defined command)
64 ObjectARX command is active
: ) Happy Computing !
kennet
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.