What's new

Export PART-LIST to XML

Mauro

New Member
Export PART-LIST to XML

Hi to all,
it's possible to obtain, from a design, a full part-list of objects and export them in a XML file?
which API functions are correct to use?

example:

workname = "table"

objects in work :
2 plates "named pippo"
4 cylinders "named pluto"

Thanks
Mauro
 

cclark440

Alibre Super User


What programming language are you using?

You will need to open the asssembly first, or write extra code to browes for and open the model that you want to get the information for.

Here is VB Code
Code:
    Dim objHook As AlibreX.AutomationHook   'Define the Alibre hook
    Dim objRoot As AlibreX.IADRoot          'Define the Root to work 
    Dim FolderItemType(9) As String         'Holder for Item type name
        
    objHook = GetObject(, \"AlibreX.AutomationHook\") 'Create the Alibre hook
    objRoot = objHook.Root                  'Create the Root to work with

'define item types
    FolderItemType(0) = \"Part\"
    FolderItemType(1) = \"Assembly\"
    FolderItemType(2) = \"Drawing\"
    FolderItemType(3) = \"Bom\"
    FolderItemType(4) = \"Symbol\"
    FolderItemType(5) = \"External\"
    FolderItemType(6) = \"Bom Table\"
    FolderItemType(7) = \"Sheet Metal\"
    FolderItemType(8) = \"Catalog Feature\"
    FolderItemType(9) = \"Sheet Metal Catalog Feature\"


    For Each adSession As AlibreX.IADSession In objRoot.Sessions       'Load session info into edit box
         RTB1.Text = RTB1.Text & \"Session Type: \" & FolderItemType(adSession.SessionType - 1) & \", Name: \" & adSession.Name & \", Id: \" & adSession.Identifier & vbCrLf

    Next

This will get the names and types of items in the Assembly. You will have to write the code to format it into the XML data.
 

Mauro

New Member


many thanks,

i programming with VB and VB.NET (VS2005)

for test your VB code i must create add-on in Alibre Interface?

Mauro
 

cclark440

Alibre Super User


No you don't create an add-on. You just have to make sure that Alibre is running, then run your project, either after it has been compiled or runnning from within VB.
 

Mauro

New Member


Thanks a lot, now i obtain a full part list, example :
Session Type: Assembly
Name: assembly 3 solid
Id: {8A75D2F4-5EEA-4619-9D84-F60F0627ECAD}
Session Type: Part
Name: solid_1
Id: {6DBA59BD-E918-45E7-8D73-29E0BEBC25F6}
Session Type: Bom Table
Name: Single_sheet
Id: {14BECEE2-44DB-4D9B-84CB-2DC67B32CDC3}

but i have 2 "solid_1" and 3 "Single_sheet" in my assembly and i don't know how find this quantity.

do you know how can i do?

Mauro
 
Top