您的位置:首页 > 健康 > 美食 > 四川建设网官网证书查询入口_it外包风险_关系网站优化公司_网络公司网页设计

四川建设网官网证书查询入口_it外包风险_关系网站优化公司_网络公司网页设计

2025/5/7 9:25:52 来源:https://blog.csdn.net/m0_53104033/article/details/146214922  浏览:    关键词:四川建设网官网证书查询入口_it外包风险_关系网站优化公司_网络公司网页设计
四川建设网官网证书查询入口_it外包风险_关系网站优化公司_网络公司网页设计

大家好,今天要讲的是关于NX中表达式的相关UFUN函数。

UF_MODL_ask_exps_of_part (view source)

tag_tpart_tagInputTag of the part to be queried
int *number_of_expsOutputNumber of expressions returned
tag_t * *expsOutput to UF_*free*All the expressions in the part. Use UF_free to
deallocate memory.

下面使用一个例子讲解一下:

      Dictionary<string, string> keys = new Dictionary<string, string>();
        int expnumber = 0;
        Tag[] tags;
        theUfSession.Modl.AskExpsOfPart(workPart.Tag,out expnumber,out tags);
        for (int i = 0; i < expnumber; i++)
        {
            string expname = "";
            theUfSession.Modl.AskExpTagString(tags[i], out expname);
            if(!keys.ContainsKey(expname))
            {
                keys.Add(expname, expname);
            }
        }

上面就是将所有的表达式获取出来以后存储在一个字典中。

下面介绍如何更改表达式的值:

UF_MODL_edit_exp (view source)

char *expr_strInputReplacement expression.

下面还是用一个例子来讲解如何使用:

   if (keys[i].Contains("例子1"))
                    {
                        theUfSession.Modl.EditExp("例子1=" + string016.Value);
                    }

当然在这里更新完表达式的值以后,一定要使用theUfSession.Modl.Update();

UF_MODL_update (view source)
 Defined in: uf_modl.h
 Overview

Updates a part. You call this routine after you use UF_MODL_import_exp,
UF_MODL_edit_exp, and UF_MODL_move_feature. Imported and edited expressions
do not take effect until you update the part. After you move a feature, please
update the database.
Environment     Internal and External
Required License(s)    solid_modelingint UF_MODL_update(void)

今天要介绍的就是这么多,我们下篇文章再见。