NX二次开发.net C#语言获取装配组件
static NXOpen.Assemblies.Component[] getAllChildren(BasePart assy){
System.Collections.ArrayList theChildren = new System.Collections.ArrayList();
Tag aChildTag = Tag.Null;
do
{
theUFSession.Obj.CycleObjsInPart(assy.Tag, UFConstants.UF_component_type, ref aChildTag);
if ((aChildTag == Tag.Null)) break;
NXOpen.Assemblies.Component aChild = (NXOpen.Assemblies.Component)NXOpen.Utilities.NXObjectManager.Get(aChildTag);
theChildren.Add(aChild);
} while (true);
return (NXOpen.Assemblies.Component[])theChildren.ToArray(typeof(NXOpen.Assemblies.Component));
}
分享大家参考下!!!
页:
[1]