I want user to select/assign solidworks material ever time they create New part in Solidworks.
What we've done is set up a part template that already has materials assigned & name them in a way that the material is part of the template name.
You could setup a few different Part Templates with the Material Information in the Template, so when you start a new project just pick out the correct Template and no need to select the Material..
The app I have is a good old slap upside the head if I was to require material to be assigned in the part. I just set the density properties of the part to be the most common mass of steel and or stainless steel. That covers 99% of the parts. Then the few parts that do need to be made it either gets a mass override by some users or modification of the density.
Work procedures would be how I would handle it instead of macro, if you cant follow procedures you don't need to come threw the door of the office.
I do hope that you have an extensive material library that is simpler to use than the one that comes with SolidWorks.
I have done it how the John's mentioned.
You can use this macro: Run macro on new document creation using SOLIDWORKS API with combination of Show Edit Material dialog using SOLIDWORKS API.
You will need to copy the content of the second macro into the HandlerModule of the first macro. And do minor modification. Instead of
Set swApp = Application.SldWorks Dim swModel As SldWorks.ModelDoc2 Set swModel = swApp.ActiveDoc
Sub main(swModel as SldWorks.ModelDoc2)
Set swApp = Application.SldWorks
Dim swModel As SldWorks.ModelDoc2
Set swModel = swApp.ActiveDoc
This will automatically show the Edit Material dialog everytime new part document is created. It won't work for the new virtual part created in the assembly though.
Retrieving data ...