哪有没这么复杂的?建立选择集有acSelectionSetFence方式的
'起点 FromPnt = ThisDrawing.Utility.GetPoint(, vbCrLf & "扯旗线起点: ") If err Then err.Clear End End If '终点 Topnt = ThisDrawing.Utility.GetPoint(FromPnt, vbCrLf & "扯旗线终点: ") If err Then err.Clear End End If
'画标注线 Set LineObj = ThisDrawing.ModelSpace.AddLine(FromPnt, Topnt) '与标注线相交的线段组成选择集 Set ssetobj = CreateSelectionSet("ObjSet") mode = acSelectionSetFence pointsArray(0) = FromPnt(0): pointsArray(1) = FromPnt(1): pointsArray(2) = 0 pointsArray(3) = Topnt(0): pointsArray(4) = Topnt(1): pointsArray(5) = 0 gpCode(0) = 0: dataValue(0) = "LINE" ssetobj.SelectByPolygon mode, pointsArray, gpCode, dataValue
|