Hi,
I am trying to get the text to show up from a .dxf file, I have recently done a GPS survey and want my X, Y, Z and point name to show up? This is currently what I am getting when I open the file in nanoCAD. Any help would greatly be appreciated.
1
5 replies to this topic
#1
Posted 14 September 2022 - 02:13 PM
#2
Posted 14 September 2022 - 06:49 PM
Hi.
Maybe this'll be useful (not me was creator of it, but somehow I found them on my PC...):
;;;; export text from selected Text object to file.txt
(defun c:exportTXT(/ fid tset n counter txtName txtDB)
(if (and (setq fid (open "C:/Users/HP/Desktop/file.txt" "w"));Create file to export text, change path to yours!
(setq tset (ssget (list (cons 0 "*text"))));ask user to select text entity.
);end and condition
(progn
(setq n (sslength tset)
counter 0
);end setq
(while (< counter n)
(princ "\r... in process")
(setq txtName (ssname tset counter));counter-position in tset;
(setq txtDB (entget txtName))
(setq content (cdr (assoc 1 txtDB)));reading content (dxf=1) in txtDB, excluding dxf-code (cdr)
(write-line content fid);write txt obj in file
(setq counter (+ 1 counter))
);end while
(close fid);!close file!
);end progn
);end if
(princ "\n...done!")
(princ);silent exit
);end defun
This is LISP program, that asks you to select text objects in drawing and exports it to file.txt.
Please, don't forget to change path (C:/.....) to yours.
LISP editor is in: "Manage" -> "Applications" -> "Script editor".
Maybe this'll be useful (not me was creator of it, but somehow I found them on my PC...):
;;;; export text from selected Text object to file.txt
(defun c:exportTXT(/ fid tset n counter txtName txtDB)
(if (and (setq fid (open "C:/Users/HP/Desktop/file.txt" "w"));Create file to export text, change path to yours!
(setq tset (ssget (list (cons 0 "*text"))));ask user to select text entity.
);end and condition
(progn
(setq n (sslength tset)
counter 0
);end setq
(while (< counter n)
(princ "\r... in process")
(setq txtName (ssname tset counter));counter-position in tset;
(setq txtDB (entget txtName))
(setq content (cdr (assoc 1 txtDB)));reading content (dxf=1) in txtDB, excluding dxf-code (cdr)
(write-line content fid);write txt obj in file
(setq counter (+ 1 counter))
);end while
(close fid);!close file!
);end progn
);end if
(princ "\n...done!")
(princ);silent exit
);end defun
This is LISP program, that asks you to select text objects in drawing and exports it to file.txt.
Please, don't forget to change path (C:/.....) to yours.
LISP editor is in: "Manage" -> "Applications" -> "Script editor".
#3
Posted 14 September 2022 - 06:53 PM
Also, you might open your dxf with something like notepad++ and find here coords you need.
To get them with side progs try to parse your dxf.
To get them with side progs try to parse your dxf.
#4
Posted 14 September 2022 - 07:01 PM
To see how your objects in dxf coded you might use LISP commands:
(entget (car (entsel)))
Just enter it in command line.
This'll ask you to select object in drawing and then'll show how it stored, so it'll be easier to parse it then.
(entget (car (entsel)))
Just enter it in command line.
This'll ask you to select object in drawing and then'll show how it stored, so it'll be easier to parse it then.
#5
Posted 19 September 2022 - 11:23 AM
Hi,
Thank you so much for your response, but I cannot understand what I am suppose to do from your response. Please see attached file that I am trying to show my X, Y and Z.
BALASURV 15.09.dxf 8.36K 18 downloads
Thank you so much for your response, but I cannot understand what I am suppose to do from your response. Please see attached file that I am trying to show my X, Y and Z.
BALASURV 15.09.dxf 8.36K 18 downloads
#6
Posted 19 September 2022 - 06:56 PM
You can try to select one of the crosses after opening .dxf in platform and look into the properties window (on the left side).
Here, in "Geometry" section you'll see "Position X", "Position Y" and "Position Z".
May be this'll help?
Here, in "Geometry" section you'll see "Position X", "Position Y" and "Position Z".
May be this'll help?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users