乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 37|回复: 2

如何修改块的属性

[复制链接]

10

主题

22

帖子

1

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
62
发表于 2007-6-21 12:08:00 | 显示全部楼层 |阅读模式
在程序中自定义属性块后,如何获取并修改块的属性值呢?
不是块参照
谢谢
回复

使用道具 举报

GJY

8

主题

23

帖子

1

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
55
发表于 2007-6-21 12:39:00 | 显示全部楼层
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
    ZoomExtentsEnd Sub
  
回复

使用道具 举报

10

主题

22

帖子

1

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
62
发表于 2007-6-22 16:01:00 | 显示全部楼层
能不能给个简单的例子,我是在CAD2004下的。
上面的例子看不懂。
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-6 19:20 , Processed in 1.365818 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表