Add DText to Origin

Add DText to Origin

jyan2000
Advocate Advocate
354 Views
3 Replies
Message 1 of 4

Add DText to Origin

jyan2000
Advocate
Advocate

Hi, 

 

what kind of code would able to add DTEXT (exp: TYPE_01)  to x,y,z (0,0,0) ?

 

regards

Victor

0 Likes
355 Views
3 Replies
Replies (3)
Message 2 of 4

Ajilal.Vijayan
Advisor
Advisor

Hi Victor,

If you want to add a Dtext at 0,0,0 with the text value "TYPE_01", this code should do.

(entmake '((0 . "TEXT") (40 . 2.5) (1 . "TYPE_01")(10 0.0 0.0 0.0)))

0 = Type of object(TEXT), 40 = Text height, 1 = Text Value and 10 = Insertion point.

0 Likes
Message 3 of 4

jyan2000
Advocate
Advocate

Thats great

 

Thanks a lot

 

0 Likes
Message 4 of 4

Kent1Cooper
Consultant
Consultant

@jyan2000 wrote:

.... 

what kind of code would able to add DTEXT (exp: TYPE_01)  to x,y,z (0,0,0) ?

....


Or:

(command "_.text" "0,0" YourHeightIfNeeded 0 "TYPE_01")

 

Whether a Height is needed depends on whether the current Text Style has a fixed Height.  One little advantage of the (entmake) approach is that you don't need to concern yourself with that question.  But I would encourage you to also include the Style, in either a Text command or with the (entmake) approach, so you will get consistent results regardless of what the current Style happens to be when you call the routine.

 

BUT mostly I'm Replying to get into one of my little pet peeves -- there's no such thing as DTEXT as an entity type.  DTEXT is only a command name, pretty much subsumed years ago into the function of the regular TEXT command [it's a long story], but what it makes is just TEXT.

Kent Cooper, AIA
0 Likes