Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK 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
Jan 6, 2021
14
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
 
Replies continue below

Recommended for you

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor