为什么我不能读取选择集的参数
Dim ssetObj As AcadSelectionSet<BR> Dim FilterType(5) As Integer<BR> Dim FilterData(5) As Variant<BR> Dim element As AcadEntity<BR> Dim qidian(2) As Double<BR> Dim zhongdian(2) As DoubleSet ssetObj = ThisDrawing.SelectionSets.Add("ssetObj")<BR> <BR> FilterType(0) = -4<BR> FilterData(0) = "<or"<BR> FilterType(2) = 8<BR> FilterData(2) = "0"<BR> FilterType(3) = 0<BR> FilterData(3) = "Line"<BR> FilterType(4) = 0<BR> FilterData(4) = "Polyline"<BR> FilterType(5) = -4<BR> FilterData(5) = "or>"
ssetObj.SelectOnScreen FilterType, FilterData<BR> <BR> For Each element In ssetObj<BR> If element.ObjectName = "AcDbLine" Or element.ObjectName = "AcDbPolyline" Then<BR> element.color = acBlue<BR> element.Update<BR> qidian(0) = element.startPoint(0)<BR> End If<BR> Next
以上程序为了得到选择集直线的起点终点坐标 ,但是 qidian(0) = element.startPoint(0)我却得到报错的信息,用监视器监视element.startPoint是有参数的,我测试画的都是直线 If element.ObjectName = "AcDbLine" Or element.ObjectName = "AcDbPolyline" Then<BR> element.Color = acBlue<BR> element.Update<BR> temp = element.StartPoint<BR> qidian(0) = temp(0)<BR> End If<BR> temp改设为数组么,还是什么变量呢? 我把temp设置为acadpoint
然后按你说的写,可是出的错误是
错误“91”,对变量或with块变量未设置 dim temp
设置为变体 谢谢!!!!
页:
[1]