[HOW to] Insert Text in Coordinates

[HOW to] Insert Text in Coordinates

Anonymous
Not applicable
17,096 Views
16 Replies
Message 1 of 17

[HOW to] Insert Text in Coordinates

Anonymous
Not applicable

Hello,

 

 

I have data like below

 

Coordinates X, Y value and some remarks

 

X        Y        TEXT

100    150    TRENCH START

150    150    DUCT BANK START

200    150   DUCT BANK END

300    150   TRENCH END

 

I want to Import above text value in respective coordinates in AutoCAD. 

 

Please suggest me some good lisp or idea to finish my work.

 

I have more than 1000 data to enter like above.

 

please help me out.

 

 

Thanks

 

MK

 

 

0 Likes
Accepted solutions (1)
17,097 Views
16 Replies
Replies (16)
Message 2 of 17

Jonathan3891
Advisor
Advisor

You could create a script file like this.

 

point
100,150
text
100,150


TRENCH START
point
150,150
text
150,150


DUCT BANK START
point
200,150
text
200,150


DUCT BANK END
point
300,150
text
300,150


TRENCH END
end

Jonathan Norton
Blog | Linkedin
Message 3 of 17

Anonymous
Not applicable

Hi Jonathan Norton,

 

Thanks for for your reply.

 

Actually in my company script file is locked.

 

like I cannot save file extn as *.scr

 

Smiley Frustrated

 

 

Please give some other option if any

 

Thanks

 

MK

0 Likes
Message 4 of 17

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> Actually in my company script file is locked. like I cannot save file extn as *.scr

Ask them to let you save it, just not execute it (execute from operating system).

 

As alternative: when you have the file created, you can also copy & paste the content of the script into the command-line of AutoCAD. It's the same as starting the SCR with command _SCRIPT.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 5 of 17

Anonymous
Not applicable

Hi  Alfred ,

 

Thanks for your reply.

 

I already tried the same , IT could not help me in this.

 

 

As you said I tried this,

 

copied the content and pasted but text did not placed, instead it was asking to enter text - SEE ATTACHED FILE

 

 

Thanks

 

MK

 

 

0 Likes
Message 6 of 17

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

ohh, you are right, didn't think about TEXT, sorry!

 

Do you have AutoCAD or AutOCAD LT? In first case you can use LISP to place the text instead of direct input as command, sample:

(command "_TEXT" "1,1" "2" "0" "This is my Text")

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 7 of 17

Anonymous
Not applicable

Hi Alfred,

 

 

I am using Autocad 2015 (full version)

 

Can you write and give sample LISP?

 

I do not know how to write lisp program

 

Thanks

 

MK

0 Likes
Message 8 of 17

Alfred.NESWADBA
Consultant
Consultant
Accepted solution

Hi,

 

>> Can you write and give sample LISP?

I wrote you one line as sample in my previous message, you just need to use this line with your text, textsize, position and rotation:

 

(command "_TEXT" "1,1" "2" "0" "This is my Text")

 

whereas;

  • "_TEXT" is the command you call from lisp (so it does not wait with the cursor in the screenarea)
  • "1,1" is the position
  • "2" is the textsize
  • "0" is the rotation
  • "this is my text" is the content you want to write

 

So the first two text objects from your sample then looks like that (well, not nowing text height and rotation):

(command "_TEXT" "100,150" "2" "0" "TRENCH START")

(command "_TEXT" "150,150" "2" "0" "DUCT BANK START")

 

HTH, alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 9 of 17

Anonymous
Not applicable

Hi alfred

 

that worked...!!!!

 

Smiley Very Happy

Smiley Very Happy

Smiley Very Happy

Smiley Very Happy

 

 

Thanks lot, 1000 data in one go... 

 

 

Regards,

 

MK

0 Likes
Message 10 of 17

anders.haukeland
Participant
Participant

Prefect!

 

I have been looking a method like this for quite some time 😄

 

Do you know if similar approach is possible for multi line text as well?

0 Likes
Message 11 of 17

Anonymous
Not applicable

As advised the lisp file has been created.

What should be the command to run the lisp in auto cad?

0 Likes
Message 12 of 17

Anonymous
Not applicable

Dear Karthik

May I have the LISP file you created or some sample lisp in this regards? Please send it to kbg1973@gmail.com

0 Likes
Message 13 of 17

Anonymous
Not applicable

Picture1.jpgCreated LISP like this. Is it OK? or Please advise.

0 Likes
Message 14 of 17

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> What should be the command to run the lisp in auto cad?

You can simply copy & paste these lines into the command-line area of AutoCAD.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 15 of 17

hannes.randhahn
Enthusiast
Enthusiast

Hey there,

 

I just saw this problem and i wonder if this would be possible for in- and output?

I want to extract coordinates from lines and re-enter some text at these positions. 

Could this be done with excel as well?

 

example Ouput: Line1, x=10,y=20,z=0 [via Dataextract]

 

Input: Text"Line1" at x,y,z

 

Would this be possible through Lisp, without the in-between command elements?

The whole idea would be to output Data > manipulate in excel and input back again into plan drawings as text.

 

Thanks for any help in advance.

0 Likes
Message 16 of 17

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> Would this be possible through Lisp,

Hi yes, if you want it using LISP then >>>this forum<<< would be the best to ask.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 17 of 17

omar_zdn
Community Visitor
Community Visitor
Thanks
0 Likes