API File Type Preferences (For Different File Versions Outputs)
API File Type Preferences (For Different File Versions Outputs)
(OP)
Hello, I have been trying to control ACIS file output version using the API functions. I was trying to use the SldWorks::SetUserPreferenceIntegerValue (userPreferenceValue, value) where the userPreferenceValue describes which preference you want to change. Has any one used these before, I am haveing a hard time getting them to work.I tried something like.
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long
Dim Annotation As Object
Dim Gtol As Object
Dim DatumTag As Object
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Sub main()
Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.OpenDoc4("C:\VB\file.SLDASM", 2, 0, "", longstatus)
Set Part = swApp.ActivateDoc("file.SLDASM")
swApp.SetUserPreferenceIntegerValue (swAcisOutputVersion, 1)
Part.SaveAs "c:\OUT\fileacis.sat"
End Sub
This is suppose to output a ACIS File Ver.1.6
Can Any one Help?
Thanks
Mike Pacholski (mikepacholski@hotmail.com)
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long
Dim Annotation As Object
Dim Gtol As Object
Dim DatumTag As Object
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Sub main()
Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.OpenDoc4("C:\VB\file.SLDASM", 2, 0, "", longstatus)
Set Part = swApp.ActivateDoc("file.SLDASM")
swApp.SetUserPreferenceIntegerValue (swAcisOutputVersion, 1)
Part.SaveAs "c:\OUT\fileacis.sat"
End Sub
This is suppose to output a ACIS File Ver.1.6
Can Any one Help?
Thanks
Mike Pacholski (mikepacholski@hotmail.com)






RE: API File Type Preferences (For Different File Versions Outputs)
I have looked at your file, to make it work I had to do two things:-
1. Include swconst.bas into my program. You may have already done this I cannot tell from your post.
swconst.bas is a file that contains all the solidworks constants such as SetUserPreferenceIntegerValue all you need to do is select insert file and select the file swconst.bas. This file may not be on your system, if not you can download it from the SW web site. You may wish to download it anyway, the most up to date version is on the web.
2. I removed the brackets from the line
swApp.SetUserPreferenceIntegerValue swAcisOutputVersion, 1
I have run this program and changed the asic output version by changing the number.
Regards
Kevin
kevin@ketd.co.uk
RE: API File Type Preferences (For Different File Versions Outputs)
Thanks
Mike