×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

API File Type Preferences (For Different File Versions Outputs)

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)

RE: API File Type Preferences (For Different File Versions Outputs)

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

RE: API File Type Preferences (For Different File Versions Outputs)

(OP)
A better part of a day spent Banding my head solved in minutes.
Thanks
Mike

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources