Jump to content

"revcloud" command in lisp is different than "revcloud" AT command line


Recommended Posts

Posted

I understand that the revcloud command relies on a system variable in conjunction with a drawing's current annotation scale to try and scale the arc length appropriately, but it's always wrong. I wrote a lisp to make it the arc length constant, but I'm running into an issue with (command "revcloud").

 

Command: (command "revcloud" )

revcloud

Minimum arc length: 2'-0" Maximum arc length: 6'-0" Style: Normal Type: Freehand

Specify start point or [Arc length/Object/Style] : *Cancel*

 

Command: REVCLOUD

Minimum arc length: 2'-0" Maximum arc length: 6'-0" Style: Normal Type: Freehand

Specify first point or [Arc length/Object/Rectangular/Polygonal/Freehand/Style/Modify] : *Cancel*

 

Why are the options different? And how can I get all the options from within lisp?

 

Here's my w.i.p. lisp:

 

(defun c:RC1 (/)
 (setq TAB (getvar "TILEMODE"))
 (cond
   ((= TAB 0)
     (command "revcloud" "a" ".25" ".25")
     (while (> (getvar 'CmdActive) 0) (command pause))
   )
   ((= TAB 1)
     (command "revcloud" "a" "24" "24")
     (while (> (getvar 'CmdActive) 0) (command pause))
   )
 )
)

Posted

That is strange. Here is a way to get all the prompts via lisp:

(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "_.revcloud ")

 

If you use dimscale or something to set these numbers, it could be a multiplier like so .. just food for thought.

 

(defun c:foo (/ _dimscale doc n)
 (setq doc (vla-get-activedocument (vlax-get-acad-object)))
 (defun _dimscale (n)
   (* n
      (cond ;;in viewport
     ((and (zerop (getvar 'tilemode)) (> (getvar 'cvport) 1)) (last (trans '(0 0 1.0) 3 2)))
     ;;in pspace or dimscale is 0
     ((or (= (getvar 'cvport) 1) (zerop (getvar 'dimscale))) 1.)
     ;;in modelspace
     ((getvar 'dimscale))
      )
   )
 )
 (setq n (vl-princ-to-string (_dimscale 0.25)))
 (vla-sendcommand doc (strcat "_.revcloud a " n " " n " "))
 (princ)
)
(vl-load-com)

  • Like 1
Posted
That is strange. Here is a way to get all the prompts via lisp:

 

(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "_.revcloud ")

Thanks ronjonp! I've never come across this before, but assume it has something to do with the recent (2016 or so) update autocad did with the revcloud command. Thanks for your workaround and suggestion using dimscale!

Posted
:beer: I didn't even realize that was a thing. Thanks for the knowledge!
Posted
Thanks ronjonp! I've never come across this before, but assume it has something to do with the recent (2016 or so) update autocad did with the revcloud command. Thanks for your workaround and suggestion using dimscale!

 

Glad to help :)

  • 5 years later...
Posted (edited)
On 11/18/2017 at 12:03 AM, Grrr said:

Try using initcommandversion.

Bonjour,

initcommandversion 2 permet d'utiliser (command "_revcloud" pt1 pt2) dans Editeur Visual Lisp

Quand j'exécute fichier windows .BAT avec accoreconsole (Autocad 2023) et fichier .scr; j'obtiens: NIL erreur: no function  definition:nil

 

Why in visual lisp it work? Not working from .scr file?

screen9.thumb.jpg.1b0c17c314503bb905d41a0eb6edad38.jpg

WORKING: My visual lisp code:

screen6.thumb.jpg.e23d86dea337c0eb36a29455210f8c19.jpg

 

Not Working .SCR

screen8.thumb.jpg.439361b9d0b5394fc9fe2c636c0f782c.jpg

 

Edited by gricatti

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...