Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Options

Status
Not open for further replies.

WDickman

Mechanical
Nov 6, 2002
20
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.
 
Replies continue below

Recommended for you

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
 
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?
 
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!
 
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:
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:\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--
 
No problem. Go to and download the copy options routine at
What you will get is an excel file which can import and export document options for SolidWorks files. Run the import routine with your desired template files and then you can write out all of the options to the active SolidWorks document.
 
Thanks Stoker. I will try that. I don't do VB, so this may work out fine. Thanks again for all answers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor