Write a text without open dwg file

Write a text without open dwg file

islerahmet06
Contributor Contributor
1,073 Views
3 Replies
Message 1 of 4

Write a text without open dwg file

islerahmet06
Contributor
Contributor

Hi again

 

i have lots of dwg files in same file (for example c:\users\)

i insert a text like "hello" all of these files one by one

is there any easy way to do this?

text coordinates, height etc might be same

0 Likes
Accepted solutions (1)
1,074 Views
3 Replies
Replies (3)
Message 2 of 4

ВeekeeCZ
Consultant
Consultant
Accepted solution

You need ScriptPro HERE

 

Then you'll need a simple script like

TEXT

0,0

2

0

HELLO

 

... just what would you do if you enter the text thru the command-line.

 

Message 3 of 4

islerahmet06
Contributor
Contributor

thanks for your answer but i dont have permission to setup any program at my work but i will try it myself at home

 i will write when i try 🙂 thanks a lot.

0 Likes
Message 4 of 4

jamieq
Collaborator
Collaborator

Take a look at Lee-Mac's ODBX Wrapper.

The function to use with it could be something like:

(defun addtext (doc)
  (vla-AddText (vla-get-ModelSpace doc) "Whatever text." (vlax-3d-point 0 0 0) 12)
)

This will put the text "Whatever text." at 0,0,0 with a height of 12 (inches, or whatever units you use). Use it like:

(LM:odbx 'addtext dwg t)

Variable dwg needs to be a list of drawings names. You can make it nil and it will prompt you for a folder, and will run addtext on every drawing in that folder. The t saves each drawing once the text is added.

0 Likes