获取实体的所有面,测量两个面角度,获取面的相邻面
Posted 巫居树
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了获取实体的所有面,测量两个面角度,获取面的相邻面相关的知识,希望对你有一定的参考价值。
//获取实体的所有面,测量两个面角度,获取面的相邻面 int face_1 = 1; int face_2 = 5; TaggedObject body; Point3d point; theUI.SelectionManager.SelectTaggedObject("选择实体", "选择", Selection.SelectionScope.AnyInAssembly, false, false, out body, out point); Face[] faces = (body as Body).GetFaces(); //测量两个面 NXOpen.Unit nullNXOpen_Unit = null; NXOpen.MeasureAngle measureAngle1; measureAngle1 = theSession.Parts.Work.MeasureManager.NewAngle (nullNXOpen_Unit, faces[face_1], NXOpen.MeasureManager.EndpointType.StartPoint, faces[face_2], NXOpen.MeasureManager.EndpointType.StartPoint, true, false); //编辑显示 DisplayModification display = theSession.DisplayManager.NewDisplayModification(); display.NewColor = 75; display.Apply(new DisplayableObject[] { faces[face_1] }); //获取面的相邻面 Tag[] tags; theUfSession.Modl.AskAdjacFaces(faces[face_1].Tag, out tags); NXOpen.Utilities.NXObjectManager nXObject = new NXOpen.Utilities.NXObjectManager(); for (int i = 0; i < tags.Length; i++) { display.NewColor = 211; Face adjacent = (Face)nXObject.GetTaggedObject(tags[i]); display.Apply(new DisplayableObject[] { adjacent }); }
以上是关于获取实体的所有面,测量两个面角度,获取面的相邻面的主要内容,如果未能解决你的问题,请参考以下文章