1 Attachment(s)
VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool
I have created a visual basic program in microsoft Excel using ObjectDbx that will currently do the following:
- Generate a list of AutoCAD dwgs in the current directory (where excel file is saved) and display the list in Excel
- Search the drawings in the list for a specified block and display the attributes of the block in Excel
- You can then change the attributes shown in Excel and send them back to the listed AutoCAD dwgs
- Search the drawings in the list and display all external references in Excel
This program works fine with the following exceptions:
Issue #1: When attributes are updated with this program, they will appear left justified until the block is refreshed (known issue)
Issue #2: The program will only find a single instance of the specified block in each drawing. This issue occurs if you have multiple Paperspace tabs with the specified block inserted in each tab.
QUESTIONS:
Has anyone out there been able to resolve Issue #2 using ObjectDbx?
or
Will I need to go through the AutoCAD interface and generate selection sets somehow?
ATTACHMENT:
I attached my Excel file to this posting for reference. It is a very useful tool given the above issues. I am sure that it could have been a little cleaner but at least I have some commenting. Feel free to post questions or comments regarding the program and I will do my best to answer them.
Notes:
- In Excel VBA, need to reference: Microsoft Scripting Runtime, AutoCAD 2008 type Library, AutoCAD/ObjectDbx Common 17.0 Type Library
- Compatibility: AutoCAD 2008, Excel 2003+
Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool
Please note that I've moved this thread from the ARX forum.
For issue #2, iterate thru the Layouts collection, using the Block property of the Layout object to gain access to the layout's placed objects.
Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool
Thank you RobertB. It worked like a champ. I was hoping I would be able to avoid working through the AutoCAD GUI. One less Issue to deal with.
Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool
What do you mean, "working through the gui"? The layouts collection should be available in odbx.
Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool
Quote:
Originally Posted by
Ed Jobe
What do you mean, "working through the gui"? The layouts collection should be available in odbx.
I think that is what they are saying... thanks to my post they can avoid going thru the GUI.
Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool
Quote:
Originally Posted by
RobertB
I think that is what they are saying... thanks to my post they can avoid going thru the GUI.
I see, one of those lines that can be read two ways.
Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool
Wow. It's great to see someone else has discovered oDBX.
I wrote a similar program that reads drawings from a list, prints the title block info along with the issue history, looks for certain errors, creates an Excel matrix of every issue and which drawings were in each, then makes a Word doc drawing list to insert into the project specs.
What needs to be mentioned about oDBX is its speed. The above task, which can take DAYS to do by hand, on a project with 1200 sheets took 50 seconds. Yes, 50 seconds!
Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool
Quote:
Originally Posted by
MikeJarosz
Wow. It's great to see someone else has discovered oDBX.
There's been lots of conversations in here on odbx. I've even written a cls to address some of it's limitations.
Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool
Can somebody help to itrate between the layout collection
Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool
Quote:
Originally Posted by
sujit.subramaniam
Can somebody help to itrate between the layout collection
Surely you know how to create a For Each ... Next loop?