Macro Smartproperties

Hello

By modifying the "SmartProperties 2014-Auto.swp" macro I would like that when we are in an assembly, the smart can select the components to follow, i.e. without the need to select and highlight them to make the smart.

My question is: "How can we write in the macro, that we want to select all the files displayed in the feature manager of the assembly?"

Thank you in advance.


smartproperties_2014-auto.swp

Hello

There's an example here:

http://help.solidworks.com/2012/english/api/sldworksapi/Select_All_in_Part_Assembly_or_Drawing_Example_vb.htm

Instructions to use to select everything in an assembly:

Set swModel = swApp.OpenDoc6(assemblyFile, swDocASSEMBLY, swOpenDocOptions_Silent, "", errors, warnings)

 

Set swModelDocExt = swModel.Extension

 

Set swSelMgr = swModel.SelectionManager

 

swModelDocExt.SelectAll  

 

Hello

I tried to modify the macro, using your selection tips, but unfortunately it doesn't want to work. My knowledge is very limited in VB, I think it's a problem in writing the macro.

I always continue to select only the highlighted component.

Kind regards.

If you test the full macro here:

http://help.solidworks.com/2012/english/api/sldworksapi/Select_All_in_Part_Assembly_or_Drawing_Example_vb.htm

 

Does it work?

If not, is there an error message? Which line is the error? 

Hello

Sorry for this lack of responsiveness.... But finally I got around my problem by creating a macro to automatically save the properties on the file opened by Solidworks.

Thank you for your advice....   .PL

See you soon probably for new questions.

1 Like