乐筑天下

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

用文本替换属性定义。

[复制链接]

14

主题

194

帖子

5

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
250
发表于 2004-4-15 08:37:43 | 显示全部楼层
当我替换Keiths关于对齐的代码时,代码运行得很好
回复

使用道具 举报

14

主题

194

帖子

5

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
250
发表于 2004-4-15 09:55:44 | 显示全部楼层
亨迪,我想这似乎是解决办法
回复

使用道具 举报

18

主题

222

帖子

51

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
260
发表于 2004-4-15 18:39:26 | 显示全部楼层
我好像收到了一条奇怪的错误信息。我在网上查到的,其实没什么意义。我做了一个选择案例来检查它是否有错误消息,如果是,则继续下一步。明天上班的时候我会把代码发出去,以防有人想要 0 Then
        YesNo = MsgBox("You Have " & SelSet.Count & " Attribute
Definition(s) in " & ThisDrawing.Name & _
        ". Would you like this program to attempt to convert them to text?",
_
        vbYesNo + vbCritical + vbDefaultButton1)
        'if "Ok" is pressed then try to replace all of the attribute
definitions with text that has the same properties.
        If YesNo = vbYes Then
            For Each AT In SelSet
                Set TXT = ThisDrawing.ModelSpace.AddText(AT.TagString,
AT.InsertionPoint, AT.Height)
                TXT.Alignment = AT.Alignment
                TXT.TextAlignmentPoint = AT.TextAlignmentPoint
                TXT.Layer = AT.Layer
                TXT.Color = AT.Color
                TXT.Rotation = AT.Rotation
                TXT.Update
                AT.Delete
            Next
        End If
    End If
    'clear the selection set
    SelSet.Clear
    'rescan the drawing for attribute definitions
    SelSet.Select acSelectionSetAll, , , FilterType, FilterData
    'if it the count is zero then it worked.
    If SelSet.Count = 0 Then
        MsgBox "All attributes were converted to text."
    Else:
        MsgBox "Failed to convert all attributes to text."
    End If
Exit_Error:
    Select Case Err.Number
    Case -2145386494 'not applicable
        Resume Next
    Case Else
        SelSet.Delete
        Set SelSet = Nothing
        Set AT = Nothing
        Set TXT = Nothing
    End Select
End Sub
[/code]
回复

使用道具 举报

14

主题

194

帖子

5

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
250
发表于 2004-4-16 18:32:22 | 显示全部楼层
有趣的是事情是如何发展的。
我刚刚找到了这个例程的用途。谢谢你们。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-15 16:26 , Processed in 0.496926 second(s), 69 queries .

© 2020-2025 乐筑天下

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