乐筑天下

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

[编程交流] elem.Name = TxtAttBlock.text

[复制链接]

170

主题

347

帖子

174

银币

中流砥柱

Rank: 25

铜币
870
发表于 2022-7-6 22:45:15 | 显示全部楼层 |阅读模式
I am using AutoCAD VBA
I am debuging a VBA AutoCAD Program for the following statement
 
If elem.Name = TxtAttBlock.text Then
 
This statement is  false even when is see the strings match each other in de******.
Is this because they are not the same type of variable? If so, how do
I make this statement test for a string match?
 
Thank you,
 
For your Information I am using the following code.
 
For Each elem In ThisDrawing.PaperSpace
     If elem.EntityName = "AcDbBlockReference" Then
     If elem.Layer  blocklayer Then GoTo NxtelemPaper
     elemText = elem.Name
     If elem.Name = TxtAttBlock.text Then
                   foundAttributes = True
                Array1 = elem.GetAttributes
                                c = c + 1
         End If
        End If
    End if
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-7 00:04:49 | 显示全部楼层
When you get attributes it saves them in an array style so attibute 0 is first 1 is next attribute
array1(0) etc
 
found it a couple of posts down
 
myAttributes = myObject.GetAttributes
    myval = myAttributes(0).TextString
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-4 11:52 , Processed in 0.767075 second(s), 56 queries .

© 2020-2025 乐筑天下

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