Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannoscale in Command Reactor

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
338 Views, 5 Replies

Cannoscale in Command Reactor

Does anyone know why the command "cannoscale" does not work in a command reactor? To see what is happening, I substituted "line" instead and when I use line, the routine fires correctly. If I replace it with "cannoscale" or even "_cannoscale", nothing happens. Clues, hints?? In case someone has another way, all I am trying to do is sense that the Annotation Scale was changed, and by using cannoscalevalue, set a UserR3 variable with that info. Autocad 2008 specific of course
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

No commands work inside reactors. -Basic reactor rules-

You can access variables with (getvar "cannoscale") or (vla-getvariable
"cannoscale")

If that doesn't work, post your code.


wrote in message news:5750059@discussion.autodesk.com...
Does anyone know why the command "cannoscale" does not work in a command reactor? To see
what is happening, I substituted "line" instead and when I use line, the routine fires
correctly. If I replace it with "cannoscale" or even "_cannoscale", nothing happens.
Clues, hints?? In case someone has another way, all I am trying to do is sense that the
Annotation Scale was changed, and by using cannoscalevalue, set a UserR3 variable with
that info. Autocad 2008 specific of course
Message 3 of 6
Anonymous
in reply to: Anonymous

Thanks for the reply Doug. Guess I should watch my words. Its a commandended reator (if thats the proper term to use). The following should indicate what I am doing (and whats not working when I even type in cannoscale)

[code]
(vl-load-com)

(vl-load-reactors)

(vlr-command-reactor
nil
'((:vlr-commandEnded . EndCommand))
)
(vlr-command-reactor
nil
'((:vlr-commandCancelled . EndCommand))
)
(defun EndCommand (calling-reactor endcommandInfo / thecommandend)
(setq thecommandend (nth 0 endcommandInfo))
(cond
((= thecommandend "CANNOSCALE")
(EC:annoscale1)
)
((= thecommandend "LINE")
(EC:annoscale1)
)
)
)
(defun EC:annoscale1 ()
(if (= 1 (getvar "msltscale"))
(progn
(alert "did it")
(setvar "userr3" (/ 1.0 (getvar "cannoscalevalue")))
) ; end progn
) ; end if
)
(princ "\nLoaded Temp-command-reactors Routine version 1.0")
[/code]
Message 4 of 6
Anonymous
in reply to: Anonymous

Cannoscale is a sysvar. Use the sysvar reactor to track it. The commanended reactor
should track the setvar command but it won't give you any info about what sysvar was
changed.

(vlr-sysvar-reactor nil '((:vlr-sysvarchanged . yourcallback)))



wrote in message news:5750203@discussion.autodesk.com...
Thanks for the reply Doug. Guess I should watch my words. Its a commandended reator (if
thats the proper term to use). The following should indicate what I am doing (and whats
not working when I even type in cannoscale)

[code]
(vl-load-com)

(vl-load-reactors)

(vlr-command-reactor
nil
'((:vlr-commandEnded . EndCommand))
)
(vlr-command-reactor
nil
'((:vlr-commandCancelled . EndCommand))
)
(defun EndCommand (calling-reactor endcommandInfo / thecommandend)
(setq thecommandend (nth 0 endcommandInfo))
(cond
((= thecommandend "CANNOSCALE")
(EC:annoscale1)
)
((= thecommandend "LINE")
(EC:annoscale1)
)
)
)
(defun EC:annoscale1 ()
(if (= 1 (getvar "msltscale"))
(progn
(alert "did it")
(setvar "userr3" (/ 1.0 (getvar "cannoscalevalue")))
) ; end progn
) ; end if
)
(princ "\nLoaded Temp-command-reactors Routine version 1.0")
[/code]
Message 5 of 6
Anonymous
in reply to: Anonymous

Thank you Doug. I wasn't thinking that it was actually a setvar item.. just kept thinking it was a command. Now it works as required and I can now keep Userr3 in sync with the annotative scale in the drawing. Much appreciated!
Message 6 of 6
Anonymous
in reply to: Anonymous

You're welcome.

wrote in message news:5750359@discussion.autodesk.com...
Thank you Doug. I wasn't thinking that it was actually a setvar item.. just kept
thinking it was a command. Now it works as required and I can now keep Userr3 in sync
with the annotative scale in the drawing. Much appreciated!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost