其他分享
首页 > 其他分享> > UG OPENAPI 选择面上的点同时获取面tag

UG OPENAPI 选择面上的点同时获取面tag

作者:互联网

private void getpoint_face()
{

UFSession theUFSession = UFSession.GetUFSession();


int response;
double[] point = new double[3];//点坐标


//UFUi.PointBaseMethod Method = UFUi.PointBaseMethod.PointDialog;//点选择器
UFUi.PointBaseMethod Method = UFUi.PointBaseMethod.PointOnSurfacePt;//默认 选面上的点
Tag pointtag;
theUFSession.Ui.PointConstruct("选择点", ref Method, out pointtag, point, out response);
// UF_SO_ask_parents(const tag_t so, UF_SO_ASK_ALL_PARENTS, int * n_parents, tag_p_t * parents )//C++

int n_parents;
Tag []parents;//面tag
theUFSession.So.AskParents(pointtag, UFConstants.UF_SO_ASK_ALL_PARENTS, out n_parents, out parents);

for (int i = 0; i < parents.Length; i++)
{
int type, ssubtype;
theUFSession.Obj.AskTypeAndSubtype(parents[i], out type, out ssubtype);

if (type == 70 && ssubtype == 2)
{
// MessageBox.Show("获取选择的面tag");
// theUFSession.Disp.SetHighlight(parents[i], 0);//取消高亮显示
theUFSession.Obj.SetColor(parents[i], 100);//修改面的颜色,测试
}
}

 

}

 

C++ 代码与此类似。

 

标签:int,theUFSession,OPENAPI,PointBaseMethod,tag,parents,UG,out
来源: https://www.cnblogs.com/feiyangkf/p/14505331.html