Jump to content

Coordinates and point number from excel to plot in cad.


Recommended Posts

Posted

I have excel sheet       containing point number and coordinates of points.

How can i plot the point and wright reverent point number with it

converting to cvs file I can plot theCombaind Points.csv points.But cannot write the point number.

Posted
(defun c:demo ( / _DelTolst opf source a data)
(setvar 'pdsize 0.05)  
(defun _DelTolst ( str m / pos x lst lst2)
	(if (setq pos (vl-string-position m str))
	   (cons (substr str 1 pos) (_DelTolst (substr str (+ pos 2)) m ))
	   (list str)
	   )
)
 (if (setq source (getfiled "Select csv file" (getvar "dwgprefix") "csv" 16))
    (progn
	(setq opf (open source "r"))
      	(while (setq a (read-line opf))
	  (setq data (_DelTolst a 44))
	  (entmake (list (cons 0 "POINT")(setq lay (cons 8 (Cadddr (Cdr data))))
	  		(cons 10  (setq p (mapcar '(lambda (n)
						(distof (nth n data)))
							       '(1 2 3))))
			 )
		   )
	(entmakex (list (cons 0 "TEXT")
		                  (cons 10 p) (cons 11 p)lay
		                  '(40 . 0.1)'(72 . 1)'(73 . 1)
		                  (cons 1  (car data))))
	  )
      (close opf)
      )
    )(princ)
  )

 

Posted

When you want to plot text from a csv file, you must supply all the different information that text needs to be plotted.

 

So beginning with the TEXT command, you need to specify the Text Style, Justification, the position of the text, size of text, rotation of text, and the actual text.

 

All could be done in a spread sheet but easier with a lisp.

 

If you are going to use this plot to draw up a survey, I would caution against using the AutoCAD point to mark the position, because the line-weight of points cannot be increased from their default value of 0.

Posted

Using excel to do this is not that hard to do this avoiding using a macro etc. In excel is the command concatenate so its easy to make a POINT X,Y column, which you just copy and paste to command line same with text 

 

=Concatenate("Point ", A1,",",B1) this is col A is X col B is y = Point x,y

Just do the same another column for text you preset style but it uses the same A1,B1 etc, depending on text style you will need or not the height.

 

image.png.39e7a9ef3edbabb8e351a06ce5dc66f9.png

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...