NX二次开发-NXOPEN C# WinForm点构造器UF.Ui.PointConstruct和UI加锁解锁UF.Ui.LockUgAccess

时间:2020-07-22 02:08:52   收藏:0   阅读:174
NX9+VS2012

using NXOpen;
using NXOpenUI;
using NXOpen.UF;
using NXOpen.Utilities;


private void button1_Click(object sender, EventArgs e)
{
    //锁定UI
    theUfSession.Ui.LockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);

    UFUi.PointBaseMethod BaseMethod = UFConstants.UF_UI_POUNDS_INCHES;
    Tag PointTag = new Tag();
    double[] BasePt = new double[3];
    int Response = 0;
    theUfSession.Ui.PointConstruct("点构造器", ref BaseMethod, out PointTag, BasePt, out Response);

    //解锁UI
    theUfSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);

    //创建点
    Tag Point1Tag = NXOpen.Tag.Null;
    theUfSession.Curve.CreatePoint(BasePt,out Point1Tag);
}

Caesar卢尚宇
2020年7月21日

如果用BlockUI可以直接使用点控件,而用WinForm的时候,不能用BlockUI,这个时候只能用UF里的点构造器。在使用的时候,必须要先加锁,在解锁才能弹出点构造器,要不然不能正常使用。

技术图片

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!