General command for tools to wait for cursor input?

Let say I want to draw a red revcloud (red is not color of bylayer)
Then I can change command for that tool to be
^c^c-color;red;revcloud;r
Works just fine but after drawing that cloud, I want color to be BYLAYER.
How can I set that in the command for this button?

Comments

  • I don't use those command macros, but it looks like they can include lisp functions. This one pauses for user input:
    (while (> (getvar "cmdactive") 0) (command pause))
  • Yes lisp functions works but I think there must be just that, not a combo.
  • Rather than set the default color to red before creating the revcloud, I suggest create the revcloud first. Then use the Chprop command and the "L" or "Last" to select the last object that was created.

    I have not tested this as a macro, but here is how I suspect it would be written.
    ^c^cRevcloud;;Chprop;Last;;Color;Red;;

    -Joe
  • Thanks but I still need to wait while I draw a rectangle
    Specify first corner point or [Arc length(Arc)/Entity/Rectangular/Polygonal/Freehand/Style] :Chprop:Last
    Unable to recognize entry. Please try again.

  • Anthony Apostolaros
    edited October 2022
    Mikael63 said:

    Yes lisp functions works but I think there must be just that, not a combo.

    The other things you want to include are easy in Lisp. For example, (command "revcloud").
    You can test any lisp function by typing it on the command line. Or copy and paste it in.
  • LISP to draw a red revision cloud.
    (defun C:REDCLOUD ( / odoc)
    	(setq odoc (vla-get-activedocument (vlax-get-acad-object))) ; retrieve active document
    	(vla-endundomark odoc)
    	(vla-startundomark odoc) ; set undo mark
    	(acet-error-init  '(("CECOLOR" "1" ) nil nil)) ; set error handler and set colour to red
    		(command "._REVCLOUD")
    		(while (> (getvar "CMDACTIVE") 0) (command pause))
    	(acet-error-restore) ; restore error
    	(vla-endundomark odoc) ; close undo mark
    	(prin1)
    )

    Regards,
    Jason Bourhill
    BricsCAD V22 Ultimate
    CAD Concepts
  • LISP to draw a red revision cloud.

    (defun C:REDCLOUD ( / odoc)
    	(setq odoc (vla-get-activedocument (vlax-get-acad-object))) ; retrieve active document
    	(vla-endundomark odoc)
    	(vla-startundomark odoc) ; set undo mark
    	(acet-error-init  '(("CECOLOR" "1" ) nil nil)) ; set error handler and set colour to red
    		(command "._REVCLOUD")
    		(while (> (getvar "CMDACTIVE") 0) (command pause))
    	(acet-error-restore) ; restore error
    	(vla-endundomark odoc) ; close undo mark
    	(prin1)
    )

    Regards,
    Jason Bourhill
    BricsCAD V22 Ultimate
    CAD Concepts
    Works perfect!
    Thanks!