1 Reply Latest reply on Dec 5, 2016 6:55 AM by Deepak Gupta

    How to Align Dimension with API ?

    Yong Ning

      AlignHorz don't Align dimension?

       

      2.jpg

       

       

      Private Sub ll()

         Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

             Set SwApp = Application.SldWorks

             Set SwModel = SwApp.ActiveDoc

         Dim SwDraw As DrawingDoc

             Set SwDraw = SwModel

             ''

             tmp = SwModel.Extension.SelectByID2("l1@Sketch@底板F-1@底板F主视图", "DIMENSION", 0#, 0#, 0, True, 0, Nothing, 0)

             tmp = SwModel.Extension.SelectByID2("l2@Sketch@底板F-1@底板F主视图", "DIMENSION", 0#, 0#, 0, True, 0, Nothing, 0)

             tmp = SwModel.Extension.SelectByID2("D1@Delta1@底板F-2@底板F左视图", "DIMENSION", 0#, 0#, 0, True, 0, Nothing, 0)

          

             ''SwModel.AlignDimensions

             SwDraw.AlignHorz

             SwDraw.AlignVert

             Stop

      End Sub