明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1278|回复: 4

请教各位高手

[复制链接]
发表于 2005-8-13 12:45:00 | 显示全部楼层 |阅读模式

不好意思,我是个新手,请教过程如何调用?

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

编译老是通不过,说红色的部分未定义,不知如何修改,谢谢!

发表于 2005-8-14 17:23:00 | 显示全部楼层
可能的话,把整个工程打包发给我看看吧。
从你这上面看的话,没有错。


Email:
uhuang@163.com
 楼主| 发表于 2005-8-14 21:52:00 | 显示全部楼层
好的,谢谢先
发表于 2005-8-14 22:06:00 | 显示全部楼层
程序太乱了些。问题很多,因为没有贴完整,很难调试。
如果只是你所说的问题,那是因为你把
Sub drawmortar(center As AcadPoint, counter As interger, radius As Double)
中的integer写成了interger
 楼主| 发表于 2005-8-15 09:17:00 | 显示全部楼层

好的,谢谢!

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-27 12:30 , Processed in 0.167539 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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