Cancel
Showing results for 
Search instead for 
Did you mean: 

ImportStyles method How to use

Experimenter
Experimenter

Hi everybody

 

I'm unsuccessfully trying to use the "ImportStyles" method.

 

What I'm trying to do is programmatically (VBA code) open a list of files that I have on a excel spreadsheet and import a view style that I have on a template document (E.G. "MyTemplate.par")

 

The SDK reference guide is lacking an example. (Or I wasn't able to find it..)

 

In the same VBA Macro I was able to open the files in the list, hide reference planes, optimize zoom, hide construction surfaces, and other "aesthetic" stuff.

 

Can someone help me with an example of VBA code that does the task?

 

Thanks.

 

Fabrizio Sanelli

1 REPLY 1

Re: ImportStyles method How to use

Experimenter
Experimenter

Found another way to obtain the same result.

 

Used the AddFromFile method: SolidEdgeFramework.ViewStyles.AddFromFile("MyFile","MyStyle")

 

My procedure:

 

  1. Open a file from the list
  2. Verify if the desired ViewSyle is already included in the ViewStyles collection
  3. If so just apply it (And refresh the view in order to see it listed in the Styles listbox)
  4. If not present import it from a template file. (And refresh the view in order to see it listed)

 

Fabrizio Sanelli