AutoCAD开发7--坐标转换

Dim dx As Double

    Dim dy As Double

    Dim arf As Double

    Dim m As Double

   

 Dim r(0 To 3, 0 To 3) As Double

  '旋转矩阵

    r(0, 0) = m * Math.Cos(arf): r(0, 1) = -m * Math.Sin(arf): r(0, 2) = 0: r(0, 3) = dx

    r(1, 0) = m * Math.Sin(arf): r(1, 1) = m * Math.Cos(arf): r(1, 2) = 0: r(1, 3) = dy

    r(2, 0) = 0: r(2, 1) = 0: r(2, 2) = m: r(2, 3) = 0

    r(3, 0) = 0: r(3, 1) = 0: r(3, 2) = 0: r(3, 3) = 1

 

    Dim pSlct As AcadSelectionSet

    Set pSlct = CreateSelectionSet

   

    UserForm1.Hide

   

    pSlct.SelectOnScreen

   

    Dim pObject As Object

   

    For Each pObject In pSlct


        pObject.TransformBy (r)
    Next pObject

 

posted on 2019-12-12 11:39  Lzhm216  阅读(397)  评论(0编辑  收藏  举报

导航