How to imort CSV to CAD and give Z-label. LISP?

How to imort CSV to CAD and give Z-label. LISP?

antonXHUXJ
Observer Observer
213 Views
2 Replies
Message 1 of 3

How to imort CSV to CAD and give Z-label. LISP?

antonXHUXJ
Observer
Observer

Hello

 

I made a video of what I can currently do with an extension. The company is going out of bussiness (1 guy, retiring). I wonder if there is any free LISPS available that will import my CSV file that I exported from my Trimble Controller (format is P,X,Y,Z,CODE). After that I want to label the points with their Z-value. This imortant for my clients. I have a TBC subscription also, but I can't seem to export to DWG where the labels show up. 

Any help is appreciated. 

 

Link to how I do it now:

https://youtu.be/i1CIONR9N4Q

0 Likes
214 Views
2 Replies
Replies (2)
Message 2 of 3

hak_vz
Advisor
Advisor

Here you have your code

 

(defun c:csvPoints(/ *error* string_to_list f file1 layername redak P X Y Z CODE)
	(defun *error* ()
		(close file1)
		(princ)
	)
	(defun string_to_list ( str del / pos )
		(if (setq pos (vl-string-search del str))
			(cons (substr str 1 pos) (string_to_list (substr str (+ pos 1 (strlen del))) del))
			(list str)
		)
	)
	(setq f (getfiled "Open File" (getvar "dwgprefix") "csv" 2))
	(setq file1 (open f "r"))
	(setq layername (getstring T "\nLayer name > ") cnt 1 oznaka nil)
	(command "._layer" "_M" layername "")
	(while (setq redak (read-line file1)) 
		(mapcar 'set '(p x y z code) (string_to_list redak ","))
		(mapcar 'set '(x y z) (mapcar 'atof (list x y z)))	
		(entmake (list '(0 . "POINT") (cons 10 (trans (list x y z) 1 0))))
		(entmake
		  (list
			(cons 0 "TEXT")
			(cons 100 "AcDbEntity")
			(cons 100 "AcDbText")
			(cons 10 (trans (list x y z) 1 0))
			(cons 40 (getvar 'textsize))
			(cons 50 0)
			(cons 1 (rtos z 2 3))
		  )
		)
	)
	(command "zoom" "e" "")
	(close file1)
	(princ)
)

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 3 of 3

Sea-Haven
Mentor
Mentor

As you are using a Trimble survey instrument, you have a few choices.

 

Just import points and label.

Use say CIV3D advantage strings your descriptions, multi layer control via description, adding of blocks via description. Surface creation.

A perhaps cheaper option Stringer software or Civil Site Design do a google. Work with Autocad & Bricscad.

 

0 Likes