Message 1 of 5
Assembly of sub assembly and assembly occurrence using face naming
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to assemble a sub assembly with with the assembly occurrence using face naming concept.
The face name is taken from a part of sub assembly. I am getting an unspecified error when creating the mate.
I have check both of my face names are taken.
Below is a reference code attached.
Thanks in advance.
if (HFWNSP_C.ReferencedDocumentDescriptor.ReferencedDocumentType == DocumentTypeEnum.kAssemblyDocumentObject)
{
AssemblyDocument CurrPartd = (AssemblyDocument)HFWNSP_C.ReferencedDocumentDescriptor.ReferencedDocument;
for (int i = 1; i < CurrPartd.ComponentDefinition.Occurrences.Count; i++)
{
if (CurrPartd.ComponentDefinition.Occurrences[i]._DisplayName == "HFWNSP_C_bkhs")
{
PartDocument RefDoc = (PartDocument)CurrPartd.ComponentDefinition.Occurrences[i].Definition.Document;
ComponentOccurrence currCompOcc = CurrPartd.ComponentDefinition.Occurrences[i];
RefDoc = (PartDocument)currCompOcc.ReferencedDocumentDescriptor.ReferencedDocument;
Obj = RefDoc.AttributeManager.FindObjects("iLogicEntityNameSet", "iLogicEntityName", "Face1");
oFace1 = (Face)Obj[1];
currCompOcc.CreateGeometryProxy(oFace1, out FaceObj1);
break;
}
}
}
else
{
}
if (occ5.ReferencedDocumentDescriptor.ReferencedDocumentType == DocumentTypeEnum.kAssemblyDocumentObject)
{
}
else
{
PartDocument prtDoc = (PartDocument)occ5.ReferencedDocumentDescriptor.ReferencedDocument;
Obj = prtDoc.AttributeManager.FindObjects("iLogicEntityNameSet", "iLogicEntityName", "Face1");
oFace2 = (Face)Obj[1];
occ5.CreateGeometryProxy(oFace2, out FaceObj2);
}
oAsmCompDef.Constraints.AddMateConstraint(FaceObj1, FaceObj2, 0);