乐筑天下

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

Text is Null

[复制链接]

154

主题

1274

帖子

8

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1936
发表于 2008-8-18 15:20:34 | 显示全部楼层 |阅读模式
Is there any property or telltale way to know if you ahve null text in your drawing?  The only thing I can think of is if the contents contain a space only, as in " "
Any other ideas of how to find stupidity running rampant in the office?
回复

使用道具 举报

85

主题

404

帖子

7

银币

中流砥柱

Rank: 25

铜币
751
发表于 2008-8-18 15:28:07 | 显示全部楼层
(ssget "x" '((0 . "TEXT")(1 . ""))
(ssget "x" '((0 . "TEXT")(1 . " "))
(ssget "x" '((0 . "TEXT")(1 . "  ")) 'to infinity and beyond
or you could turn on qtext and regen ... "null" text should show up as points in the drawing
回复

使用道具 举报

7

主题

42

帖子

1

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2008-8-18 16:14:55 | 显示全部楼层
maybe something along the lines of:
if len(Trim(objtext.textstring))=0 then
' fight for whirled peas
end if
回复

使用道具 举报

7

主题

42

帖子

1

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2008-8-18 16:41:05 | 显示全部楼层
Thank you to all three!!! I used a combined versioin of what you guys posted and it works great
回复

使用道具 举报

85

主题

404

帖子

7

银币

中流砥柱

Rank: 25

铜币
751
发表于 2008-8-19 12:35:25 | 显示全部楼层
If any of you have done database programming, you might remember there is a difference between an empty string ("") and a NULL one.
And I believe any other string that contains 1-to-many space characters (Chr(32)) isnt Null, or an empty string.
One of the ways to check for Nulls is to read the variables in as variants, and check for IsNull. And then, if it is, add an empty string to it ("") to convert to string.
回复

使用道具 举报

85

主题

404

帖子

7

银币

中流砥柱

Rank: 25

铜币
751
发表于 2008-8-19 15:56:03 | 显示全部楼层
Whilst that would be true for an RDBMS, which AutoCAD is NOT, a simpler idea might be to use regular expressions...
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-7-4 00:43 , Processed in 1.232447 second(s), 64 queries .

© 2020-2025 乐筑天下

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