Dim ssetObj As AcadSelectionSet Dim FilterType(5) As Integer Dim FilterData(5) As Variant Dim element As AcadEntity Dim qidian(2) As Double Dim zhongdian(2) As Double
Set ssetObj = ThisDrawing.SelectionSets.Add("ssetObj")
For Each element In ssetObj If element.ObjectName = "AcDbLine" Or element.ObjectName = "AcDbPolyline" Then element.color = acBlue element.Update qidian(0) = element.startPoint(0) End If Next
以上程序为了得到选择集直线的起点终点坐标 ,但是 qidian(0) = element.startPoint(0)我却得到报错的信息,用监视器监视element.startPoint是有参数的,我测试画的都是直线
If element.ObjectName = "AcDbLine" Or element.ObjectName = "AcDbPolyline" Then element.Color = acBlue element.Update temp = element.StartPoint qidian(0) = temp(0) End If