-
1
- #1
PrasannaNX
Automotive
- Aug 5, 2014
- 31
Hi,
Is there any way to get object from reference (CATIAReference)?
I have already tried searching the forum but couldn't able to find any relevant thread.
Is there any way to get object from reference (CATIAReference)?
I have already tried searching the forum but couldn't able to find any relevant thread.
Code:
INFITF.Application catApp = (Application)Marshal.GetActiveObject("Catia.Application");
ProductDocument catProdDoc = (ProductDocument)catApp.ActiveDocument;
Product catProd = catProdDoc.Product;
Constraints catConsts = (Constraints)catProd.Connections("CATIAConstraints");
for (int iIndex = 1; iIndex <= catConsts.Count; iIndex++)
{
Constraint catCons = (Constraint)catConsts.Item(iIndex); //Fix constraint
Reference catRef = catCons.GetConstraintElement(1); //Part1 inside Product >> [b]How to convert this reference to Part object?[/b]
}