![]() |
【转帖】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. |
所有的时间均为北京时间。 现在的时间是 04:44 AM. |