View Full Version : entmake
kipp
23rd May 2005, 09:20 pm
I need to create text via entmake. The text will vary, containing part of the drawing name.
I can use entmake successfully to create text with the text quoted as below but not with a variable. Can anyone show me how to create it with a variable??
(entmake '((0 . "TEXT") (10 4.0 4.0 0.0) (1 . "some text") (72 . 0) (40 . 0.0938)))
Thanks,
Kipp
Dommy2Hotty
23rd May 2005, 09:38 pm
Not familiar with entmake, but have used variables to insert text. I had to change the "texteval" varible on before using the variable. That might be what you need to do....but then again, I'm just using the text command in a macro as shown below:
[Pulldown Selection for "Bath 2"](setvar "users1" "Bath 2");
[Pulldown Selection for "Insert Tag"]^C^C^Ctexteval;1;(setq room (strcase(getvar "users1")));(setq room (strcat "%%U" room));(SETQ PT(GETPOINT "Specify start point of text: "));\(setvar "osmode" 0);TEXT;!PT;7.5;0;!room;
There's more to my code, such as text style setup, layering, etc, but you only need to see the texteval usage in mine. Maybe it will work for you. Not sure. Give it a whirl!
David Bethel
23rd May 2005, 09:56 pm
The quote '((... format means that everything is taken literally. Nothing is evaluated. In order to use a dynamic variable, you must use the (list (cons 0 "TEXT")(cons 1 "some text")...
-David
kipp
23rd May 2005, 10:33 pm
The LIST and CONS seem to be the answer but I failed when tring to create the cordinate dotted pair. i.e. (10 . 4.0 4.0 0.0).
What is the format to create a coordinate?
Thanks a lot,
Kipp
CarlB
24th May 2005, 12:20 am
If variable "pt" contains point data, such as (2.0 3.3 6.66); then (cons 10 Pt) will create the correct list. 'cons' will create a dotted pair when combining 2 single elements (atoms), but when 1 or both are lists no "dot' is included.
fuccaro
24th May 2005, 09:56 am
If the content of the text is the name of the drawing (or part of the name) you can use something like:
(cons 1 (getvar "DWGNAME"))
or
(cons 1 (substr (getvar "DWGNAME") 3 3))
Powered by vBulletin™ Version 4.1.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.