Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

looking the function to read catia bodypart in c++ 1

Status
Not open for further replies.

suri90

Computer
Nov 19, 2020
4
IN
Hey,
I am trying to read the full CATIA hierarchy but not able to read some part of c++ API which is shown in the fig
catia_her_rfx7q8.jpg


I am using the CATIA selection function to read
code snip:
App = (INFITF::Application^)Marshal::GetActiveObject("CATIA.Application");
Documentread = (ProductStructureTypeLib::productDocument^)App->ActiveDocument; //(using productDocument not able to find alternative for part ???
 
Replies continue below

Recommended for you

Your question isn't about C++ as one could imagine, but about Automation API. Which is COM-based and thus the same for all languages.

So I suggest you to study Automation help, located in \code\bin\V5Automation.chm

As a quick hint:

Code:
ProductDocument doc = App.ActiveDocument;
Product root = doc.Product;
foreach (Product sub in root.Products)
{
  Product refPrd = sub.ReferenceProduct;
  Document refDoc = refPrd.Parent;
  if (refDoc is MECMOD.PartDocument)
  {
    MECMOD.Part prt = refDoc.Part;
    // refer to Part reference in V5Automation.chm
  }
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top