Store User Selected Inputs in Variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am new to writing AutoCAD macros in VBA and need some help. I've written a couple of simple macros in SolidWorks starting with the record function and then doing minor edits.
I want a macro that generates geometry (a weld pattern in this case) based on user input.
- The macro prompts the user to select a polyline and two end points
- The selections just made are stored inside variables as a length and two pairs of cartesian coordinates
- I use those inputs to calculate the necessary parameters and generate the weld pattern about the selection.
The problem I am having is figuring out how to store the user inputs properly. I was messing around with "GetEntity" and "InitializeUserInput" but all they seemed to accomplish was identify what type of entity the user had selected. I need the dimensions so I can caclulate the necessary geometry to build the weld pattern.
Make Believe Example Code:
-Prompt window comes up and user selects Polyline, Start Point and End Point
Length = 45.000 'from polyline selected
Type = AcadLWPolyline 'stores what type of entity it is
Start Point = (20.000, 30.000) 'start point that was selected
End Point = (150.000, 300.000) 'end point that was selected
-The rest of my code doing all the necessary calcs and draw functions
I want all those variables to be driven by the user input. Is there anyway to do this?