明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1642|回复: 3

求助啊??难了我好几天的问题了

[复制链接]
发表于 2005-2-4 15:58:00 | 显示全部楼层 |阅读模式
Public Sub mi(ss As AcadSelectionSet, x1, y1, x2, y2) ''''''''''''''选择集镜像
Dim p1(2) As Double, p2(2) As Double
p1(0) = x1: p1(1) = y1: p1(2) = 0
p2(0) = x2: p2(1) = y2: p2(2) = 0
Dim ent As AcadEntity
If ss.Count > 0 Then
For Each ent In ss
ent.Mirror p1, p2
Next
End If

End Sub Private Sub drawline(x1 As Double, y1 As Double, x2 As Double, y2 As Double, lay As String) '用指定层画直线
Dim first(0 To 2) As Double, scond(0 To 2) As Double
Dim lineobj As AcadLine
first(0) = x1: first(1) = y1: first(2) = 0
scond(0) = x2: scond(1) = y2: scond(2) = 0
Set lineobj = acaddoc.ModelSpace.AddLine(first, scond)
lineobj.Layer = lay

End Sub sub mir()'''''''对选择的线条进行镜象操作
Set cen = acaddoc.ModelSpace.AddLine(p1, p2)
cen.Layer = "3"
drawline (边梁翼缘宽 - 边梁腹板厚) / 2, 0, (边梁翼缘宽 - 边梁腹板厚) / 2, 单节长度, "4"
Dim sset As AcadSelectionSet
Dim po(2) As Double
po(0) = 边梁翼缘宽 - 边梁腹板厚) / 2: po(1) = 0: po(2) = 0
Set sset = acaddoc.SelectionSets.Add("1")
sset.SelectAtPoint po''''''''''''''''''''''''''''''''''''''''选择要镜象的直线
mi sset, 边梁翼缘宽 * 2, 0, 边梁翼缘宽 * 2, 单节长度
End Sub 就是搞不懂为什么通过选择定义的点"po(2)为坐标数组" 的直线进行镜象操作没有反映啊????????????????????????????????????????????????????????? 敬请各位高手指正!!!!谢谢!!!!
发表于 2005-2-4 19:26:00 | 显示全部楼层
通过选择定义的点"po(2)为坐标数组" 的直线是调用drawline子程生成的么?


如果是的,把drawline改写为函数,返回值就是你要的
 楼主| 发表于 2005-2-5 15:09:00 | 显示全部楼层
对的drawline已经是函数了。只是我没有没有写出来而已。我今天终于解决了问 体:是因为我少了一个sset.updat的原因!!!谢谢上面那为版主了!
发表于 2013-1-22 12:01:47 | 显示全部楼层
谢谢提供思路学习了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 15:25 , Processed in 0.180748 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表