zgyxn 发表于 2007-7-2 17:35:00

填充问题

<p>我有多个闭合线,如果一次填充的话,想单独修改某个多义线里面的填充,是不能的。</p><p>有没有个东东在选闭合线填充时,各个填充的东东都能单独是个实体,方便将来单个修改???</p>

laoliu09 发表于 2007-7-4 10:38:00

你一个一个闭合线填充就是啦!遍历所有闭合多段线,然后一个一个填充!不难实现啊!

zgyxn 发表于 2007-7-15 16:18:00

<p>还是求自己好,做好了,大家分享一下</p><p>Public Sub bha() '快速填充<br/>Dim poinTs As Variant<br/>Dim varinSp As Variant<br/>Dim dbLp(2) As Double<br/>Dim hatchObj As AcadHatch<br/>Dim patternName As String<br/>Dim patternType As Long<br/>Dim assocVar As Boolean<br/>Dim upBiao As Integer<br/>patternName = "SOLID"<br/>Dim outerLoop(0 To 0) As AcadEntity<br/>Dim eNt As AcadEntity<br/>patternType = acHatchPatternTypePreDefined<br/>assocVar = True</p><p><br/>'*************开始程序*************<br/>'On Error GoTo Err_Control<br/>selec:<br/>If ThisDrawing.SelectionSets.Count &gt; 0 Then<br/>&nbsp;&nbsp;&nbsp; For i = 0 To ThisDrawing.SelectionSets.Count - 1<br/>&nbsp;&nbsp;&nbsp; ThisDrawing.SelectionSets.Item(i).Delete<br/>&nbsp;&nbsp;&nbsp; Next i<br/>&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;Set sSet = ThisDrawing.SelectionSets.add("ss1")<br/>&nbsp;sSet.SelectOnScreen</p><p>&nbsp;For Each eNt In sSet</p><p>Set outerLoop(0) = eNt<br/>&nbsp;Set hatchObj = ThisDrawing.ModelSpace.AddHatch(patternType, patternName, assocVar)<br/>&nbsp;hatchObj.AppendOuterLoop (outerLoop)<br/>&nbsp;hatchObj.Evaluate<br/>&nbsp;Next</p><p>'ThisDrawing.Regen True</p><p>end</p>

zgyxn 发表于 2007-7-16 10:20:00

<p>还有个问题,用bhatch命令时,还有个点选择模式,这步用什么方法实现好?</p><p>上面那个程序最好加一句 If Err.Number = -2145386493 Then GoTo Ne</p>

zgyxn 发表于 2007-7-19 10:55:00

怎么没人来指点一下,怎么可以用点选择呀
页: [1]
查看完整版本: 填充问题