Pietari Posted April 11, 2013 Posted April 11, 2013 My code for entmaking text: (setq nt (entmakex (list '(0 . "TEXT") '(100 . "AcDbEntity") '(67 . 0) '(100 . "AcDbText") (cons 10 c) (cons 11 c) (cons 40 v) [b][color=red] '(1 . "text1 text2")[/color][/b] '(50 . 0.0) '(62 . 161) '(41 . 1.0) '(51 . 0.0) '(71 . 0) '(72 . 0) '(73 . 1) ))) The red part, I want it to be a combination of a string and some variable like this: '(1 . (strcat "Text1 " var " Text2")); var = "abc" It obiously does not work... Even this does not work: '(1 . (strcat "Text1 " " Text2")) The error is: bad DXF group: (1 STRCAT "Text1" " Text2") Any ideas? Thanks! Quote
fixo Posted April 11, 2013 Posted April 11, 2013 Hi Pietari Try this instead: (setq p (getpoint "\Pick: ")) (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(100 . "AcDbText") (cons 1 "tex1 text2");string (cons 7 "Standard");style (cons 8 "0");layer '(62 . 256);color (cons 10 p);insertion point (cons 11 p);alignment point (cons 40 2.5);text height (cons 41 1.0);text width (cons 50 0.0);1.5708 - vertical, 0.0 - horizontal (cons 51 0.0);oblique angle '(72 . 1)));bottom center Quote
Pietari Posted April 11, 2013 Author Posted April 11, 2013 Hi Fixo, Long time no see :-) GP_'s code did fix my issue, I will have to look up CONS better! Thanks both you guys! Quote
Lee Mac Posted April 11, 2013 Posted April 11, 2013 The following explanation may help with your understanding Pietari: http://www.cadtutor.net/forum/showthread.php?75708&p=513602&viewfull=1#post513602 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.