Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

“Compenent” elements seen as “ProductDocument” in CATIA VBA 1

Status
Not open for further replies.

MsuMsu

Mechanical
Joined
Jan 6, 2021
Messages
14
Location
TR
I have a problem. I can import feature types in catia vba with the following codes

Set document1 = CATIA.Documents.Item("Product1.CATProduct")
Set products1 = document1.Product.Products

For i = 1 To products1.Count

MsgBox TypeName(products1.Item(i).ReferenceProduct.Parent)

Next i
but it also shows "Compenent" elements as "ProductDocument". If component is, I want to make a separate operation.

How can I find out that an element is a "Component" ?

1_phtuke.png
 
Just thinking... If you search for the file name of that component and compare it with the product above, you will be able to know if this is a component or a product... If this is the solution please share the code.

Eric N.
indocti discant et ament meminisse periti
 
Code:
for each prd in products1
  if prd.ReferenceProduct.Parent.Product.PartNumber <> prd.PartNumber then
   ... this is a component
  end if
next
 
thanks a lot it works
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top