AnsweredAssumed Answered

Macro to change grams to kilograms in part and assembly models?

Question asked by Mark Mahaffey on Feb 19, 2015
Latest reply on Feb 20, 2015 by Keith Rice

I have a macro that will accomplish my task in each individual file but now I need it to run through a batch of files in a specified folder using task scheduler and i'm lost as to how to customize my macro to do this.  If you can help I would really appreciate it.  Below is what I have now.

 

Dim swApp As Object

 

 

Dim Part As Object

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long

 

 

Sub main()

 

 

Set swApp = _

Application.SldWorks

 

 

Set Part = swApp.ActiveDoc

Dim myModelView As Object

Set myModelView = Part.ActiveView

myModelView.FrameState = swWindowState_e.swWindowMaximized

boolstatus = Part.Extension.SetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swUnitsMassPropMass, 0, swUnitsMassPropMass_e.swUnitsMassPropMass_Kilograms)

End Sub

 

 

Thanks again for any help you might can provide.

 

Mark

Outcomes