How to convert 3d points to 2d and draw 2d diagram from it

How to convert 3d points to 2d and draw 2d diagram from it

avinash00002002
Collaborator Collaborator
943 Views
13 Replies
Message 1 of 14

How to convert 3d points to 2d and draw 2d diagram from it

avinash00002002
Collaborator
Collaborator

Hi,

I have some points in 3D. I want to convert elevation and side view from this points how to do?

0 Likes
944 Views
13 Replies
Replies (13)
Message 2 of 14

devitg
Advisor
Advisor

@avinash00002002  as I can see the csv lost the points numbers . I aad it.

p1316604.6742083201.9547.72325BK244
p2316609.1952083201.9547.72326BK244
p3316604.6742083197.0447.72324BK244
p4316609.1952083197.0447.72323BK244
p5316606.8862083204.0862.15254CA
p6316606.8952083194.9662.15253CA
p7316606.8892083204.2260.18451CU
p8316606.9032083194.7760.18452CU
p9316607.412083201.9861.219104S 1
p10316606.4872083201.9861.21948S 1
p11316606.4732083197.1461.21947S 1
p12316607.3852083197.1261.219105S 1
p13316607.4152083201.9963.192107S 2
p14316606.491208320263.19249S 2
p15316606.4682083197.1463.19250S 2
p16316607.3952083197.1263.192106S 2

 

What do it mean the columns 5 and 6 ?

 

0 Likes
Message 3 of 14

avinash00002002
Collaborator
Collaborator

Colum 4 & 5 is total station identification number. No use of that

0 Likes
Message 4 of 14

komondormrex
Mentor
Mentor

hey,

for that particular csv.

 

(defun c:draw_tower ( / csv_file_name csv_file_id csv_list csv_line min_col_1 min_col_2 min_col_3)
  (setq csv_file_name "YOUR_DRIVE:\\YOUR_PATH\\BK 244.CSV"
	csv_file_id (open csv_file_name "r")
  )
  (while (setq csv_line (read-line csv_file_id))
    	(setq csv_list (append csv_list (list (read (strcat "(" (vl-string-translate "," " " csv_line) ")")))))
  )
  (close csv_file_id)
  (setq csv_list (mapcar '(lambda (coordinates_list) (list (car coordinates_list)
							   (cadr coordinates_list)
							   (caddr coordinates_list)
			  			     )
			  )
			  csv_list
		  )
	min_col_1 (apply 'min (mapcar 'car csv_list))
	min_col_2 (apply 'min (mapcar 'cadr csv_list))
	min_col_3 (apply 'min (mapcar 'caddr csv_list))
	csv_list (mapcar '(lambda (coordinates_list) (list (- (car coordinates_list) min_col_1)
							   (- (cadr coordinates_list) min_col_2)
							   (- (caddr coordinates_list) min_col_3)
						     )
			    )
			 csv_list
		 )
  )
  (foreach line '((2 4) (9 12) (13 16) (2 13) (4 16) (7 5) (5 9) (5 13) (8 6) (6 12) (6 16))
    (vla-addline (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
                         		  (vlax-3d-point (cdr (nth (1- (car line)) csv_list)))
                         		  (vlax-3d-point (cdr (nth (1- (cadr line)) csv_list)))
    )
  )
  (foreach line '((3 4) (11 12) (15 16) (3 11) (11 15) (8 6) (4 12) (12 16))
    (vla-addline (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
                         		  (vlax-3d-point (list (+ 11.5 (car (nth (1- (car line)) csv_list)))
							       		(caddr (nth (1- (car line)) csv_list)))
					    )
                         		  (vlax-3d-point (list (+ 11.5 (car (nth (1- (cadr line)) csv_list)))
							       		(caddr (nth (1- (cadr line)) csv_list)))
					    )
    )
  )
)
0 Likes
Message 5 of 14

leeminardi
Mentor
Mentor

A very simple solution if you just want to import the point into AutoCAD is to use the concatenate command in Excel. Then copy and paste the contents of column G into the command prompt in AutoCAD.

 

Fill down cell G1 which contains

 

=CONCATENATE("point ",A1,",",B1,",",C1)

 

leeminardi_0-1677963351344.pngleeminardi_1-1677963374748.png

 

If you want the points in 2D just set x, y, or z to zero. Or use flatten in AutoCAD.

 

 

lee.minardi
0 Likes
Message 6 of 14

avinash00002002
Collaborator
Collaborator

Hi!

Thanks for your reply, How you coding can you explain because I have to draw plan view also other more tower also. So, I want to try myself.

 

please explain the code.

 

Thanks,

Avinash

0 Likes
Message 7 of 14

komondormrex
Mentor
Mentor

well, program draws lines according to points' marking in your original dwg. points' absolute coordinates are getting from csv file and then converted to relative coordinates by substracting minimum column's value from each coordinate per column. then program draws lines from paired vertices numbered according to rows numbers minus 1 for lisp function 'nth'. front projection comes from 2nd and 3rd coordinates per point from csv, side projection comes from 1st and 3rd coordinates respectively. that's it. 

0 Likes
Message 8 of 14

avinash00002002
Collaborator
Collaborator

II don't understand please elobrate.

 

0 Likes
Message 9 of 14

komondormrex
Mentor
Mentor

you've got absolute coordinanates in XYZ. to draw front projection you need to use X and Z coordinates as X and Y coordinates in X0Y plane. to draw side projection you need to use Y and Z coordinates as X and Y coordinates respectively in X0Y plane too. numbers in sublists in 'foreach' statement are numbers of tower vertices to draw a line from to. 

0 Likes
Message 10 of 14

Sea-Haven
Mentor
Mentor

If you load the points into CIV3D and have matching description keys then it will string correct.

 

Ok now elevation views is easy go to a layout and do mview for each view, 2 ways use VPOINT can set manually -vpoint 1,1,1 or 1,0,0 or 0,1,1 or use the view wheel to set direction.

 

Note did UCS w 1st on dwg

 

SeaHaven_0-1678054653953.png

Whilst you have all the points not sure how auto wise it will know which points join to which points.

 

0 Likes
Message 11 of 14

avinash00002002
Collaborator
Collaborator

I tried myself for creating plan view and it is not working.

 

Code:

(foreach line '((4 2) (2 1) (1 3) (3 4))
(vla-addline (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
(vlax-3d-point (car (nth (1- (car line)) csv_list)))
(vlax-3d-point (cadr (nth (1- (cadr line)) csv_list)))
)
)

 

any idea where I have done a mistake.

 

Thanks,

 

Avinash

0 Likes
Message 12 of 14

komondormrex
Mentor
Mentor

Do you have points' csv for these other towers?

0 Likes
Message 13 of 14

komondormrex
Mentor
Mentor

for left tower front view should go like that

(foreach line '((16 17) (2 10) (10 12) (12 1) (3 7) (7 6) (6 4) (17 6) (16 7))

(vla-addline (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
(vlax-3d-point (car (nth (1- (car line)) csv_list)))
(vlax-3d-point (cadr (nth (1- (cadr line)) csv_list)))
)
)

0 Likes
Message 14 of 14

avinash00002002
Collaborator
Collaborator

yes I have .csv files for all towers

0 Likes