vanowm 发表于 2022-7-5 18:36:33

ATTDEF - tag string with space

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:
 

(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.

BlackBox 发表于 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

vanowm 发表于 2022-7-5 20:01:45

Seems like vlax-put-property works fine with changing ATTDEF tag to lower case with spaces:

(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))
页: [1]
查看完整版本: ATTDEF - tag string with space