NX二次开发:保存时导出PDF并打开

本文介绍了如何在NX二次开发中利用UF_PUT函数入口,在保存文件时导出PDF并自动打开。通过设置用户出口和环境变量,实现特定操作。详细步骤和示例代码请参考博客园中的完整内容。
摘要由CSDN通过智能技术生成

该内容已在博客园发布。NX二次开发:保存时导出PDF并打开 - huangym1 - 博客园 (cnblogs.com)

该工程为在保存时执行开发的功能,函数入口点ufput。其他还有新建、打开、另存等都可以加入开发的操作,具体看UF_EXIT下的介绍。

用户出口是一个可选特性,允许你在NX中某些预定义的位置(或出口)自动运行Open C API程序。如果你进入其中一个出口,NX会检查你是否定义了指向Open C API程序位置的指针。如果定义了指针,NX将运行Open C API程序。指针是一个环境变量。

注意:

一定要设置环境变量指向自己生成的DLL。例如:USER_FILE=E:\workspace\Infore\tcnx_project\application\tcnx_project.dll

// Mandatory UF Includes
#include <uf.h>
#include <uf_object_types.h>
#include <uf_draw.h>
#include <uf_part.h>

// Internal+External Includes
#include <NXOpen/Annotations.hxx>
#include <NXOpen/Assemblies_Component.hxx>
#include <NXOpen/Assemblies_ComponentAssembly.hxx>
#include <NXOpen/Body.hxx>
#include <NXOpen/BodyCollection.hxx>
#include <NXOpen/Face.hxx>
#include <NXOpen/Line.hxx>
#include <NXOpen/NXException.hxx>
#include <NXOpen/NXObject.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <NXOpen/Session.hxx>

#include <NXOpen/PrintPDFBuilder.hxx>
#include <NXOpen/PlotManager.hxx>
#include <NXOpen/Drawings_DrawingSheet.hxx>
#include <NXOpen/NXObjectManager.hxx>

// Std C++ Includes
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值