Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

[HOW to] Insert Text in Coordinates

Anonymous

[HOW to] Insert Text in Coordinates

Anonymous
No aplicable

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 Me gusta
Responder
Soluciones aceptadas (1)
15.951 Vistas
16 Respuestas
Respuestas (16)

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

Anonymous
No aplicable

Hi Jonathan Norton,

 

Thanks for for your reply.

 

Actually in my company script file is locked.

 

like I cannot save file extn as *.scr

 

Emoticono frustrado

 

 

Please give some other option if any

 

Thanks

 

MK

0 Me gusta

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 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Me gusta

Anonymous
No aplicable

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 Me gusta

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 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Me gusta

Anonymous
No aplicable

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 Me gusta

Alfred.NESWADBA
Consultant
Consultant
Solución aceptada

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 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)

Anonymous
No aplicable

Hi alfred

 

that worked...!!!!

 

Emoticono muy feliz

Emoticono muy feliz

Emoticono muy feliz

Emoticono muy feliz

 

 

Thanks lot, 1000 data in one go... 

 

 

Regards,

 

MK

0 Me gusta

anders.haukeland
Participant
Participant

Prefect!

 

I have been looking a method like this for quite some time :cara_que_ríe_con_la_boca_abierta_y_los_ojos_sonrientes:

 

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

0 Me gusta

Anonymous
No aplicable

As advised the lisp file has been created.

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

0 Me gusta

Anonymous
No aplicable

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 Me gusta

Anonymous
No aplicable

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

0 Me gusta

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 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Me gusta

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 Me gusta

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 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Me gusta

omar_zdn
Community Visitor
Community Visitor
Thanks
0 Me gusta