Jump to content

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


Recommended Posts

Posted

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?

  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...