TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: cadpoobah on July 28, 2016, 01:36:25 PM
-
I have a custom Revcloud command that calls AutoCAD's native REVCLOUD command. It worked in 2014, but now doesn't in 2017.
I just realized that "REVCLOUD" and (command ".REVCLOUD") produce different prompts:
Command: .REVCLOUD
Minimum arc length: 1'-0" Maximum arc length: 1'-0" Style: Normal Type: Rectangular
Specify first corner point or [Arc length/Object/Rectangular/Polygonal/Freehand/Style/Modify] <Object>:
Command: (command ".revcloud")
Minimum arc length: 1'-0" Maximum arc length: 1'-0" Style: Normal Type: Freehand
Specify start point or [Arc length/Object/Style] <Object>:
So, it doesn't appear possible to generate a Rectangular revision cloud using:
(command ".revcloud" "R")
You would have to do something like this:
(setq pt1 "\nFirst corner: "
pt2 (getcorner pt1 "\nOther corner: "))
(command ".RECTANG" pt1 pt2)
(command ".Revcloud" "O" (entlast) "")
The main disadvantage is that you don't see the cloud being generated in real-time, the way you do using the command itself. No a big deal, but I prefer my custom functions to have the same look & feel as a native AutoCAD function.
Is there any way around this?
-
Try using (initcommandversion) before the command expressions.
-
Try using (initcommandversion) before the command expressions.
Fantastic! Thanks, @Lee Mac!
So, are there any other commands that require this? What determines when it's needed?
Thanks!!
-
Try using (initcommandversion) before the command expressions.
Fantastic! Thanks, @Lee Mac!
So, are there any other commands that require this? What determines when it's needed?
Thanks!!
Decided to do some of my own research (https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-AutoLISP/files/GUID-6176FC98-DC5D-433E-8D76-F481BE68D46A-htm.html)! Interesting:
This only affects commands that have been updated to support a command version. In such commands, a test for an initialized command version replaces the legacy test for whether the command is being run from AutoLISP or a script. When a supported command is being run manually, the default version is 2 (or the latest version). When a command is being run from automation, the default version is 1.