×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Catia macro BOM to partproperties

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

RE: Catia macro BOM to partproperties

(OP)
tnx to reply ferdo

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 = True 


Thanks a lot

lp jure

RE: Catia macro BOM to partproperties

(OP)
tnx ferdo

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 -->

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 



regards
jure

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources