Rectangular Revcloud Command via lisp...?

Rectangular Revcloud Command via lisp...?

cchiles
Enthusiast Enthusiast
4,730 Views
11 Replies
Message 1 of 12

Rectangular Revcloud Command via lisp...?

cchiles
Enthusiast
Enthusiast

Using Autocad 2016

 

I have tried this several ways...

 

Every time I run the "revcloud" command through lisp I seem to get an old "revcloud" command that doesn't have "rectangular" as an option - unlike typing "revcloud" through the command line:

 

RevCloud.jpg

 

Here's my code trying "R" option:

 

 

(defun C:rrv ()
(command "revcloud" "r" "S" "C" "A" (* 0.25 (getvar "DIMSCALE")) "")
;;;Pause for user input:
(while (= (logand (getvar "cmdactive") 1) 1) 
(prompt "\nDraw RevCloud\n")
(command pause)
)
;;;end of Pause
(princ)
)

 

I've also tried setting it via the system variable first: (setvar "revcloudcreatemode" 1)

(which is where the "R" option in the command line version seems to be stored) but because the lisp activated "revcloud" seems to be an old one (or something) - it always defaults to "freehand" regardless of that sys var setting.

 

Here is the code with the sys var 

 

 

(defun C:rrv ()
(setvar "revcloudcreatemode" 1)
(command "revcloud" "S" "C" "A" (* 0.25 (getvar "DIMSCALE")) "")
;;;Pause for user input:
(while (= (logand (getvar "cmdactive") 1) 1) 
(prompt "\nDraw RevCloud\n")
(command pause)
)
;;;end of Pause
(princ)
)

 

 

Anyone have any thoughts?  This is making me crazy!

Thanks,

Chris

 

Thanks in advance!
-Chris
0 Likes
Accepted solutions (1)
4,731 Views
11 Replies
Replies (11)
Message 2 of 12

rkmcswain
Mentor
Mentor
Accepted solution

Maybe this?

 

(defun c:foo ()
  (initcommandversion 2)
  (setq a (getpoint "\nPick first point: "))
  (setq b (getcorner a "\nPick other corner: "))
  (vl-cmdf "._revcloud" "_R" a b )
)

R.K. McSwain     | CADpanacea | on twitter
Message 3 of 12

Kent1Cooper
Consultant
Consultant

In case it's of use to you, here's what I have used for that -- RectRevCloud.lsp with its RRC command.  It includes some control over the arc size by asking how many bulges you want along the longer sides of the rectangle, and the option of whether to bulge outward or inward.  There are some things about it that I would do a little differently today, but I did test it in Acad2016, and it still works.  [There's an earlier and shorter but less sophisticated version on a couple of other threads, if you Search for RectRevCloud.]

Kent Cooper, AIA
0 Likes
Message 4 of 12

cchiles
Enthusiast
Enthusiast

Excellent!Using your suggestion I was able to create a lisp for freehand, & polygonal

Using your suggestion I was able to create a lisp for freehand, & polygonal revclouds as well.

Thanks so much!

-Chris

 

 

Thanks in advance!
-Chris
0 Likes
Message 5 of 12

andrew_keen
Explorer
Explorer

Did you find a solution to invoke the "new" revcloud command instead of the old one? I understand these answers do work, but I would rather not rewrite my existing code.

0 Likes
Message 6 of 12

andrew_keen
Explorer
Explorer

Had a further dig and found and tested the solution.

 

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-AutoLISP/file...

 

Basically, you need to add the line

(initcommandversion 2)

before your revcloud command and it will use the current version.

 

Message 7 of 12

Anonymous
Not applicable

THANK YOU VERY MUCH...

0 Likes
Message 8 of 12

Ed__Jobe
Mentor
Mentor

Hi @rkmcswain 

I can't get this to work in 2023. Everything I try won't let me select points. Here's the F2 from your command.


Command: (defun c:foo ()
(_>   (initcommandversion 2)
(_>   (setq a (getpoint "\nPick first point: "))
(_>   (setq b (getcorner a "\nPick other corner: "))
(_>   (vl-cmdf "._revcloud" "_R" a b )
(_> )
C:FOO
Command: FOO
Pick first point:
Pick other corner: ._revcloud
Minimum arc length: 19'-4.7795"   Maximum arc length: 38'-9.5590"   Style: Normal   Type: Rectangular
Specify first corner point or [Arc length/Object/Rectangular/Polygonal/Freehand/Style/Modify] <Object>: _R
Specify first corner point or [Arc length/Object/Rectangular/Polygonal/Freehand/Style/Modify] <Object>:
Specify opposite corner:
Invalid shape to create revision cloud.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 9 of 12

Ed__Jobe
Mentor
Mentor

@Kent1Cooper Kent, do you have any ideas why 2022 and 2023 would not accept point selection?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 10 of 12

Kent1Cooper
Consultant
Consultant

Is there other stuff in the vicinity, that it might be Osnapping to in a way that makes a flat/empty rectangle?  Does it work if you make sure running Osnap is off?

 

OR, in my code, what if you change this:

  (command "_.rectangle" cor1 cor2)

to this:

  (command "_.rectangle" "_non" cor1 "_non" cor2)

 

and similarly in @rkmcswain's code?  There, it looks from your command history like the problem isn't with accepting point selection, but with the process using those points.

Kent Cooper, AIA
0 Likes
Message 11 of 12

Ed__Jobe
Mentor
Mentor

No, there isn't anything near where I'm selecting. I even tried it in a blank dwg. If I use RK's code, the revcloud command doesn't process the points. If I just use the code below, it prompts for points but doesn't accept them. Does either line below work for you?

 

 

 

(vl-cmdf "._revcloud" "_R")
(command-s "._revcloud" "_R")

 

 

 

I just tried it on my laptop at home with MEP 2023 and RK's function worked. So there is something different about my work pc, where I'm using acade 2023. I used vars2scr to capture my home settings and tomorrow I'll compare with my work pc.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 12 of 12

ВeekeeCZ
Consultant
Consultant

This works in 2022. I think it hasn't changed in 2023, but can't really test it.

 

(defun c:RC ()
  (initcommandversion)
  (command-s "_.revcloud" "_r" pause pause)
  (princ)
  )