明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1466|回复: 3

如何从固定点到当前鼠标的位置画一条多段线

[复制链接]
发表于 2004-2-23 11:54:00 | 显示全部楼层 |阅读模式
请教各位大哥,如何从一个固定点到当前的鼠标的位置画一条多段线?谢谢指教!
 楼主| 发表于 2004-2-23 12:02:00 | 显示全部楼层
如果要画一条从固定点到当前鼠标位置的多段线,并且让它随着鼠标的移动而变化,该怎磨办?
发表于 2004-2-23 12:27:00 | 显示全部楼层
Sub ll()
Dim p1(0 To 2) As Double
Dim p2 As Variant
Dim pntobj As Variant Dim lobj As AcadLine p1(0) = 100
p1(1) = 100
p1(2) = 0 p2 = ThisDrawing.Utility.GetPoint(p1, "p2") Set lobj = ThisDrawing.ModelSpace.AddLine(p1, p2) End Sub
发表于 2004-2-23 12:30:00 | 显示全部楼层
呵呵,没看清楚,上面那个是直线,这个才是多段线 Sub ll()
Dim p1(0 To 2) As Double
Dim p2 As Variant
Dim pntobj As Variant Dim lobj As AcadLWPolyline
Dim vers(0 To 3) As Double 'p1(0) = 100
'p1(1) = 100
'p1(2) = 0 p2 = ThisDrawing.Utility.GetPoint(p1, "p2") vers(0) = 100
vers(1) = 100
vers(2) = p2(0)
vers(3) = p2(1) Set lobj = ThisDrawing.ModelSpace.AddLightWeightPolyline(vers) End Sub
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-28 08:51 , Processed in 0.169131 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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