NX二次开发-NXOPEN将工程图转成PDF文件
NX9+VS2012 #include <uf.h>
#include <uf_draw.h>
#include <NXOpen/PrintPDFBuilder.hxx>
#include <NXOpen/Drawings_DrawingSheet.hxx>
#include <NXOpen/NXObjectManager.hxx>
#include <NXOpen/PlotManager.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <NXOpen/Session.hxx> Session *theSession = Session::GetSession();
Part *workPart(theSession->Parts()->Work());
Part *displayPart(theSession->Parts()->Display()); UF_initialize(); tag_t drawing_tag = NULL_TAG;
UF_DRAW_ask_current_drawing(&drawing_tag); if (drawing_tag != NULL_TAG)
{
PrintPDFBuilder *printPDFBuilder1;
printPDFBuilder1 = workPart->PlotManager()->CreatePrintPdfbuilder(); printPDFBuilder1->SetColors(PrintPDFBuilder::ColorAsDisplayed);
printPDFBuilder1->SetWidths(PrintPDFBuilder::WidthStandardWidths);
printPDFBuilder1->SetSize(PrintPDFBuilder::SizeOptionScaleFactor);
printPDFBuilder1->SetScale(1.0);
printPDFBuilder1->SetOutputText(PrintPDFBuilder::OutputTextOptionPolylines);
printPDFBuilder1->SetUnits(PrintPDFBuilder::UnitsOptionMetric); std::vector<NXObject *> sheets1();
Drawings::DrawingSheet *drawingSheet1(dynamic_cast<Drawings::DrawingSheet *>(NXOpen::NXObjectManager::Get(drawing_tag)));
sheets1[] = drawingSheet1;
printPDFBuilder1->SourceBuilder()->SetSheets(sheets1);
printPDFBuilder1->SetFilename("D:\\11111.pdf"); NXObject *nXObject1;
nXObject1 = printPDFBuilder1->Commit();
printPDFBuilder1->Destroy();
} UF_terminate();

NX二次开发-NXOPEN将工程图转成PDF文件的更多相关文章
- NX二次开发-UFUN将工程图转成CGM和PDF文件UF_CGM_export_cgm
文章转载自唐康林NX二次开发论坛,原文出处: http://www.nxopen.cn/thread-126-1-1.html 刚才有同学问到这个问题,如果是用NXOpen来做,直接录制一下就可以了: ...
- NX二次开发-NXOPEN更改工程图视图名字baseView1->SetName("LSY");
NX9+VS2012 #include <uf.h> #include <uf_draw.h> #include <uf_obj.h> #include <u ...
- NX二次开发-NXOPEN设置工程图表格注释字体workPart->Fonts()->AddFont("chinesef_fs", NXOpen::FontCollection::TypeNx);
NX9+VS2012 #include <uf.h> #include <uf_tabnot.h> #include <NXOpen/Part.hxx> #incl ...
- NX二次开发-NXOPEN创建工程图表格Annotations::TableSectionBuilder *tableSectionBuilder1;
NX9+VS2012 #include <uf.h> #include <uf_tabnot.h> #include <NXOpen/Part.hxx> #incl ...
- NX二次开发-NXOpen读取工程图注释note1->GetText();
NX9+VS2012 #include <uf.h> #include <uf_drf.h> #include <NXOpen/Annotations_Note.hxx& ...
- NX二次开发-NXOpen中Point3d类型转换成point类型
NX9+VS2012 #include <NXOpen/NXObject.hxx> #include <NXOpen/Part.hxx> #include <NXOpen ...
- NX二次开发-NXOPEN自动切换到工程图模块
UFUN的API里是没有切换到工程图的函数的,NXOPEN里是有方法可以用的.不过应该是不支持NX9以下的版本. NX9的不能录制出来,在UI类里有方法 NX9+VS2012 #include < ...
- NX二次开发-NXOPEN获取所有工程图和所有视图DrawingSheet,DrawingSheetCollection,DraftingView
NX11+VS2013 #include <NXOpen/Part.hxx> #include <NXOpen/PartCollection.hxx> #include < ...
- NX二次开发-NXOPEN工程图导出CAD图纸DxfdwgCreator *dxfdwgCreator1;
没有什么可以看的,NXOPEN直接录制一下导出CAD就可以了.录制出来自己挑需要的代码拿过来改一下. NX9+VS2012 #include <NXOpen/Part.hxx> #incl ...
随机推荐
- Python爬虫实战——反爬策略之模拟登录【CSDN】
在<Python爬虫实战-- Request对象之header伪装策略>中,我们就已经讲到:=="在header当中,我们经常会添加两个参数--cookie 和 User-Age ...
- TCP三次挥手
tcp:三次握手 client和server之间需要经历三次握手才能建立连接(connnect()方法中封装了三次握手的步骤)syn:同步请求,建立连接的请求ack:对syn请求包的确认 应答syn: ...
- magento 为用户注册增加一个字段
步骤 I. 加一个occupation/title字段到用户注册页,差不多在register.html的54行,在email下方加一个Occupation显示代码 代码: <li>< ...
- 【转】SpringMVC整合websocket实现消息推送及触发
1.创建websocket握手协议的后台 (1)HandShake的实现类 /** *Project Name: price *File Name: HandShake.java *Packag ...
- Service7
在真机上,利用clone-vm7新建一台虚拟机,名字:PXE-Server 1.设置防火墙为trusted 2.当前及永久关闭SELinux 3.配置IP地址:192.168.4.16 ...
- Service5
DHCP概述及原理• Dynamic Host Configuration Protocol – 动态主机配置协议,由 IETF(Internet 网络工程师任务小组)组织制定,用来简化主机地址分配 ...
- 网关协议:CGI和WSGI
通常服务器程序分为web服务器和应用程序服务器.web服务器是用于处理HTML文件,让客户可以通过浏览器进行访问,主流的web服务器有Apache.IIS.Nginx.lighthttpd等.应用服务 ...
- js-统计中文,英文,字符的个数
function getByteLen(val) { ; ; i < val.length; i++) { var a = val.charAt(i); if (a.match(/[^\x00- ...
- CSS:CSS 媒体类型
ylbtech-CSS:CSS 媒体类型 1.返回顶部 1. CSS 媒体类型 媒体类型允许你指定文件将如何在不同媒体呈现.该文件可以以不同的方式显示在屏幕上,在纸张上,或听觉浏览器等等. 媒体类型 ...
- Spellchecker inspection helps locate typos and misspelling in your code, comments and literals, and fix them in one click
Pycharm设置 Pycharm总是很多的拼写检查波拉线 Spellchecker inspection helps locate typos and misspelling in your cod ...