×
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

Options

Options

Options

(OP)
How do I change the options I get with someone else's part or assembly or drawing too for that matter, to the options I have set for myself?  I know there must be a way to do this, but I can't seem to find it.  Thanks.

RE: Options

As far as I know, we do not yet have a toggle button to switch a document's settings to your default template settings (but it would be nice).  So for now, you need to go into Tools -> Options and set all the document parameters manually.


Jeff Mowry
DesignHaus Industrial Design
http://www.designhaus-i-d.com

RE: Options

If you are talking internal files, make sure all employees are using the same templates for parts, drawings and assemblies.

MadMango
"Probable impossibilities are to be preferred to improbable possibilities."
Have you read FAQ731-376 to make the best use of Eng-Tips Forums?

RE: Options

(OP)
I am talking about a model or drawing I get from a client who has any number of templates, etc.  Each engineer kinda has his own set up.  These engineers don't get into a lot of standardization among themselves & you can see all kinds of template settings.  That is why I would like to change the incoming files to my standards, because there are too many options to change by hand.  The clients usually are one of a kind fixtures or parts that stay locally with them.  Confused?  Me too!

RE: Options

you could do it with a program...

If you have any experience with VB...

Go to Help (in SW) and click: "SolidWorks API Help Topics"

look up:

ModelDoc2::GetUserPreferenceToggle
ModelDoc2::SetUserPreferenceToggle

ModelDoc2::GetUserPreferenceDoubleValue
ModelDoc2::SetUserPreferenceDoubleValue

ModelDoc2::GetUserPreferenceIntegerValue
ModelDoc2::SetUserPreferenceIntegerValue

ModelDoc2::GetUserPreferenceStringValue
ModelDoc2::SetUserPreferenceStringValue

ModelDoc2::GetUserPreferenceTextFormat
ModelDoc2::SetUserPreferenceTextFormat


Basically what you want to do is Open 2 documents...
Get a property from one document and Set it to the other document.

You can start the program off by recording a macro...

Click: Tools>Macro>Record
...Open 2 documents, then close them...
Stop the macro, and Save it to your hard drive...
Then Click: Tools>Macro>Edit...
And select the file you just saved...

your macro should look similar to this:
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:\File1.SLDPRT", 1, 0, "", longstatus)
Set Part = swApp.ActivateDoc("_01 test grid.SLDPRT")
swApp.ActiveDoc.ActiveView.FrameLeft = 0
swApp.ActiveDoc.ActiveView.FrameTop = 0
swApp.ActiveDoc.ActiveView.FrameState = 1
swApp.ActiveDoc.ActiveView.FrameState = 1
swApp.ActiveDoc.ActiveView.FrameState = 1
swApp.LoadFile2 "C:\File2.SLDPRT", ""
Set Part = swApp.ActiveDoc
Set Part = swApp.OpenDoc4("C:\File2.SLDPRT", 1, 0, "", longstatus)
swApp.ActiveDoc.ActiveView.FrameLeft = 0
swApp.ActiveDoc.ActiveView.FrameTop = 0
swApp.ActiveDoc.ActiveView.FrameState = 1
Set Part = swApp.ActivateDoc("File2.SLDPRT")
Set Part = Nothing
swApp.CloseDoc "File2.SLDPRT"
swApp.ActiveDoc.ActiveView.FrameLeft = 0
swApp.ActiveDoc.ActiveView.FrameTop = 0
swApp.ActiveDoc.ActiveView.FrameState = 1
Set Part = swApp.ActivateDoc("File1.SLDPRT")
Set Part = Nothing
swApp.CloseDoc "_01 test grid.SLDPRT"
End Sub


Now what you want to do is make it to where each part is assigned to a seperate object...

Change:
Dim Part As Object
...To...
Dim Part As Object, Part2 As Object

Set Part = swApp.OpenDoc4("C:\File2.SLDPRT", 1, 0, "", longstatus)
...To...
Set Part2 = swApp.OpenDoc4("C:\File2.SLDPRT", 1, 0, "", longstatus)

Set Part = swApp.ActivateDoc("File2.SLDPRT")
Set Part = Nothing
...To...
Set Part2 = swApp.ActivateDoc("File2.SLDPRT")
Set Part2 = Nothing

Then you can place your preference commands between...

swApp.ActiveDoc.ActiveView.FrameState = 1
Set Part = swApp.ActivateDoc("File1.SLDPRT")
...and...
Set Part = Nothing
swApp.CloseDoc "_01 test grid.SLDPRT"

If this is too confusing, just post your questions here...

Thanks,
--Josh--

RE: Options

(OP)
Thanks Stoker.  I will try that.  I don't do VB, so this may work out fine.  Thanks again for all  answers.

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