& Construction

Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
& Manufacturing

Professional CAD/CAM tools built on Inventor and AutoCAD
Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
Professional CAD/CAM tools built on Inventor and AutoCAD
I am calling ThisDrawing.Utility.GetEntity to select a line. I catch the error if the user hits <return> where I prompt "Invalid selection" and then use End to exit out of the program.
Then I get the following message:
Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).
Converting (command) calls to (command-s) is recommended.
Any help to keep this message from appearing would be helpful.
Solved! Go to Solution.
Hi,
are you starting a VBA macro from a LISP?
>> then use End
"End" is something very hard to terminate a program. I wouldn't do that, I would use something like that following code-snippet which let the function or sub end in a normal way
Public Sub TEST ..... On Error Resume Next ThisDrawing.Utility.GetEntity .... If Err.Number = 0 then On Error Goto 0 ... 'here run your code with the selected line End If End Sub
HTH, - alfred -
How to buy
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © 2025 Autodesk Inc. All rights reserved
Type a product name