求助啊??难了我好几天的问题了
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)为坐标数组" 的直线进行镜象操作没有反映啊?????????????????????????????????????????????????????????
敬请各位高手指正!!!!谢谢!!!! 通过选择定义的点"po(2)为坐标数组" 的直线是调用drawline子程生成的么?
如果是的,把drawline改写为函数,返回值就是你要的 对的drawline已经是函数了。只是我没有没有写出来而已。我今天终于解决了问 体:是因为我少了一个sset.updat的原因!!!谢谢上面那为版主了! 谢谢提供思路学习了
页:
[1]