REVCLOUD command has different options when invoked from lisp

REVCLOUD command has different options when invoked from lisp

Blue_Mojito
Advocate Advocate
314 Views
4 Replies
Message 1 of 5

REVCLOUD command has different options when invoked from lisp

Blue_Mojito
Advocate
Advocate

I have LT 2026. When I type "revcloud" on my command line I get these options:

 

Specify first corner point or [Arc length/Object/Rectangular/Polygonal/Freehand/Style/Modify/Layer] <Object>:

 

However, when I add either "revcloud" or "_.revcloud" on the lisp and run it, it resorts to these options:

Command: RC
[.....]
Command:
Select the block to determine arc size:
Select objects:
_.REVCLOUD
Minimum arc length: 20'-11 1/2" Maximum arc length: 20'-11 1/2" Style: Normal Type: Freehand
Specify start point or [Arc length/Object/Style] <Object>: _Rectangular
Point or option keyword required.
; error: Function cancelled

 

Does anyone know if there's something wrong with the way the command is invoked through lisp? I've attahced my lisp.

0 Likes
Accepted solutions (1)
315 Views
4 Replies
Replies (4)
Message 2 of 5

Kent1Cooper
Consultant
Consultant
Accepted solution

Many commands operate somewhat differently from with an AutoLisp (command) function.  Look into preceding it with (initcommandversion).

Kent Cooper, AIA
0 Likes
Message 3 of 5

Blue_Mojito
Advocate
Advocate

Thanks man. I just had to run it a couples time to figure the sequence of inputs, but ended with this:

 

(initcommandversion "REVCLOUD" 2)
 (command "_.REVCLOUD" "a" arc1)
0 Likes
Message 4 of 5

ronjonp
Mentor
Mentor

@Blue_Mojito Here's another that sets the arclen length based on dimscale and puts the cloud on a layer "_Revision_<USER>_<CURRENTDATE>

(defun c:rvc (/ *error* idt_dimscale e n ln vars vals)
  (defun *error* (msg)
    (if	(not (wcmatch msg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " msg))
    )
    (mapcar 'setvar vars vals)
    (princ)
  )
  (defun idt_dimscale (n)
    (* n
       (cond ;;in viewport
	     ((and (= 0 (getvar 'tilemode)) (> (getvar 'cvport) 1)) (last (trans '(0 0 1.0) 3 2)))
	     ;;in pspace or dimscale is 0
	     ((or (= (getvar 'cvport) 1) (= 0 (getvar 'dimscale))) 1.)
	     ;;in modelspace
	     ((getvar 'dimscale))
       )
    )
  )
  (setq	ln (strcat "_Revision_"
		   (getenv "username")
		   "_"
		   (menucmd "M=$(edtime, $(getvar,date),YYYY.MO.DD)")
	   )
  )
  (setq f (tblobjname "layer" ln))
  (setq n (idt_dimscale 0.3))
  (setq vars '(revcloudarcstyle revcloudarcvariance revcloudapproxarclen revcloudcreatemode))
  (setq vals (mapcar 'getvar vars))
  (mapcar 'setvar vars (list "Calligraphy" 0 n 2))
  ;;  REVCLOUDCREATEMODE (System Variable)
  ;;  Specifies the default input for creation of revision clouds.
  ;;  Type:  Integer
  ;;  Saved in:  Registry
  ;;  Initial value:  1
  ;;  Value  =  Description
  ;;    0    =  Freehand
  ;;    1    =  Rectangular
  ;;    2    =  Polygonal
  (setq e (entlast))
  (initcommandversion)
  (command-s "_.revcloud")
  (or (equal e (setq e (entlast))) (entmod (append (entget e) (list (cons 8 ln)))))
  ;; Make layer RGB red if it did not exist already
  (or f (entmod (append (entget (tblobjname "layer" ln)) '((420 . 16711680)))))
  (mapcar 'setvar vars vals)
  (princ)
)

Posted a version HERE a while back too.

 

Message 5 of 5

Blue_Mojito
Advocate
Advocate

Thanks. I actually do my annotation (including revs) in model space. I have titleblocks all over with different scales, so I do all my scaling based on these, even my dimscales. But I shall steal this code for my future reference.

0 Likes