AnsweredAssumed Answered

Read Sketch Dimension Macro

Question asked by Tom Strohscher on Feb 3, 2016
Latest reply on Feb 4, 2016 by Tom Strohscher

I need some help getting a dimension's value.

 

My macro will change dim1, read dim2, write dim1 and dim2 to a text file.  Then increment dim1 again.

 

This is for a part model.  The sketch can stay open.

I shouldn't need help with looping or writing to a file.  Unless someone already has it created.

 

Sub main()

Set swApp = _

Application.SldWorks

Set Part = swApp.ActiveDoc

Dim myModelView As Object

Set myModelView = Part.ActiveView

myModelView.FrameState = swWindowState_e.swWindowMaximized

Dim myAngle As Object

Dim myLength As Object

 

'select dimension and change value

Set myDimension = Part.Parameter("D1@Sketch27")

myDimension.SystemValue = 0.2094395102393

 

'Get Length...

Outcomes