在页面空白处放置一个注释,注释可以在界面中定义。
//创建注释
int UserNoteCreate(ProDrawing drawing,ProLine notestr,ProVector pos,ProModelitem modelitem,ProSelection* view_sel)
{
ProError err;
ProDtlnotetext text;
ProDtlnoteline line;
ProDtlnotedata ndata;
ProView view;
ProDtlattach attach;
ProDtlnote note;
ProSelection csys_sel;
int pid;
err=ProWindowCurrentGet(&pid);
//为注释文本数据分配内存
err=ProDtlnotetextAlloc(&text);
if (err!=PRO_TK_NO_ERROR)
return err;
//将注释文本存入text中
err=ProDtlnotetextStringSet(text,notestr);
if (err!=PRO_TK_NO_ERROR)
&n

本文介绍了如何在Creo环境中进行二次开发,通过自定义函数UserNoteCreate实现动态添加注释。该函数接收注释文本、位置、模型项等参数,创建并显示注释。在用户界面上点击按钮,调用OnBnClickedBtnNoteAdd函数,根据用户输入的注释内容和鼠标点击位置,成功添加注释到指定对象上。
最低0.47元/天 解锁文章
5279

被折叠的 条评论
为什么被折叠?



