明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 736|回复: 2

高手快来看。

[复制链接]
发表于 2012-12-4 10:55:35 | 显示全部楼层 |阅读模式
我想画一条线段,如何得到以此线段为对角点的矩形的左下角点?
 楼主| 发表于 2012-12-4 11:07:42 | 显示全部楼层
pt1 = ThisDrawing.Utility.GetPoint(, "选取矩形第一角点:")
pt2 = ThisDrawing.Utility.GetCorner(pt1, "选取矩形对角点:")
   
Dim plineObj As AcadLWPolyline
Dim points1(0 To 9) As Double
'轻便多义线各顶点的2d坐标;
          points1(0) = pt1(0): points1(1) = pt1(1)
          points1(2) = pt2(0): points1(3) = pt1(1)
          points1(4) = pt2(0): points1(5) = pt2(1)
          points1(6) = pt1(0): points1(7) = pt2(1)
          points1(8) = pt1(0): points1(9) = pt1(1)
Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points1)
   
If pt1(0) > pt2(0) Then
pt(0) = pt2(0)
Else
pt(0) = pt1(0)
End If


If pt1(1) > pt2(1) Then
pt(1) = pt2(1)
Else
pt(1) = pt1(1)
End If



a = Abs(pt1(0) - pt2(0))
b = Abs(pt1(1) - pt2(1))
pt = FstPnt
c = Val(ComboBox1.Text)
d = Val(ComboBox2.Text)


TextBox5.Text = pt(0)

<TextBox5.Text 没有数据>
发表于 2012-12-4 12:43:31 | 显示全部楼层
wjl???????
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-25 14:20 , Processed in 0.172414 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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