几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » SolidWorks二次开发
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-04-13, 09:33 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】cant figure out how get 3d pdf option enabled

can't figure out how get 3d pdf option enabled
please forgive my ignorance, but i am a novice programmer.
can anyone post a code snippet showing how to enable the 3d pdf save as export option.
including the modeldocextension.saveas syntax would also be greatly appreciated.
john picinich
cadimensions inc. | 14 computer drive east | albany | ny | 12205 | usa
phone: 518-438-0647 | fax: 518-438-0761 |
jim,
we are still a teksoft reseller. you will see our company and access mfg. listed on the teksoft website as resellers in ny.
regarding the us open, unfortunately i've never been.
best regards,
john
john picinich
cadimensions inc. | 14 computer drive east | albany | ny | 12205 | usa
phone: 518-438-0647 | fax: 518-438-0761 |
option explicit
dim swapp as sldworks.sldworks
dim swmodel as sldworks.modeldoc2
dim swmodeldocext as sldworks.modeldocextension
dim swexportpdfdata as sldworks.exportpdfdata
dim boolstatus as boolean
dim filename as string
dim lerrors as long
dim lwarnings as long
sub main()
' path to which to save pdf file of drawing
filename = "c:\file.pdf"
set swapp = application.sldworks
swapp.visible = true
' open specified drawing
set swmodel = swapp.opendoc6("c:\file.slddrw", swdocdrawing, swopendocoptions_silent, "", lerrors, lwarnings)
set swmodeldocext = swmodel.extension
set swexportpdfdata = swapp.getexportfiledata(1)
swexportpdfdata.exportas3d = true
if swexportpdfdata is nothing then msgbox "nothing"
boolstatus = swexportpdfdata.setsheets(swexportdata_exportallsheets , nothing)
boolstatus = swmodeldocext.saveas(filename, 0, 0, swexportpdfdata, lerrors, lwarnings)
end sub
luke,
thank you for your assistance!
i was attempting to integrate this functionality into an older macro written by one of my co-workers.
not an easy job when you are a programming novice, dealing with unfamliar new and legacy api calls.
everything is now working perfectly!!
john picinich
cadimensions inc. | 14 computer drive east | albany | ny | 12205 | usa
phone: 518-438-0647 | fax: 518-438-0761 |
luke,
when i tested your code with a drawing of mine, the macro created the file like it was supposed to, but there was no 3d data in the pdf. i see the solidworks ui dialog boxes only allows you to save as a 3dpdf in assembly or part mode. was there supposed to be a 3d portion in the pdf file generated? if not, is there a way to have solidworks save 3d data with the drawing data in a single pdf file?
thanks
kevin
kevin kenny, cswp
sw 2009 sp3.0
hp xw4300
no the way sw converts drawings to other formats is to just export the single plane projected line data so it always ends up as a 2d drawing, with the exception of edrawing files
if you have a copy of adobe acrobat 3d, you can add 3d models in your pdf files.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】how to silent printing pdf from sw macro yang686526 SolidWorks二次开发 0 2009-04-12 09:24 PM
【转帖】how to silent printing pdf from sw macro yang686526 SolidWorks二次开发 0 2009-04-12 06:39 PM
Vc下编程实现3d文字 huangyhg vc编程 0 2009-01-21 12:29 AM
3d图形名词术语大放送 huangyhg 图形算法 1 2007-10-15 06:30 PM
下载好多软件 ping CAD资料交换区 6 2007-03-03 09:13 PM


所有的时间均为北京时间。 现在的时间是 11:16 PM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多