[求助]菜鸟求助_阴影问题
<br/>Dim outerLoop(0 To 0) As AcadEntity<br/>Set outerLoop(0) = ThisDrawing.ModelSpace.AddLightWeightPolyline(Bb)<br/>'填充封口处()<br/>Dim hatchObj As AcadHatch<br/>Dim patternName As String '填充图案名<br/>Dim PatternScale As Double '填充图案比例<br/>Dim PatternType As Long<br/>Dim Associativity As Boolean<br/><br/>Associativity = True<br/>PatternType = 0<br/>patternName = "AR-CONC"<br/>PatternScale = 0.02<br/><br/><br/>Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, Associativity)<br/>hatchObj.AppendOuterLoop (outerLoop)<br/>hatchObj.Evaluate<br/>ThisDrawing.Regen True<br/><br/>如果patternname="ansi31"就可以通过,为什么patternName = "AR-CONC"就出现输出不确定的错误呢?<br/> 本帖最后由 作者 于 2009-3-12 18:07:54 编辑 <br /><br /> <p>你的代码只有部分,我重写了下测试没有问题,你看看是不是你的其他部分有问题</p><p>Sub tttt()<br/>Dim outerLoop(0 To 0) As AcadEntity<br/>Dim sss As AcadLWPolyline<br/>Dim bb(0 To 7) As Double<br/>bb(0) = 0: bb(1) = 0<br/>bb(2) = 100: bb(3) = 0<br/>bb(4) = 100: bb(5) = 100<br/>bb(6) = 0: bb(7) = 100<br/>Set sss = ThisDrawing.ModelSpace.AddLightWeightPolyline(bb)<br/>sss.closed = True<br/>Set outerLoop(0) = sss<br/>'填充封口处()<br/>Dim hatchObj As AcadHatch<br/>Dim patternName As String '填充图案名<br/>Dim PatternScale As Double '填充图案比例<br/>Dim PatternType As Long<br/>Dim Associativity As Boolean</p><p>Associativity = True<br/>PatternType = 0<br/>patternName = "AR-CONC"<br/>PatternScale = 0.02</p><p><br/>Set hatchObj = ThisDrawing.ModelSpace.AddHatch(PatternType, patternName, Associativity)<br/>hatchObj.AppendOuterLoop (outerLoop)<br/>hatchObj.Evaluate<br/>ThisDrawing.Regen True</p><p>End Sub</p><p>另外看看是不是你的范围太大,把填充比例放大试试</p> X(0) = 0: X(1) = TxtL.Text: X(2) = X(1) + TxtFw.Text: X(3) = X(2) + TxtLw.Text<br/>Y(0) = 0: Y(1) = Y(0) + TxtW.Text<br/><br/>Bb(0) = X(1): Bb(1) = Y(0)<br/>Bb(2) = X(2): Bb(3) = Y(0)<br/>Bb(4) = X(2): Bb(5) = Y(1)<br/>Bb(6) = X(1): Bb(7) = Y(1)<br/>Bb(8) = X(1): Bb(9) = Y(0)<br/><br/>Set sss = ThisDrawing.ModelSpace.AddLightWeightPolyline(bb)<br/>Set outerLoop(0) = sss<br/><br/>大师,有些地方我还是不是很懂,<br/>原代码没改什么地方,只是改了这里就可以了,请指教一下好吗>?<br/>原来的代码<br/>Set outerLoop(0) = ThisDrawing.ModelSpace.AddLightWeightPolyline(bb)<br/>修改后<br/>Set sss = ThisDrawing.ModelSpace.AddLightWeightPolyline(bb)<br/>Set outerLoop(0) = sss<br/><br/>为什么加了个二次赋值就可以呢?<br/>
<br/>
页:
[1]