3 Replies Latest reply on Nov 19, 2017 4:30 PM by Nilesh Patel

    Driving dimension tolerance of part from excel

    Sf Ssfg

      Hello all,

      I would like to ask you about driving dimmension tolerance of part from excel.

      I have simple part (block) with 3 dimmension and excel table with 3 rows and macro.  This macro easily insert value from excel cell to solidworks dimmension.

       

      Private Sub CommandButton1_Click()

      Dim swApp As SldWorks.SldWorks

      Set swApp = CreateObject("SldWorks.Application")

      swApp.Visible = True

      Set Part = swApp.ActiveDoc

      Part.Parameter("a@Sketch1@box.part").SystemValue = Excel.Range("B2") / 1000

      Part.Parameter("b@Sketch1@box.part").SystemValue = Excel.Range("B3") / 1000

      Part.Parameter("D1@Boss-Extrude1@box.part").SystemValue = Excel.Range("B4") / 1000

      Part.EditRebuild

      Part.ClearSelection

      End Sub

       

      This part is working fine, but I would like to driving dimmension tolerance (symmetric, bilateral) from excel somehow.

      Is there any way how to do it?

       

      Simply example in attachment (excel, solidworks part).

       

      Thank you

       

      edit:

       

      Final solution in attachment