VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to access parts list (mcadpartlist) from axdbdocument in VBA?

1 REPLY 1
Reply
Message 1 of 2
byzod
563 Views, 1 Reply

How to access parts list (mcadpartlist) from axdbdocument in VBA?

I'm developing a tool that can exact title & parts list information from a drawing and edit them

What I did is open those drawings one by one, access the object from Thisdrawing object, it works, but very slow, especially you want to exact like 20+ drawings.

 

Recently I found a very good thing, that is ObjectDBX, it can get information from and edit drawing without open it. I update my code, it works perfectly except the parts list.

 

In my situation, all parts list are stored in AutoCAD built-in BOM, can access form IMcadPartList object in paper space (thisdrawing.paperspace(INDEX_OF_PARTLIST).itemList)

But this seems not available in oDBX document, it's undefined.

 

Example:

' I don't open CAD now, pseudo code below

dim sampleFilePath as string
dim dbx as axdbdocument
dim doc as acaddocument
dim partListRefIndex as integer

sampleFilePath = "somewhere/sample.dwg"
set dbx = new axdbdocument
set doc = thisDrawing

' Let's point both version to the same file
doc.open(sampleFilePath, READ_ONLY)
dbx.open(sampleFilePath)

partListRefIndex = GetPartListRefIndex(doc)

doc.paperspace(partListRefIndex) ' It's an Object/IMcadPartList
dbx.paperspace(partListRefIndex) ' It's an Object/IMcadPartList too

doc.paperspace(partListRefIndex).itemlist ' Variant/Object/IMcadBOMItems
dbx.paperspace(partListRefIndex).itemlist ' Error

 

Please help, is there any way to access the McadBOMItems in oDBX document?

1 REPLY 1
Message 2 of 2
byzod
in reply to: byzod

Bump. NO one knows?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost