jiwei2200 发表于 2009-5-9 10:05:00

[求助][讨论]求用VBA做cad二次开发怎么设置图层

用VBA做cad二次开发怎么设置图层,谁有相关的例子,给会个帖子,谢谢。

mccad 发表于 2009-5-11 18:04:00

<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<br/></p>
页: [1]
查看完整版本: [求助][讨论]求用VBA做cad二次开发怎么设置图层