|
how to save a proe file from solidworks
anybody know the right api for saving (save as) a proe file (.prt) from a solidworks partfile (.sldprt).
the api saveas2 (as recorded) does not work.
thanks
raghawendra
eaton technologies
pune, india.
saveas works fine, how are you using it?
i was using saveas2 (as recorded through a macro) ... if saveas works fine, then gr8, let me use it.
thanks for quick reply.
thanks
raghawendra
try the following codes.
' ************************************************
' save as proe part file. work only on part file.
' saves the proe file with the same name and same location.
' please make sure the sw file is saved.
' ************************************************
dim swapp as sldworks.sldworks
dim modeldoc as sldworks.modeldoc2
sub main()
set swapp = application.sldworks
set modeldoc = swapp.activedoc
if not modeldoc is nothing then
filetyp = modeldoc.gettype
if filetyp = swdocpart then
dim filepath as string
dim pathsize as long
dim pathnoextension as string
dim newfilepath as string
filepath = modeldoc.getpathname
pathsize = strings.len(filepath)
pathnoextension = strings.left(filepath, pathsize - 6)
newfilepath = pathnoextension & "prt"
modeldoc.saveas2 newfilepath, 0, true, false
msgbox "good, you done it"
else
msgbox "current document is not a part."
end if
else
msgbox "no active part found in solidworks."
end if
end sub
deepak gupta
sw2007 sp5.0
sw2009 sp2.1
swmodel.extension.saveas("test.prt", 0, 0, nothing, lerrors, lwarnings) |
|