明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1672|回复: 2

关于图形旋转的问题啊

[复制链接]
发表于 2007-3-12 09:37:00 | 显示全部楼层 |阅读模式

关于图形旋转的问题啊

我想用旋转命令将一个图形绕一个基点旋转一个角度

在VBA中怎样实现啊???

谢谢各位DX

发表于 2007-3-12 09:49:00 | 显示全部楼层
<pre class="Code">Sub Example_Rotate()
    ' This example creates a lightweight polyline
    ' and then rotates that polyline.
   
    ' Create the polyline
    Dim plineObj As AcadLWPolyline
    Dim points(0 To 11) As Double
    points(0) = 1: points(1) = 2
    points(2) = 1: points(3) = 3
    points(4) = 2: points(5) = 3
    points(6) = 3: points(7) = 3
    points(8) = 4: points(9) = 4
    points(10) = 4: points(11) = 2
    Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
    plineObj.Closed = True
    ZoomAll
            
    MsgBox "Rotate the polyline by 45 degrees.", , "Rotate 示例"
   
    ' Define the rotation
    Dim basePoint(0 To 2) As Double
    Dim rotationAngle As Double
    basePoint(0) = 4: basePoint(1) = 4.25: basePoint(2) = 0
    rotationAngle = 0.7853981   ' 45 degrees
   
    ' Rotate the polyline
    plineObj.Rotate basePoint, rotationAngle
   
    ZoomAll
    MsgBox "Rotation completed.", , "Rotate 示例"
   
End Sub</pre>
 楼主| 发表于 2007-3-12 10:18:00 | 显示全部楼层
谢谢,我先下来看看
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-2-22 18:57 , Processed in 0.184406 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表