←  nanoCAD forum

nanoCAD forum

»

DXF file

LudEngineer90's Photo LudEngineer90 14 Sep 2022

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.
Quote

Artemio's Photo Artemio 14 Sep 2022

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".
Quote

Artemio's Photo Artemio 14 Sep 2022

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.
Quote

Artemio's Photo Artemio 14 Sep 2022

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.
Quote

LudEngineer90's Photo LudEngineer90 19 Sep 2022

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.

Attached File  BALASURV 15.09.dxf (8.36K)
downloads: 10
Quote

Artemio's Photo Artemio 19 Sep 2022

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?
Quote