saving to parasolid
saving to parasolid
(OP)
I am trying to write a macro that will take the current solid part I am working with export it to a file with a new name based on the original name, a custom revision field, and a Custom description. I have the code able to compile the filename and path as I want but cannot get it to export the file. The statement I am using is from the help example:
bRet = swPart.SaveAs4(sPathName, _
swSaveAsCurrentVersion, _
swSaveAsOptions_Silent, _
nErrors, _
nWarnings)
the pathname I am entering is, for example:
C:\RD-1020 Rev X4 HOUSING-TRANSMISSION.x_t
When I run the file it does nothing. If I change the extension to .sldprt or .tif then it will save the file. I am using sw 2004 sp 2.1 and no I cannot upgrade. The documentation states that if you put the extension in this command should automatically do the conversion to the extension, but when I put in either .x_t or .igs nothing happens. Can someone help me figure this out.
I checked out FAQ559-530 but did not see anything that helped solve my problem.
bRet = swPart.SaveAs4(sPathName, _
swSaveAsCurrentVersion, _
swSaveAsOptions_Silent, _
nErrors, _
nWarnings)
the pathname I am entering is, for example:
C:\RD-1020 Rev X4 HOUSING-TRANSMISSION.x_t
When I run the file it does nothing. If I change the extension to .sldprt or .tif then it will save the file. I am using sw 2004 sp 2.1 and no I cannot upgrade. The documentation states that if you put the extension in this command should automatically do the conversion to the extension, but when I put in either .x_t or .igs nothing happens. Can someone help me figure this out.
I checked out FAQ559-530 but did not see anything that helped solve my problem.






RE: saving to parasolid
Try a shorter filename.
Importing Parasolid files into UG would fail if there was a space in the filename or directory path.
"Wildfires are dangerous, hard to control, and economically catastrophic."
Ben Loosli
Sr IS Technologist
L-3 Communications
RE: saving to parasolid
RE: saving to parasolid
Jeff Mowry
www.industrialdesignhaus.com
Reason trumps all. And awe trumps reason.
RE: saving to parasolid
RE: saving to parasolid
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
RE: saving to parasolid
Sub main()
Dim swApp As SldWorks.SldWorks
Dim swPart As SldWorks.ModelDoc2
Dim sPathName As String
Dim nRetVal As Long
Dim nErrors As Long
Dim nWarnings As Long
Dim bRet As Boolean
Set swApp = Application.SldWorks
Set swPart = swApp.ActiveDoc
bRet = swApp.SetUserPreferenceIntegerValue(swParasolidOutputVersion, 7)
If bRet = False Then
Debug.Print "swApp Parasolid Version : " + Str(swApp.GetUserPreferenceIntegerValue(swParasolidOutputVersion))
nRetVal = swApp.SendMsgToUser2("sw App Did not Set output Version", swMbWarning, swMbOk)
End If
bRet = swPart.SetUserPreferenceIntegerValue(swParasolidOutputVersion, 7)
If bRet = False Then
Debug.Print "swPart Parasolid Version : " + Str(swPart.GetUserPreferenceIntegerValue(swParasolidOutputVersion))
nRetVal = swApp.SendMsgToUser2("Did not Set output Version", swMbWarning, swMbOk)
End If
sPathName = "c:\test.xmt_txt"
bRet = swPart.SaveAs4(sPathName, _
swSaveAsCurrentVersion, _
swSaveAsOptions_Silent, _
nErrors, _
nWarnings)
If bRet = False Then
nRetVal = swApp.SendMsgToUser2("Problems Saving File.", swMbWarning, swMbOk)
End If
Debug.Print sPathName
End Sub