mycad 发表于 2009-4-29 16:28:00

谁知道vba编程修改autocad图块颜色?

<p>请教高手:谁知道vba编程修改autocad图块颜色?</p>

gdzhou 发表于 2009-4-30 11:16:00

<p>取得块定义</p><p>在块定义中遍历图元,修改颜色</p><p>更新</p>

mycad 发表于 2009-4-30 15:30:00

<strong><font face="Verdana" color="#61b713">gdzhou你好,请问怎样取得块定义啊?</font></strong>

wuyunpeng888 发表于 2009-4-30 21:01:00

选择块参照获得块名,用块名就可以访问块了

sailorcwx 发表于 2009-4-30 21:44:00

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

sailorcwx 发表于 2009-4-30 21:45:00

<p>不知道你要修改块的颜色还是块内图元的颜色</p>

sailorcwx 发表于 2009-4-30 21:46:00

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]
查看完整版本: 谁知道vba编程修改autocad图块颜色?