Jump to content

Recommended Posts

Posted

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!

Posted

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

Posted

Try

 

(cons 1 (strcat "Text1 " var " Text2"))

Posted

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!

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...