几何尺寸与公差论坛

 找回密码
 注册
查看: 679|回复: 0

【转帖】saveas igsstep

[复制链接]
发表于 2009-4-12 22:18:08 | 显示全部楼层 |阅读模式
saveas igs/step
i'm trying to create a simple function that exports the current drawing to .pdf, and exports the referenced model to .x_b, .igs and .step. the code is quite simply:
dim swexportpdfdata as sldworks.exportpdfdata = swapp.getexportfiledata(1)
swexportpdfdata.setsheets(swexportdatasheetstoexport_e.swexportdata_exportallsheets, nothing)
issaved = swdwg.extension.saveas(releasepath & aval & ".pdf", swsaveasversion_e.swsaveascurrentversion, swsaveasoptions_e.swsaveasoptions_silent, swexportpdfdata, nerrors, nwarnings)
issaved = swmodel.extension.saveas(releasepath & aval & ".x_b", swsaveasversion_e.swsaveascurrentversion, swsaveasoptions_e.swsaveasoptions_silent, nothing, nerrors, nwarnings)
issaved = swmodel.extension.saveas(releasepath & aval & ".igs", swsaveasversion_e.swsaveascurrentversion, swsaveasoptions_e.swsaveasoptions_silent, nothing, nerrors, nwarnings)
issaved = swmodel.extension.saveas(releasepath & aval & ".step", swsaveasversion_e.swsaveascurrentversion, swsaveasoptions_e.swsaveasoptions_silent, nothing, nerrors, nwarnings)
if each save fails, i record the save error and display a warning to the user. the pdf file saves fine, and the binary parasolid also saves without a problem. the igs and step files, however, do not save properly.
when saving the igs file, a .err file is created, and when saving the .step file, the following error occurs:
"attempted to read or write protected memory. this is often an indication that other memory is corrupt."
i've tried it on two different computers and receive the same message.
any thoughts would be appreciated!
thanks
one more piece of info, i'm running sw 2007 sp3.0.
answer solved!
the model document that was being saved was open, but not active when i ran the save command (since the command was initiated from the drawing).
by simply activating the model before converting to igs and step, the error messages disappeared.
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 15:30 , Processed in 0.036668 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表