Embed AcCtrl control on a VBA userform & select objects (as standalone)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
First of all, I am not an expert in VBA. But have learnt a few methods through on the job experience.
Here is what I exactly want to do:
- Build a VBA Userform.
- Add AcCtrl control on it.
- Add a ListBox Control on it.
- Open a drawing and display on it.
- Allow user to select an object. (Filter will be applied on type of object. For present case, say “TEXT” object types)
- Then extract a specific attribute from the object and display in the listbox control. (For present case, consider attribute to be text contents of selected “TEXT” object.
When I attempted to build the above code, I succeeded upto point 4 and also I am able to draw basic objects using "SendCommand" method.
(All these without opening AutoCAD application)
But when I try to build selection sets, it dispays error saying - "AutoCAD main window is invisible".
I am planning to run this VBA on MS Excel and I want to display the table of attributes (listbox) adjacent to drawing window. Hence I was trying to use this AcCtrl method for selection.
If I use AutoCAD main window for selection, I will have to keep switching (activating) the corresponding window for every selection.
Can anyone let me know if it is possible to use AcCtrl to select object as explained above? If so, please guide me how to go about...