NX9+VS2012

 #include <uf.h>
#include <uf_tabnot.h>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <NXOpen/Session.hxx>
#include <NXOpen/Annotations_TableSectionCollection.hxx>
#include <NXOpen/Annotations_AnnotationManager.hxx>
#include <NXOpen/FontCollection.hxx> UF_initialize(); //创建表格注释
Annotations::TableSection *nullAnnotations_TableSection(NULL);
Annotations::TableSectionBuilder *tableSectionBuilder1;
tableSectionBuilder1 = workPart->Annotations()->TableSections()->CreateTableSectionBuilder(nullAnnotations_TableSection);
NXOpen::Point3d TablePoint(194.0, 17.0, 0.0);
tableSectionBuilder1->Origin()->SetOriginPoint(TablePoint);
tableSectionBuilder1->SetNumberOfColumns();
tableSectionBuilder1->SetNumberOfRows();
tableSectionBuilder1->SetRowHeight(20.0);
tableSectionBuilder1->SetColumnWidth();
tableSectionBuilder1->Commit();
NXObject *nXObject1;
nXObject1 = tableSectionBuilder1->Commit();
tableSectionBuilder1->Destroy(); //section转tag
tag_t TabularNote = NULL_TAG;
UF_TABNOT_ask_tabular_note_of_section(nXObject1->Tag(), &TabularNote); //获取第一行的Tag
tag_t Row0Tag = NULL_TAG;
UF_TABNOT_ask_nth_row(TabularNote, , &Row0Tag); //获取第二行的Tag
tag_t Row1Tag = NULL_TAG;
UF_TABNOT_ask_nth_row(TabularNote, , &Row1Tag); //获取第一列的Tag
tag_t Column0Tag = NULL_TAG;
UF_TABNOT_ask_nth_column(TabularNote, , &Column0Tag); //获取第二列的Tag
tag_t Column1Tag = NULL_TAG;
UF_TABNOT_ask_nth_column(TabularNote, , &Column1Tag); //得到第一行第一列单元格的Tag
tag_t Cell0Tag = NULL_TAG;
UF_TABNOT_ask_cell_at_row_col(Row0Tag, Column0Tag, &Cell0Tag); //得到第一行第二列单元格的Tag
tag_t Cell1Tag = NULL_TAG;
UF_TABNOT_ask_cell_at_row_col(Row0Tag, Column1Tag, &Cell1Tag); //得到第二行第一列单元格的Tag
tag_t Cell2Tag = NULL_TAG;
UF_TABNOT_ask_cell_at_row_col(Row1Tag, Column0Tag, &Cell2Tag); //得到第二行第二列单元格的Tag
tag_t Cell3Tag = NULL_TAG;
UF_TABNOT_ask_cell_at_row_col(Row1Tag, Column1Tag, &Cell3Tag); //写文本
UF_TABNOT_set_cell_text(Cell0Tag, "设计者:");
UF_TABNOT_set_cell_text(Cell1Tag, "卢尚宇"); //合并最底下的单元格
UF_TABNOT_merge_cells(Cell2Tag, Cell3Tag); //获取合并单元格的行Tag
tag_t MergeRowTag = NULL_TAG;
UF_TABNOT_ask_nth_row(TabularNote, , &MergeRowTag); //获取合并单元格的列Tag
tag_t MergeColumnTag = NULL_TAG;
UF_TABNOT_ask_nth_column(TabularNote, , &MergeColumnTag); tag_t MergeCellTag = NULL_TAG;
UF_TABNOT_ask_cell_at_row_col(MergeRowTag, MergeColumnTag, &MergeCellTag); //写文本
UF_TABNOT_set_cell_text(MergeCellTag, "版本号:xxxxxxxxxx"); //检索默认单元格首选项
UF_TABNOT_cell_prefs_t cell_prefs;
UF_TABNOT_ask_default_cell_prefs(&cell_prefs); //设置单元格首选项
int fontIndex1 = workPart->Fonts()->AddFont("chinesef_fs", NXOpen::FontCollection::TypeNx);//更改字体
cell_prefs.text_font = fontIndex1; //字体
UF_TABNOT_set_cell_prefs(Cell0Tag, &cell_prefs);
UF_TABNOT_set_cell_prefs(Cell1Tag, &cell_prefs);
UF_TABNOT_set_cell_prefs(MergeCellTag, &cell_prefs); UF_terminate();

