Public Sub Add_Block1() Dim dblStart(0 To 2) As Double '插入点 Dim objBlkDef As AcadBlock Dim objBlkRef As AcadBlockReference Dim objBlock As AcadBlock Dim ent As AcadEntity For Each ent In ThisDrawing.ModelSpace If ent.Name = "Block1" Then '找到指定的块 Set objBlkRef = ent End If Next 'objBlkDef 如何转换为objBlkRef呢? Dim varAttributes As Variant varAttributes = objBlkRef.GetAttributes varAttributes(0).TextString = "成功了" '修改第一个属性值? End Sub
|