Message 1 of 2

Not applicable
03-07-2017
09:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to check if a part is derived because I'm developing a method to fix missing references.
To verify, I use a foreach that traverses all occurrences.
AssemblyDocument asmDoc = (AssemblyDocument)invApp.ActiveDocument; ComponentOccurrences Occurrences = asmDoc.ComponentDefinition.Occurrences; foreach (ComponentOccurrence oOcc in Occurrences) { }
In this example, it is possible to see that the reference is lost for the part that originated the derive.
I'm trying to do that, but I can not do it.
PartDocument oPart = (PartDocument)oOcc; ReferenceComponents oRefsComps = oPart.ComponentDefinition.ReferenceComponents; DerivedPartComponent oDerPartC = oRefsComps.DerivedPartComponents[1]; DerivedPartDefinition oDerPartDef = oDerPartC.Definition; if (oDerPartDef is DerivedPartDefinition) { MessageBox.Show("yes"); }
Thanks.
Solved! Go to Solution.