NX9+VS2012 using System; using NXOpen; using NXOpen.UF; //打开单选对话框 string message = "请选择体"; string title = "请选择体"; Selection.MaskTriple[] mask_arry = new Selection.MaskTriple[1]; mask_arry[0].Type = UFConstants.UF_solid_type; mask_arry[0].Subtype = UFConstants.UF_solid_body_subtype; mask_arry[0].SolidBodySubtype = 0; TaggedObject BodyTag = new TaggedObject(); Point3d pos = new Point3d(); Selection.Response resp = UI.GetUI().SelectionManager.SelectTaggedObject(message, title, Selection.SelectionScope.WorkPart, Selection.SelectionAction.ClearAndEnableSpecific, false, false, mask_arry, out BodyTag, out pos); //设置颜色 theUfSession.Obj.SetColor(BodyTag.Tag, 186); Caesar卢尚宇 2020年8月27日