找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 576|回复: 0

[VBA程序]: 请教各位高手

[复制链接]
发表于 2005-8-14 14:39:56 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
请教各位高手

请救各位:

Sub drawcirculkarpavers()

Dim center As AcadPoint, radius As Double
Dim counter As Integer
With ThisDrawing.Utility
center = .GetPoint(, "click the position for center.")
radius = .GetDistance(center, "enter the radius")
End With
For counter = 0 To TextBox1 - 1
Set birckcircles(Count) = ThisDrawing.ModelSpace.AddCircle(center, radius - counter * radius / TextBox1)
brickcircles(counter).Color = acRed
brickcircles(counter).Update
drawmortar center, counter, radius
Next
End Sub

Sub drawmortar(center As AcadPoint, counter As interger, radius As Double)
Dim startpoint(0 To 2) As Double, endpoint(0 To 2) As Double
Dim theta As Double, stepsize As Double
Static adjust As Double
If User = True Then
stepsize = 15 * pi / 180
Else
stepsize = 30 * pi / 180
If adjust = 0 Then
adjust = 15 * pi / 180
Else
adjust = 0
End If
End If
For theta = 0 To 360 * pi / 180 Step stepsize
startpoint(0) = (radius - counter * radius / TextBox1) * Cos(theta + adjust) + center(0)
startpoint(1) = (radius - counter * radius / TextBox1) * Sin(theta + adjust) + center(1)

endpoint(0) = (radius - (counter + 1) * radius / TextBox1) * Cos(theta + adjust) + center(0)
endpoint(1) = (radius - (counter + 1) * radius / TextBox1) * Sin(theta + adjust) + center(1)
With ThisDrawing.ModelSpace
.AddLine startpoint, endpoint
.Item(.Count - a).Update
End With
Next

End Sub

编译时程序说红色标注的子过程没有定义,不知如何定义?drawmortar center, counter, radius[/COLOR] Sub drawmortar(center As AcadPoint, counter As interger, radius As [/COLOR]
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-11-23 11:17 , Processed in 0.186536 second(s), 32 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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