AnsweredAssumed Answered

GetOutline→results different with  rotation or extension method

Question asked by Yong Ning on Feb 7, 2017
Latest reply on Feb 8, 2017 by Yong Ning

Follow code GetOutline ,

The results are different from the rotation method or the extension method

 

With extendsion method , Correct result

 

a1.jpga11.jpg

 

With rotation method , Incorrect result

 

 

a22.jpga2.jpg

 

 

 

 

 

 

 

 

Function DimBreakOut1(SwDraw As DrawingDoc, SwView As View, DimDepth)

  

    Dim Var, vPos, tmp, oScale

    Dim SwDim As Dimension, Depth

    Dim DnDim As Dimension, ThkDim As Dimension

    Dim lDim As Dimension

    Dim SwModel As ModelDoc2

        Set SwModel = SwView.ReferencedDocument

        Debug.Print SwModel.GetPathName

        ''

    Dim Ww, Hh

        SwDraw.ActivateView SwView.Name

        SwDraw.ForceRebuild3 True

        Var = SwView.GetOutline

        vPos = SwView.Position

        Var(2) = vPos(0) - Var(2)

        Var(3) = vPos(1) - Var(3)

        Var(0) = vPos(0) - Var(0)

        Var(1) = vPos(1) - Var(1)

        For ii = 0 To UBound(Var)

            Var(ii) = Var(ii) / SwView.ScaleDecimal

        Next ii

        With SwDraw

            tmp = .SketchRectangle(Var(0), Var(1), 0, Var(2), Var(3), 0, True)

          

        End With

End Function

Private Sub ll2()

    Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

         Set SwApp = Application.SldWorks

         Set SwModel = SwApp.ActiveDoc

    Dim SwSelMgr As SelectionMgr

         Set SwSelMgr = SwModel.SelectionManager

    Dim SwView As View

         Set SwView = SwSelMgr.GetSelectedObject5(1)

         Debug.Print SwView.Name

         DimBreakOut1 SwModel, SwView, ""

End Sub

Attachments

Outcomes