本帖最后由 作者 于 2007-1-12 11:58:32 编辑
vb6编的程序如下:可是运行总是提示我Mirror有问题:无效的过程调用或参数。我希望是全自动选择后镜像,不需人干预。 '创建选择集 Dim ss As AcadSelectionSet, mode As Integer Dim Filtertype(0 To 2) As Integer, Filterdata(0 To 1) As Variant, Point1(0 To 2) As Double, Point2(0 To 2) As Double Set ss = AcadDoc.SelectionSets.Add("ztLine") '对象选择 Point1(0) = -10000: Point1(1) = 10000: Point1(2) = 0 Point2(0) = 10000: Point2(1) = -10000: Point2(2) = 0 mode = 5 '0 SelectionSetWindow;1 SelectionSetCrossing; 5 SelectionSetAll; Filtertype(0) = 8: Filterdata(0) = "主体" '8表示图层名 Filtertype(1) = 0: Filterdata(1) = "line" '0表示对象类型 ss.Select mode, Point1, Point2, Filtertype, Filterdata '选择对象经过过滤后加进新建的选择集中 '选择两个镜像线的点 Dim pnt1(0 To 2), pnt2(0 To 2) As Double pnt1(0) = 0: pnt1(1) = R: pnt1(2) = 0 pnt2(0) = 0: pnt2(1) = -R: pnt2(2) = 0 '进行镜像 Dim ent As AcadEntity If ss.Count > 0 Then For Each ent In ss ent.Mirror pnt1, pnt2 '无效的过程调用或参数。 Next End If 请问错在哪里?谢谢了。 |