Catia macro BOM to partproperties
Catia macro BOM to partproperties
(OP)
Hi all,
I have the following Problem
I try to make a script to extract properties like quantity, positon number,... from BOM(billofmaterial)
and put them to part_properties
I need this data for further processing.
Can you someone help me please?
Thanks a lot
lp jure
I have the following Problem
I try to make a script to extract properties like quantity, positon number,... from BOM(billofmaterial)
and put them to part_properties
I need this data for further processing.
Can you someone help me please?
Thanks a lot
lp jure





RE: Catia macro BOM to partproperties
Did you searched the forum for related topics?
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Catia macro BOM to partproperties
yes i found this
it is very usefull but i dont know how to extract data for exact part:
CODE -->
Sub CATMain() Dim productDocument1 As Document 'Set productDocument1 = CATIA.ActiveDocument Set productDocument1 = CATIA. Dim product1 As Product Set product1 = productDocument1.Product Dim assemblyConvertor1 As CATBaseDispatch Set assemblyConvertor1 = product1.GetItem("BillOfMaterial") 'Dim arrayOfVariantOfBSTR1(7) 'change number if you have more custom columns/array... 'arrayOfVariantOfBSTR1(0) = "Quantity" 'arrayOfVariantOfBSTR1(1) = "Part Number" 'arrayOfVariantOfBSTR1(2) = "Number" 'arrayOfVariantOfBSTR1(3) = "Nomenclature" 'arrayOfVariantOfBSTR1(4) = "Revision" 'arrayOfVariantOfBSTR1(5) = "Mass" 'in addition of what is by default 'arrayOfVariantOfBSTR1(6) = "Density" 'in addition of what is by default 'arrayOfVariantOfBSTR1(7) = "Material" 'in addition of what is by default 'assemblyConvertor1.SetCurrentFormat arrayOfVariantOfBSTR1 Dim arrayOfVariantOfBSTR2(3) 'change number if you have more custom columns/array... arrayOfVariantOfBSTR2(0) = "Quantity" arrayOfVariantOfBSTR2(1) = "Part Number" arrayOfVariantOfBSTR2(2) = "Number" arrayOfVariantOfBSTR2(3) = "Naziv" assemblyConvertor1.SetSecondaryFormat arrayOfVariantOfBSTR2 assemblyConvertor1.Print "TXT", "c:\macro\Custom_BOM.txt", product1 Set xlApp = CreateObject("Excel.Application") Set MyXL = GetObject(, "Excel.Application") If Err.Number <> 0 Then ExcelWasNotRunning = True Err.Clear Set MyXL = GetObject("C:\macro\Book1.xls") XLApp.Visible = TrueThanks a lot
lp jure
RE: Catia macro BOM to partproperties
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Catia macro BOM to partproperties
yes i need to write data (painted red) from BOM (maybe i can find this data somewhere else) to user defined properties(see picture down)
in ned to put "quantity" to kolicina
and "number" to pozicija
CODE -->
regards
jure
RE: Catia macro BOM to partproperties
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU