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_set_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_ask_default_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. git常用操作命令归纳

    git开始 全局配置:配置用户名和e-mail地址 $ git config --global user.name"Your Name" $ git config --global ...

  2. centos7 nodejs二进制安装

    1.安装文件下载 1.下载地址:http://nodejs.cn/download/ 2.选择一个合适的版本下载 2.安装步骤 1.将安装包上传到指定位置(我习惯放到:/usr/local/appli ...

  3. mac MAMP安装redis扩展

    一般情况下目录大概是一样的,只是php的版本不同,所以选择好自己对应的php版本目录即可 git clone https://github.com/nicolasff/phpredis.git cd ...

  4. linux IPC 消息队列

    消息队列函数原型 在建立IPC通讯时(如消息队列,共享内存)必须建立一个ID值.通常情况下,这个ID值由ftok函数得到 #inlcude <sys/types.h> #include & ...

  5. $\mathcal{CSP-S}$,私は来ています

    记事本 开个坑.背包dp我是真的一点也不会了... NOIP2014飞扬的小鸟 NOIP2018货币系统 11-4:$Countdown$ $to$ $the$ $tenth$ $day$ 上午 困的 ...

  6. B606 ChangeNet

    @echo off Setlocal Enabledelayedexpansion title B606 ChangeNet echo Checking... set inside=F&set ...

  7. 利用Pycharm断点调试Python程序

    利用Pycharm断点调试Python程序 1.代码 准备没有语法错误的Python程序: #!/usr/bin/pythonimport numpy as np class Network: def ...

  8. Java学习之集合(Collection接口)

    集合类的由来: 对象用于封装特有数据,对象多了需要存储,如果对象的个数不确定,就使用集合容器进行存储 集合特点: 1.用于存储对象的容器 2.集合长度可变 3.不可以存储基本数据类型 集合体系的顶层C ...

  9. Linux之nginx-uwagi-django 搭建

    1. nginx 1) 使用官方Nginx yum源 [root@nginx ~]# vim /etc/yum.repos.d/nginx.repo [nginx] name=nginx repo b ...

  10. Ubuntu12.04下安装sourcenavigator-NG4.5阅读源代码

    大家知道Windows下有一个很好的查看源代码的软件sourceinsight,使用sourceinsight查看Linux内核代码.嵌入式软件开发中的C语言项目源代码.驱动程序代码很是方便.在Lin ...