Dim HatchObject As AcadHatch Dim OuterCircle(0) As AcadCircle Dim Center As Variant Dim Radius As Double
With ThisDrawing.Utility Center = .GetPoint("Click the position or Enter the Center ordinate:") Radius = .GetDistance(Center, "Enter the radius.") End With
Set OuterCircle(0) = ThisDrawing.ModelSpace.AddCircle(Center, Radius) OuterCircle(0).color = acYellow
OuterCircle(0).Update
Set HatchObject = ThisDrawing.ModelSpace.AddHatch(acHatchPatternTypePreDefined, "ansi31", False) HatchObject.AppendOuterLoop (OuterCircle) '设置填充的外环边界 HatchObject.Evaluate '寻找和剖面线相交的部分(和set hatchobject不合分割 HatchObject.Update End Sub
运行后,出现错误提示;AutoCAD主窗口不可见。 光标定位在getpoint一行 加入application.visual=true(我认为没必要)也不行。 大家帮帮忙吧。