fyt234 发表于 2006-5-12 14:39:00

[VBA]求助各位达人,关于块属性编辑--已解决

利用下面代码段,我可以访问到块的名称,现在想访问块编辑“增强属性编辑器”对话框里面“文字选项”面板内“高度”这个属性,不知道怎么访问到呢?
    Dim blkColl As AcadBlocks
    Set blkColl = ThisDrawing.Blocks
    '扫描图块集合
    For Each elem In blkColl
      Msg elem.Name
    Next
已经解决,谢谢这个论坛,答案在三楼

fyt234 发表于 2006-5-12 15:19:00

好像用GetAttributes方法只能得到这个对话框里面第一个"属性"面板里面的属性和值,不能得到“文字选项”面板内“高度”这个属性??

fyt234 发表于 2006-5-12 15:41:00

ThisDrawing.SelectionSets("ss1").Delete
    Set sset = ThisDrawing.SelectionSets.Add("ss1") '新建一个选择集
    sset.SelectOnScreen '提示用户选择
   
    For Each elemEnt In sset
      If elemEnt.ObjectName = "AcDbBlockReference" Then
            If elemEnt.HasAttributes Then
                ' Get the attributes for the block reference
                Dim varAttributes As Variant
                varAttributes = elemEnt.GetAttributes
                Dim strAttributes As String
                Dim I As Integer
                For I = LBound(varAttributes) To UBound(varAttributes)
                  varAttributes(I).Height = 20
                Next
            End If
      End If
Next elemEnt
页: [1]
查看完整版本: [VBA]求助各位达人,关于块属性编辑--已解决