求助啊?????
Public Sub mi(ss As AcadSelectionSet, x1, y1, x2, y2) ''''''''''''''选择集镜像<BR> Dim p1(2) As Double, p2(2) As Double<BR> p1(0) = x1: p1(1) = y1: p1(2) = 0<BR> p2(0) = x2: p2(1) = y2: p2(2) = 0<BR> Dim ent As AcadEntity<BR> If ss.Count > 0 Then<BR> For Each ent In ss<BR> ent.Mirror p1, p2<BR> Next<BR> End If<BR> <BR>End SubPrivate Sub drawline(x1 As Double, y1 As Double, x2 As Double, y2 As Double, lay As String) '用指定层画直线<BR> Dim first(0 To 2) As Double, scond(0 To 2) As Double<BR> Dim lineobj As AcadLine<BR> first(0) = x1: first(1) = y1: first(2) = 0<BR> scond(0) = x2: scond(1) = y2: scond(2) = 0<BR> Set lineobj = acaddoc.ModelSpace.AddLine(first, scond)<BR> lineobj.Layer = lay<BR> <BR>End Sub
sub mir()'''''''对选择的线条进行镜象操作<BR> Set cen = acaddoc.ModelSpace.AddLine(p1, p2)<BR> cen.Layer = "3"<BR>drawline (边梁翼缘宽 - 边梁腹板厚) / 2, 0, (边梁翼缘宽 - 边梁腹板厚) / 2, 单节长度, "4"<BR> Dim sset As AcadSelectionSet<BR> Dim po(2) As Double<BR> po(0) = 边梁翼缘宽 - 边梁腹板厚) / 2: po(1) = 0: po(2) = 0<BR> Set sset = acaddoc.SelectionSets.Add("1")<BR> sset.SelectAtPoint po''''''''''''''''''''''''''''''''''''''''选择要镜象的直线<BR> mi sset, 边梁翼缘宽 * 2, 0, 边梁翼缘宽 * 2, 单节长度<BR>End Sub
就是搞不懂为什么通过选择定义的点"po(2)为坐标数组" 的直线进行镜象操作没有反映啊?????????????????????????????????????????????????????????
敬请各位高手指正!!!!谢谢!!!! 程序是你写的吗?<BR>1.程序中画线部分的坐标排列是X1、Y1、X2、Y2,在你给的值中,明显PO的X、Y坐标给的是X1和Y1的值。这样的活,选择集中就是没有对象的,因为你所在的点没有对象。<BR>2.程序思路有问题:<BR>画线没有必须再写个函数吧,用AddLine方法本来就非常简单。<BR>画完线后,本身就可以得到这个线对象,而不需要再用选择集去选,选择集的使用主要是让用户在屏幕上选对象。
页:
[1]