NX二次开发-UFUN工程图表格注释检索默认单元格首选项UF_TABNOT_ask_default_cell_prefs的更多相关文章

  1. NX二次开发-UFUN工程图表格注释section转tag函数UF_TABNOT_ask_tabular_note_of_section

    NX9+VS2012 #include <uf.h> #include <uf_tabnot.h> #include <NXOpen/Part.hxx> #incl ...

  2. NX二次开发-UFUN工程图表格注释获取某一行的tag函数UF_TABNOT_ask_nth_row

    NX9+VS2012 #include <uf.h> #include <uf_tabnot.h> #include <NXOpen/Part.hxx> #incl ...

  3. NX二次开发-UFUN工程图表格注释获取某一列的tag函数UF_TABNOT_ask_nth_column

    NX9+VS2012 #include <uf.h> #include <uf_tabnot.h> #include <NXOpen/Part.hxx> #incl ...

  4. NX二次开发-UFUN工程图表格注释获取某一行某一列的tag函数UF_TABNOT_ask_cell_at_row_col

    NX9+VS2012 #include <uf.h> #include <uf_tabnot.h> #include <NXOpen/Part.hxx> #incl ...

  5. NX二次开发-UFUN工程图表格注释写入文本内容UF_TABNOT_set_cell_text

    NX9+VS2012 #include <uf.h> #include <uf_tabnot.h> #include <NXOpen/Part.hxx> #incl ...

  6. NX二次开发-UFUN工程图表格注释设置单元格首选项UF_TABNOT_set_cell_prefs

    NX9+VS2012 #include <uf.h> #include <uf_tabnot.h> #include <NXOpen/Part.hxx> #incl ...

  7. NX二次开发-UFUN读取表格注释内容UF_TABNOT_ask_cell_text

    NX11+VS2013 #include <uf.h> #include <uf_ui.h> #include <uf_tabnot.h> #include < ...

  8. NX二次开发-读取图纸表格注释与部件属性关联的名字

    NX11+VS2013 #include <uf.h> #include <uf_ui.h> #include <uf_tabnot.h> #include < ...

  9. NX二次开发-UFUN工程图导入视图UF_DRAW_import_view

    NX9+VS2012 #include <uf.h> #include <uf_draw.h> #include <uf_obj.h> #include <u ...

随机推荐

  1. PHP中session存储及删除变量的方法

    Session 变量保存的信息是单一用户的,并且可供应用程序中的所有页面使用.但是session会话信息是临时的,在用户离开网站后就会被删除.如果需要永久储存信息,就需要把数据存储在数据库中. < ...

  2. NOIP模拟测试17

    T1:入阵曲 题目大意:给定一个N*M的矩形,问一共有多少个子矩形,使得矩形内所有书的和为k的倍数. 60%:N,M<=80 枚举矩形的左上角和右下角,用二维前缀和求出数字之和. 时间复杂度$O ...

  3. 逆向思维——cf1241D

    /* 给定一个序列a,每次可以把值为x的所有元素放到a的首部或尾部,问将a变为lis的最少操作步数 对原序列离散化后重新打标记, 可以反着来考虑这个问题:即固定连续的元素值为[l,r]的点不动,那么剩 ...

  4. 单调栈+线段树——cf1220F

     首先考虑初始排列,pi会让周围所有比其大的元素深度+1,所以要求每个点的深度,只要其被覆盖了几次即可 这个覆盖可以通过处理每个元素的左右边界(单调栈O(n))+线段树区间更新(Ologn(n))来做 ...

  5. 欧拉降幂,基本计算定理——cf615D

    用基本算数定理求约数和的思想来计算, 首先用pi,ci来表示第i个质数,指数为i,然后对于每个pi,pi^2...都有指数为mul{(c_1+1)(c_2+1)(c_i-1+1)(c_i+1+1).. ...

  6. Vue 学习笔记之 —— 表单输入绑定

    Vue 中文文档 https://cn.vuejs.org/ 不多说,直接上干货. v-model 指定,用来在input textarea 等表单元素上创建双向数据绑定,负责监听用户的输入事件,以及 ...

  7. Day 18 :面向对象[基础,继承,组合]类的增删改查

    有的人说,编程有3种范式: 1.面向过程:就是分析出解决问题所需要的步骤,然后用函数把这些步骤一步一步实现,使用的时候一个一个依次调用就可以了. 2.面向函数:面向函数是面向过程的升级版,也就是把每个 ...

  8. 32-Ubuntu-用户权限-03-修改文件权限

    chmod 简介 chmod可以修改用户或组对文件或目录的权限. 命令格式如下: chmod +/-rwx 文件名/目录名 修改文件权限 例:demo.txt 1.增加权限 例:增加demo.txt的 ...

  9. ArrayList、Vector、LinkedList的区别

    ArrayList.Vector.LinkedList的区别 1.底层数据结构: ArrayList底层实现是动态数组 Vector底层实现是动态数组 LinkedList底层实现是双链表  2.扩容 ...

  10. Shell 编程综合案例

    Shell编程综合案例 Shell也学习了大概的知识,现在这篇文章就大概讲述下如何使用shell编写一个脚本呢?下面就展示一个大家常用的数据库备份案例来进行展示. 需求分析 1)每天凌晨2:10分备份 ...