功能模块返回,建立面域数组
<p>面域是由AcadEntity数组建立的。以上小程序能方便的理解,VBA的AcadEntity实体数组。</p><p>Sub ls()<br/> Dim mm() As AcadEntity<br/> mm = oLine<br/> Dim objRegion As Variant<br/> objRegion = ThisDrawing.ModelSpace.AddRegion(mm)<br/>End Sub<br/>Function oLine() As AcadEntity()<br/> Dim Ent As AcadEntity<br/> Dim pp() As AcadEntity<br/> kk = 0<br/> With ThisDrawing<br/> For Each Ent In .ModelSpace<br/> If Ent.Layer = "粗实线" Then<br/> ReDim Preserve pp(kk) As AcadEntity<br/> Set pp(kk) = Ent<br/> kk = kk + 1<br/> End If<br/> Next<br/> End With<br/> oLine = pp<br/>End Function</p>
页:
[1]