Macro material base option

Hello

 

I'm looking for the command line to add the path to the material base and textures in the solidworks options?

Do you have an idea?

 

Thank you in advance for your feedback

 

Yannick

 

Hello

Why do you need to add your material bases by macro? Wouldn't it be easier to configure them in your options and possibly create a restore file?

2 Likes

Hello Rpicard,

I need to set the path of the material database on about thirty workstations and I want to impose a specific material base because some people don't use the right one.

Hence my need to do it via a macro.

yannick

Hello YP69.

 

Here is what I found in the help: 

For File Location System Option call actions:

http://help.solidworks.com/2018/english/api/swconst/SO_FileLocations.htm

This gives, for the materials :

(swUserPreferenceStringValue_e.swFileLocationsMaterialDatabases, <Value>)

 

For the method:

http://help.solidworks.com/2018/english/api/sldworksapi/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.ISldWorks~GetUserPreferenceStringValue.html

 

These are exceptional and very specific requests, I don't think you'll find a macro already written, but you should find what you're looking for.

2 Likes

 @YP69

Precisely with the restore file, the 30 workstations could have the same paths. That said, if each of the stations uses different paths on other libraries, I understand the usefulness of the macro. 

1 Like

I don't want to use the restoration files because the workstations don't all use the same part  templates and others....