- 积分
- 564
- 明经币
- 个
- 注册时间
- 2007-9-17
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
以前学习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
|
|