码迷,mamicode.com
首页 > 其他好文 > 详细

AutoCAD开发7--坐标转换

时间:2019-12-12 13:10:53      阅读:75      评论:0      收藏:0      [点我收藏+]

标签:auto   autocad   user   class   ble   ext   矩阵   cti   creates   

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

 

AutoCAD开发7--坐标转换

标签:auto   autocad   user   class   ble   ext   矩阵   cti   creates   

原文地址:https://www.cnblogs.com/jordonin/p/12028261.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!