Macro to set material props for part file?

Discussion in 'SolidWorks' started by Sam, Jul 24, 2006.

  1. Sam

    Sam Guest

    Does anyone have a VB example of how to set the material properties
    for a part file? Specifically I want to set the Area/Hatch Fill option
    to None for over 100 part files and would really like to do that with a
    macro rather than manually. I am a novice at programming but if someone
    could provide an example I think I could take it from there.

    Thanks,

    Sam
     
    Sam, Jul 24, 2006
    #1
  2. Sam

    Craig Guest

    Dim swApp As Object
    Dim Part As Object
    Dim boolstatus As Boolean
    Dim longstatus As Long, longwarnings As Long
    Dim FeatureData As Object
    Dim Feature As Object
    Dim Component As Object
    Sub main()

    Set swApp = Application.SldWorks

    Set Part = swApp.ActiveDoc
    Part.SetUserPreferenceStringValue swMaterialPropertyCrosshatchPattern,
    "None"
    End Sub
     
    Craig, Jul 24, 2006
    #2
  3. Sam

    Sam Guest

    Thanks Craig, it looks like this worked great.

    Sam
     
    Sam, Jul 24, 2006
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.