问题出在哪里了?请指教!!!!
<FONT size=1>用以下代码实现对当前模型空间中的3维多段线的选择,为什么会不成功呢?</FONT><FONT size=1>Dim sset As AcadSelectionSet</FONT>
<FONT size=1>Dim i As Integer<BR>i = ThisDrawing.SelectionSets.Count</FONT>
<FONT size=1>While (i > 0)<BR>Set sset = ThisDrawing.SelectionSets.Item(i - 1)<BR>If sset.Name = "3dPLine" Then<BR>sset.Delete<BR>End If<BR>i = i - 1<BR>Wend</FONT>
<FONT size=1>'建立3维多段线选择集<BR>Set sset = ThisDrawing.SelectionSets.Add("3dPLine")</FONT>
<FONT size=1>Dim gpCode(1) As Integer<BR>Dim dataValue(1) As Variant<BR>gpCode(0) = 2<BR>dataValue(0) = "AcDb3dPolyline"<BR>gpCode(1) = 8<BR>dataValue(1) = "ExtrudePath" 'ExtrudePath 已经置为当前层<BR>Dim groupCode, dataCode As Variant<BR>groupCode = gpCode<BR>dataCode = dataValue</FONT>
<FONT size=1>
<BR>Dim cw1, cw2<BR>cw1 = ThisDrawing.Utility.GetPoint(, "请框选第一点:")<BR>cw2 = ThisDrawing.Utility.GetCorner(cw1, "请输入对角点:")<BR>sset.Select acSelectionSetCrossing, cw1, cw2, groupCode, dataCode
msgbox"3维多段线总共有:" & sset.count<BR>可明明有几条3维多段线存在于ExtrudePath层上,信息提示框却总显示结果 0
问题出在什么地方了?用什么方法可以正确获得指定层上面的三维多段线呢?望各位高手指教!!
</FONT> <FONT size=1>gpCode(0) = 0<BR>dataValue(0) = "Polyline"</FONT> <FONT size=1>gpCode(0) = 2应该是gpCode(0) = 0<BR></FONT><BR> 谢谢大家的热情回复!可运行结果还是一样啊! 可以用objectName作为过滤条件的,当然<A name=27693><FONT color=#990000><B>lzh741206</B></FONT></A>和<A name=27694><FONT color=#000066><B>ljpnb</B></FONT></A>说的也可以,之所以无法选择是因为我用了<FONT size=1>sset.Select acSelectionSetCrossing, cw1, cw2, groupCode, dataCode进行了选择.用以下语句进行就可以得到正确的运行结果了!</FONT>
sset.SelectOnScreen gpcode, datavalue
<FONT size=1></FONT>
页:
[1]