[讨论]Select acSelectionSetCrossing的奇怪想象!
有这样一段代码(其中objline 是存在的一条三维多段线):Dim endpoint1(0 To 2) As Double<BR>Dim endpoint2(0 To 2) As Double<BR>Dim coord1 As Variant<BR>Dim coord2 As Variant
'获得该三维多段线的的第一点和第三点
coord1 = objline.Coordinate(0)<BR>coord2 = objline.Coordinate(3)
endpoint1(0) = coord1(0): endpoint1(1) = coord1(1): endpoint1(2) = coord1(2)<BR>endpoint2(0) = coord2(0): endpoint2(1) = coord2(1): endpoint2(2) = coord2(2)<BR>objline.Delete
dim gpcode(1) as integer
dim datavalue(1) as variant
<BR>gpcode(0) = 0<BR>datavalue(0) = "line"
gpcode(1) = 8<BR>datavalue(0) = "0"
setb.Select acSelectionSetCrossing, endpoint1, endpoint2, gpcode, datavalue
setb.erase
可运行的时候并没有将0层里面的直线清空啊!!
是不是Select acSelectionSetCrossing的点参数不能够是直接给的点,而必须是用户框选某些对象时获得的点呢? 个人认为,首先你的过录器变量类型不对。再一个你用的交叉选择不可能把整层的要素删除。要清空0层的直线用带过录器的全选就可以了。
dim gpcode(1) as integer
dim datavalue(1) as variant
dim groupcode as variant
dim groupvalue as variant
<BR>gpcode(0) = 0<BR>datavalue(0) = "line"
gpcode(1) = 8<BR>datavalue(0) = "0"
groupcode = gpcode:groupvalue = datavalue
setb.Select acSelectionSetAll,,, groupcode, datavalue
setb.erase 首先感谢2楼的热情回答,但这里我想知道的是
Select acSelectionSetCrossing的点参数是否可以是直接给的点,而不一定必须是用户框选某些对象时获得的点! 可以
页:
[1]