djy0402love 发表于 2009-5-20 12:34:00

VBA中如何实现标注以及创建图层?

<p>VBA中如何实现标注以及创建图层?</p>

mccad 发表于 2009-6-1 06:39:00

<p>标注有各种方法,请参考对象模型。</p><p>建图层可使用以下函数</p><p>Public Function CreateLayer(ssLayerName As String, Optional EntColor As Integer) As AcadLayer<br/>On Error Resume Next<br/>&nbsp;&nbsp;&nbsp; Set CreateLayer = ThisDrawing.Layers(ssLayerName)<br/>&nbsp;&nbsp;&nbsp; If Err Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Err.Clear<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set CreateLayer = ThisDrawing.Layers.Add(ssLayerName)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If EntColor &lt;&gt; 0 Then CreateLayer.color = EntColor<br/>&nbsp;&nbsp;&nbsp; End If</p><p>End Function</p>
页: [1]
查看完整版本: VBA中如何实现标注以及创建图层?