[已解决][求助]用选择集选定一条直线后,怎么得出该直线的始终点坐标?
本帖最后由 作者 于 2009-4-7 19:38:51 编辑 <br /><br /> <p>用选择集选定一条直线后,怎么得出该直线的始终点坐标?,这两天为了这个都想破脑袋了都没弄出来,谢谢大家的帮忙。</p><p></p><p>问题已经解决了,谢谢zzyong00,十分感谢。</p> <p>仔细看看对象模型的帮助</p> Public Sub ss()Dim objSset As AcadSelectionSet
Randomize
Set objSset = ThisDrawing.SelectionSets.Add("adf" & Rnd())
Dim gpCode(0) As Integer
Dim dataValue(0) As Variant
gpCode(0) = 0
dataValue(0) = "Line"
Dim groupCode As Variant, dataCode As Variant
groupCode = gpCode
dataCode = dataValue
objSset.SelectOnScreen groupCode, dataCode
Dim objL As AcadLine
For Each objL In objSset
Debug.Print objL.StartPoint(0), objL.StartPoint(1), objL.StartPoint(2)
Debug.Print objL.EndPoint(0), objL.EndPoint(1), objL.EndPoint(2)
Next
End Sub
<p>谢谢你们两位,特别是楼上的,我马上去试试</p>
页:
[1]