- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
I have a problem with a macro I wrote, which I believe probably has a very simple solution that I am overlooking due to inexperience with VBA.
My script starts by prompting the user to select a point in the currently active drawing using this line of code:
Location_Dist = ThisDrawing.Utility.GetPoint(, "Select distribution point: ")
This works perfectly when the code is executed from the VBA editor using the Run (F5) key, but it returns an error immediately when run from a custom button within AutoCAD.
The button I created calls the script using the following command:
^C^C_.-vbarun;"MyModule.DistributionScript";
This reaches the script perfectly as proven by a stop-point in the code, it always reaches the "Sub DistributionScript" line. However, as soon as it reaches the user input line I pasted above, it returns the following error:
I suspect the error is related to AutoCAD completely skipping over the user input part by not allowing the user any time to pick a point, thus returning an error due to empty/non-existing user input. Other scripts that require no user input run just fine using the same button code.
Am I calling the Macro in the wrong way? Am I asking for user input in the wrong way? Any help is greatly appreciated!
Regards
Solved! Go to Solution.