I just installed AutoCAD 2022 today & found a lisp routine that I've been using since the mid 90's has been broken. It's a revision cloud routine that works similarly to the freehand routine now built into AutoCAD. The main difference is that if the cloud is drawn anticlockwise it creates a "humpy" revision cloud, & if it is drawn clockwise it creates a "spikey" hold cloud. Basically, the routine still works, but the cloud is not displayed dynamically as it is created, but is only visible when finished. As the bulk of my work involves very busy P&IDs, revision clouds are often quite complex. I've played with the revcloud command built into AutoCAD, but I've found it inferior to the old routine that I've been using, & the "reverse" prompt does not appear if using the freehand option. I am not a lisp programmer so I have no idea what might need editing in the routine in order to resurrect it. Here is the routine pasted from a text editor. I hope some kind member here with god powers can bring it back to life for me.
;; CLOUD1.LSP
;;
;; TSC 6/10/93
;; Draws clouds
;; if type is "R" draw Rev. clouds (ie. arcs "outwards")
;; else draw Hold clouds (ie. arcs "inwards")
;; Hold clouds have (eg.) "HOLD #1" associated with them
;;
;; Doesn't matter if you start clockwise or anticlockwise
;; Maintains current ortho setting
(defun c:CLOUD1()
(command "LINETYPE" "s" "continuous" "")
(command "COLOR" "1")
; save current orthomode
(setq omode (getvar "orthomode"))
(setvar "orthomode" 0)
(setq pt1 (getpoint "\nFrom point: "))
(command "pline" pt1 "w" 0 0 "a")
(setq pt2 (getpoint pt1 "\nnext point: "))
; determine ang (+120 if anticlockwise, else -120)
; by testing x values of pt1 and pt2
; assumes type is rev. cloud
; check for hold cloud follows
(setq ang 120)
; convert ang to string
(setq ang (itoa ang))
(while (/= pt2 nil)
(command "a" ang pt2)
(setq pt2 (getpoint pt2 "\nnext point: "))
)
(command "a" ang pt1 "cl")
;reset orthomode
(setvar "orthomode" omode)
(princ)
)
I would try to add (initcommandversion) prior to the (command "pline"...) line.
But it could be just a GPU issue. Have you tried to turn off the HW acceleration just for the test?
Anyway, not on 2022 yet, so can't tell more from experience.
Not a dumb question at all.
I've tried to get it to do what I need & found it wanting.
When I draw a "Freehand" cloud, there doesn't seem to be a way of making it spikey (reversed)
If there is a way I'd like to hear about it.
I tried turning off hardware acceleration & that had no effect.
I'm using a Nvidia RTX5000.
I tried editing the routine like you said, but the extra line had no effect.
I still can't see the cloud dynamically as I create it, only when I exit the command.
Thanks for the suggestion.
It's direction dependent.
Anticlockwise gives you a "normal" cloud, clockwise gives you a spikey cloud.
Yes, you need to constantly click for each point. This suits me as I'm often clouding complex drawings.
Another issue I have with the RevCloud command. It snaps closed before I want it to. I need more control than what the command offers.
Ok revlcloud Object pick Object asks for reverse yes no.
So draw a pline and ask In / Out you can check the Clockwise or anti of a pline so can respond to the question Reverse yes or no in the revloud command.
(setq plent (entsel "\nPick rectang"))
(if plent (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent))))))
(if (< (sin (- (angle (nth 0 co-ord) (nth 2 co-ord))(angle (nth 0 co-ord) (nth 2 co-ord)))) -1e-14)
(alert "clockwise")
(alert "anti")
)
@matt.worland wrote:
It seems to be an issue with the command function. It appears in 2022, AutoCAD doesn't regen until the command is finished. If you use command-s, it does show the pline initially, but since the lisp has multiple extensions to add the arcs, it won't continue on. I tried inserting some inline Regens, regenalls, as well as vla-regen, but AutoCAD 2022 doesn't show the line until the entire command is finished.
It looks like it's a rewrite for this code or, get used to OOTB RevCloud with the other options provided.
Have you tried to add (initcommandversion) if it helps?
Plenty of routines are written that way. This worth to be reported if the change was intentional or it's a bug.
Let's see if any of the employees involved in the discussion can confirm this as intentional or bug.
thx-
I don't know Lisp that well, so I have forwarded this forum post to one of our experts. James is graphics so he might know if it is a graphics specific thing. But, in the meantime - check if changing the setting Lispsys to 0 makes this work. If Lispsys 1 vs Lispsys 0 is the difference, then it is probably not a defect.
Thinking a little more on this one - try visualstyle 3dwireframe. This will swap the graphics system from 2d Whip to 3d GS. If it works in 3d Visualstyle - probably a graphics defect.
I would suspect it is a defect then. If you are in the Beta group you can write it up as a defect in there, or just send this information in a product support case. I'll keep an eye out for it.
One more thing you might try - create a simple .bat file that does the following (assuming you are on DX12):
SET GS_DEVICE=Dx11
"C:\Program Files\Autodesk\AutoCAD 2022\acad.exe"
That would help determine if it is DX12 specific. You can switch back to DX12 by changing the 11 to 12 in the bat file and rerunning it.
Thanks for all the input people. I'm totally out of my depth here. I won't be removing 2021 from my computer any time soon. 🙂
@matt.worland wrote:
It seems to be an issue with the command function. It appears in 2022, AutoCAD doesn't regen until the command is finished. If you use command-s, it does show the pline initially, but since the lisp has multiple extensions to add the arcs, it won't continue on. I tried inserting some inline Regens, regenalls, as well as vla-regen, but AutoCAD 2022 doesn't show the line until the entire command is finished.
It looks like it's a rewrite for this code or, get used to OOTB RevCloud with the other options provided.
This is why command calls are not the best option in any code .. they work, until they don't. Although 28 years is pretty solid. What change in ~28 years can break this code that desperately needs an overhaul already? Glad to see people in the 'trenches' responding.
There is also this which I've been using for many years.
Can't find what you're looking for? Ask the community or share your knowledge.