本帖最后由 作者 于 2009-3-12 18:07:54 编辑
你的代码只有部分,我重写了下测试没有问题,你看看是不是你的其他部分有问题 Sub tttt() Dim outerLoop(0 To 0) As AcadEntity Dim sss As AcadLWPolyline Dim bb(0 To 7) As Double bb(0) = 0: bb(1) = 0 bb(2) = 100: bb(3) = 0 bb(4) = 100: bb(5) = 100 bb(6) = 0: bb(7) = 100 Set sss = ThisDrawing.ModelSpace.AddLightWeightPolyline(bb) sss.closed = True Set outerLoop(0) = sss '填充封口处() Dim hatchObj As AcadHatch Dim patternName As String '填充图案名 Dim PatternScale As Double '填充图案比例 Dim PatternType As Long Dim Associativity As Boolean Associativity = True PatternType = 0 patternName = "AR-CONC" PatternScale = 0.02 Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, Associativity) hatchObj.AppendOuterLoop (outerLoop) hatchObj.Evaluate ThisDrawing.Regen True
End Sub 另外看看是不是你的范围太大,把填充比例放大试试 |