乐筑天下

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

[编程交流] ATTDEF - tag string with space

[复制链接]

31

主题

106

帖子

76

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
154
发表于 2022-7-5 18:36:33 | 显示全部楼层 |阅读模式
Hello.
 
I just noticed something strange, in all documentations it says that tag string in ATTDEF cannot contain spaces, however once created I can add spaces via properties window.
 
How can I achieve the same within autolisp? I've tried entmod, it would not accept spaces:
 
  1. (SETQ test (ENTGET              (ENTMAKEX                  (LIST                      '(0 . "ATTDEF") ;Entity type                      '(1 . "Value text can have spaces") ;value                      '(2 . "Tag_text_cannot_have_spaces") ;tag                      '(3 . "Prompt text can have spaces") ;prompt                      '(10 0 0 0) ;Text first base point                      '(40 . 6) ;Text height                      '(70 . 0) ;Attribute flag                  )              )          ))(PRINT test)(SETQ test (ENTMOD (SUBST (CONS 2 "tag with spaces") (ASSOC 2 test) test)))(PRINT test)
 
 
Also, is there a settings that makes newly created attdef tag in upper case?
 
 
Thank you.
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-5 19:17:48 | 显示全部楼层
Same issue with Attribute populated via Sheet Set Manager (SSM) Fields - adding spaces before / after within the SSM Property is ignored (even stripped), but manually editing the Attribute value to add spaces before / after SSM Field value works. Grrr
回复

使用道具 举报

31

主题

106

帖子

76

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
154
发表于 2022-7-5 20:01:45 | 显示全部楼层
Seems like vlax-put-property works fine with changing ATTDEF tag to lower case with spaces:
  1. (SETQ test (ENTMAKEX              (LIST                  '(0 . "ATTDEF") ;Entity type                  '(1 . "Value text can have spaces") ;value                  '(2 . "Tag_text_cannot_have_spaces") ;tag                  '(3 . "Prompt text can have spaces") ;prompt                  '(10 0 0 0) ;Text first base point                  '(40 . 6) ;Text height                  '(70 . 0) ;Attribute flag              )          ))(PRINT (ENTGET test))(ENTMOD (SUBST (CONS 2 "tag with spaces via entmod") (ASSOC 2 (ENTGET test)) (ENTGET test)))(PRINT (entget test))(vlax-put-property (vlax-ename->vla-object test) 'TagString "tag with spaces via vlax-put-property")(print (entget test))
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-12 13:19 , Processed in 0.770605 second(s), 58 queries .

© 2020-2025 乐筑天下

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