|
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 |
|