如何修改块的属性
<p></p><p>在程序中自定义属性块后,如何获取并修改块的属性值呢?</p><p>不是块参照</p><p>谢谢</p> <pre class="Code">Sub Example_Blockttribute()' This example creates an MLeader object and gets and sets values for
' the block attribute type.
Dim points(0 To 5) As Double
points(0) = 0: points(1) = 4: points(2) = 0
points(3) = 1.5: points(4) = 5: points(5) = 0
Dim i As Long
Dim oML As AcadMLeader
Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i)
oML.ContentType = acBlockContent
oML.ContentBlockType = acBlockBox
Dim sBlock As String
sBlock = oML.ContentBlockName
Dim o As AcadEntity
For Each o In ThisDrawing.Blocks(sBlock)
If o.ObjectName = "AcDbAttributeDefinition" Then
Call oML.SetBlockAttributeValue(o.ObjectID, "123")
MsgBox oML.GetBlockAttributeValue(o.ObjectID)
End If
Next o
Update
ZoomExtents
End Sub
</pre><p class="body"> </p> <p>能不能给个简单的例子,我是在CAD2004下的。</p><p>上面的例子看不懂。</p>
页:
[1]