AnsweredAssumed Answered

Check edge colour and change

Question asked by Eric Jacobson on Jul 26, 2018
Latest reply on Jul 26, 2018 by Eric Jacobson

Hi, all!

 

I'm trying to write a macro where I can hit a key, the macro will check my edge colour and, if black, change it to blue, and if blue, change it back to black.

 

I'm obviously pretty new at this. Id appreciate some help pointing me in the right direction.

 

This is what I have so far:

 

 

 

Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc

 

 

 

 

'Check if Blue

While boolstatus = swApp.SetUserPreferenceIntegerValue(swUserPreferenceIntegerValue_e.swSystemColorsSurfacesOpenEdge, 16744448)

    boolstatus = swApp.SetUserPreferenceIntegerValue(swUserPreferenceIntegerValue_e.swSystemColorsSurfacesOpenEdge, 0)

    Wend

    'Now black, redirect

        GoTo line1

'Check if black

While boolstatus = swApp.SetUserPreferenceIntegerValue(swUserPreferenceIntegerValue_e.swSystemColorsSurfacesOpenEdge, 0)

    boolstatus = swApp.SetUserPreferenceIntegerValue(swUserPreferenceIntegerValue_e.swSystemColorsSurfacesOpenEdge, 16744448)

    Wend

   

line1:

      boolstatus = Part.EditRebuild3()

End Sub

Outcomes