明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2026|回复: 0

请教关于evaluate和regen

[复制链接]
发表于 2011-8-30 10:13:36 | 显示全部楼层 |阅读模式
以前学习vlisp,现在初学VBA,有很多问题不明白,请各位指教。
以下程序中的Evaluate有什么具体作用吗?我试过把它删去,似乎对运行结果没有任何影响(我用的是2008)。
而Regen的作用应该是重绘吧,但我感受不到它的实际作用呀,请问何解?谢谢大家

Sub ee()
Dim hatchobj As AcadHatch
Dim patternname As String
Dim patterntype As Long
Dim bassociativity As Boolean
patternname = "ansi31"
patterntype = 0
bassociativity = True
Set hatchobj = ThisDrawing.ModelSpace.AddHatch(patterntype, patternname, bassociativity)
Dim outerloop(0 To 1) As AcadEntity
Dim center(0 To 2) As Double
Dim radius As Double,startangle,endangle
center(0) = 5: center(1) = 3: center(2) = 0
radius = 3
startangle = 0
endangle = 3.14
Set outerloop(0) = ThisDrawing.ModelSpace.AddArc(center, radius, startangle, endangle)
Set outerloop(1) = ThisDrawing.ModelSpace.AddLine(outerloop(0).StartPoint, outerloop(0).EndPoint)
hatchobj.AppendOuterLoop (outerloop)
Dim innerloop(0) As AcadEntity
center(0) = 5: center(1) = 4.5: center(2) = 0
radius = 1
Set innerloop(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
hatchobj.AppendInnerLoop (innerloop)
hatchobj.Evaluate
ThisDrawing.Regen True
End Sub

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

本版积分规则

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

GMT+8, 2024-11-25 18:56 , Processed in 0.144119 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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