Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API File Type Preferences (For Different File Versions Outputs) 1

Status
Not open for further replies.

MaxbyMike

Mechanical
Jun 18, 2001
17
0
0
CA
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.
Code:
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
[\code]
This is suppose to output a ACIS File Ver.1.6

Can Any one Help?
Thanks
Mike Pacholski (mikepacholski@hotmail.com)
 
Replies continue below

Recommended for you

Mike

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
 
Status
Not open for further replies.
Back
Top