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