以下代码:
Dim P1(0 To 2), P2(0 To 2) As Double P1(0) = -50: P1(1) = -50: P1(2) = 0 P2(0) = 50: P2(1) = 50: P2(2) = 0 UserForm1.Hide Dim ss As AcadSelectionSet On Error Resume Next Set ss = ThisDrawing.SelectionSets("pline") If Err Then Set ss = ThisDrawing.SelectionSets.Add("pline") ss.Clear ss.SelectOnScreen Dim entry As AcadEntity For Each entry In ss entry.Color = acBlue entry.Update Next entry
上面的代码是可以正常执行的,但是我将ss.SelectOnScreen改为ss.Select acSelectionSetCrossing, P1, P2 并在P1、P2的矩形框区内画了许多东西但就是选择不到图元,这是怎么回事?
如果知道某图或块在某个区域,通过代码去自动选择,用上面的代码不行吗?该怎么做呢?谢谢! |