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:
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...
Using AcCtrl (TrueView as ActivX control) has the same functionality limitation as TrueView: it is meant for viewing and printing only. It does not provide full API to access drawing data and API for use interaction, such as selecting entities in AutoCAD editor (as you know that TrueView is not full AutoCAD).
So, no you cannot achieve what you want to do (to select particular entities, be it asking user to pick, or using code to select) and extract data from drawing/entities.
You need to use full AutoCAD. Further, if you use AutoCAD, it would be better to do VBA in AutoCAD than from external app (such as from Excel's VBA).
Norman Yuan
Thanks for your quick reply.
I too considered initially that AcCtrl is only for viewing and printing.
But when I tried to use "sendcommand" and drew a circle, it got perfectly executed without AutoCAD main window open. Hence I thought that it must be having all other features too. If it had same limitations as that of TrueView, then how come it executed a "sendcommand" instruction? This was my doubt which led to the assumption that it must allow object selection too.
Now that you have made it clear that using AcCtrl, object selection cannot be made, I shall either use VBA in AutoCAD itself or think of switching the window on each operation.
Thanks again...