AnsweredAssumed Answered

Macro to set the Measure tool options, can't get it done

Question asked by Craig Sink on Dec 30, 2016
Latest reply on Jan 4, 2017 by William Cruz

I'm attempting to create a macro that will set the options in the measure tool. It appears that the IMeasure interface is what I want to use, but it's not doing anything. Below is my code:


Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swModelDocExt As SldWorks.ModelDocExtension
Dim swMeasure As SldWorks.Measure
Dim Places As Integer
Sub main()
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    Set swModelDocExt = swModel.Extension
    Set swMeasure = swModelDocExt.CreateMeasure
    Places = 8
    MsgBox ("swMeasure Original value:" & swMeasure.AngleDecimalPlaces)
    swMeasure.AngleDecimalPlaces = Places
    swMeasure.LengthDecimalPlaces = Places
    MsgBox ("swMeasure new value:" & swMeasure.AngleDecimalPlaces)
End Sub


As you can see, I display the value before and after. The value always starts as 8, no matter if I've ran the macro before or not. And the places on the angle units are set to 3 currently.


It appears that I don't have the correct interface? Thanks for any and all assistance!