home 发表于 2009-11-6 15:10:00
<p>Public Sub Add_Block1()</p><p>Dim dblStart(0 To 2) As Double '插入点<br/>Dim objBlkDef As AcadBlock<br/>Dim objBlkRef As AcadBlockReference<br/>Dim objBlock As AcadBlock</p><p>Dim ent As AcadEntity<br/>For Each ent In ThisDrawing.ModelSpace<br/> If ent.Name = "Block1" Then '找到指定的块<br/> Set objBlkRef = ent<br/> End If<br/>Next</p><p>'objBlkDef 如何转换为objBlkRef呢?</p><p>Dim varAttributes As Variant<br/>varAttributes = objBlkRef.GetAttributes<br/>varAttributes(0).TextString = "成功了" '修改第一个属性值?</p><p>End Sub<br/></p>szuki 发表于 2009-11-6 15:54:00
<p>哦,我搞错了,本想通过改一个块的属性,达到改掉所有的图中的同名块的目的,但是忘了这是个属性块,每个可以有各自的值。</p><p></p><p>我目的就是为了每次根据“订单号码”,达到每个图框自动显示这个值的功能,有好几个layout都要自动改,所以想到了用图块,但是现在更迷茫了。</p>
页:
1
[2]