谁知道vba编程修改autocad图块颜色?
<p>请教高手:谁知道vba编程修改autocad图块颜色?</p> <p>取得块定义</p><p>在块定义中遍历图元,修改颜色</p><p>更新</p> <strong><font face="Verdana" color="#61b713">gdzhou你好,请问怎样取得块定义啊?</font></strong> 选择块参照获得块名,用块名就可以访问块了 Sub blockcolor()<br/>Dim blref As AcadBlockReference<br/>Dim pt As Variant<br/>ThisDrawing.Utility.GetEntity blref, pt<br/>Dim bl As AcadBlock<br/>Set bl = ThisDrawing.Blocks(blref.Name)<br/>For Each ent In bl<br/>ent.color = 1<br/>Next<br/>ThisDrawing.Regen (acActiveViewport)<br/>End Sub <p>不知道你要修改块的颜色还是块内图元的颜色</p> Sub blockcolor()<br/>Dim blref As AcadBlockReference<br/>Dim pt As Variant<br/>ThisDrawing.Utility.GetEntity blref, pt<br/>blref.color = 1<br/>ThisDrawing.Regen (acActiveViewport)<br/>End Sub
页:
[1]