- 积分
- 652
- 明经币
- 个
- 注册时间
- 2005-4-28
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
用以下代码实现对当前模型空间中的3维多段线的选择,为什么会不成功呢?
Dim sset As AcadSelectionSet
Dim i As Integer i = ThisDrawing.SelectionSets.Count
While (i > 0) Set sset = ThisDrawing.SelectionSets.Item(i - 1) If sset.Name = "3dPLine" Then sset.Delete End If i = i - 1 Wend
'建立3维多段线选择集 Set sset = ThisDrawing.SelectionSets.Add("3dPLine")
Dim gpCode(1) As Integer Dim dataValue(1) As Variant gpCode(0) = 2 dataValue(0) = "AcDb3dPolyline" gpCode(1) = 8 dataValue(1) = "ExtrudePath" 'ExtrudePath 已经置为当前层 Dim groupCode, dataCode As Variant groupCode = gpCode dataCode = dataValue
Dim cw1, cw2 cw1 = ThisDrawing.Utility.GetPoint(, "请框选第一点:") cw2 = ThisDrawing.Utility.GetCorner(cw1, "请输入对角点:") sset.Select acSelectionSetCrossing, cw1, cw2, groupCode, dataCode
msgbox"3维多段线总共有:" & sset.count 可明明有几条3维多段线存在于ExtrudePath层上,信息提示框却总显示结果 0
问题出在什么地方了?用什么方法可以正确获得指定层上面的三维多段线呢?望各位高手指教!!
|
|