how to create Dimensions in given chainage with given depth?

how to create Dimensions in given chainage with given depth?

sharmaudit1189
Participant Participant
924 Views
16 Replies
Message 1 of 17

how to create Dimensions in given chainage with given depth?

sharmaudit1189
Participant
Participant

I have one excel with chainage and Depth. I want to create dimension with specific chainage as per output.

If anyone help me than it would be great.

Thanks in advance

 

Input:

Input.jpg

Output :

Output.jpg

 

0 Likes
925 Views
16 Replies
Replies (16)
Message 2 of 17

Moshe-A
Mentor
Mentor

@sharmaudit1189  hi,

 

Attached cdepth.zip contains 5 files:

 

cdepth.lsp => the program

cdepth.csv => data csv (excel) file

arr0.dwg => block

arr1.dwg => block

gl.dwg => block

 

make a new folder and extract these files inside

add this folder to AutoCAD support files search path

load the lisp invoke CDEPTH command

 

some info were missing:

1. your csv data file?

2. the distance between stations?

3. the overall scale?

4. some layers?

 

enjoy

Moshe

 

 

0 Likes
Message 3 of 17

sharmaudit1189
Participant
Participant

some info were missing:

1. your csv data file?

CSV as look like in input

2. the distance between stations?

3mtr

3. the overall scale?

1

4. some layers?

 

0 Likes
Message 4 of 17

sharmaudit1189
Participant
Participant

Thanks for your effort @Moshe-A, But its not work as per output.

 

0 Likes
Message 5 of 17

Moshe-A
Mentor
Mentor

@sharmaudit1189 hi,

 


@sharmaudit1189 wrote:

Thanks for your effort @Moshe-A, But its not work as per output.

 


1. help me to understand what to do with the above reply???

2. took you 4 days to reply, so you competly not interested in this lisp.

 

send your csv

3 m does not correlate to your picture

adding text to drawing must be subject to plot scale (can not be 1)

privide your layers name

 

Moshe

 

0 Likes
Message 6 of 17

sharmaudit1189
Participant
Participant

Please find attached csv file

 

0 Likes
Message 7 of 17

sharmaudit1189
Participant
Participant

Here is ground level as a chainage 3,6,9,12.....

and depth from ground level which we need in dimension below to the ground.

Only ground line and chainage text and dimension below to ground level is best to this profile

Thanks in advance

 

0 Likes
Message 8 of 17

Moshe-A
Mentor
Mentor

@sharmaudit1189 

 

give this a try 

 

a sample run is also attached

 

works?

0 Likes
Message 9 of 17

sharmaudit1189
Participant
Participant

Thanks for your effort but in this lisp, we have to add each an every value. Could it be possible in automatics (all dimensions are create in one time) 

0 Likes
Message 10 of 17

sharmaudit1189
Participant
Participant

I want to place dimension here from csv in equal (3mtr) distances.

0 Likes
Message 11 of 17

Moshe-A
Mentor
Mentor

@sharmaudit1189 ,

 

On message #4 you said it does not work, before you jump to more request i want to know does the last version works as you request in message 1?

 

 

 

 

0 Likes
Message 12 of 17

komondormrex
Mentor
Mentor

check this one

 

(defun c:dim_chainage (/ csv_file_id chain chain_depth_list chain_origin chain_pline depth_pline chain_vertices depth_vertices ruc dimension alignment_point chain_text)
  	(setq csv_filename (acet-ui-getfile "Select Chainage/Depth CSV filename"
					     ""
					     "csv"
					     ""
					     2
			   )
  	      csv_file_id (open csv_filename "r")
	)
  	(read-line csv_file_id)
	(while (setq chain (read-line csv_file_id))
		(setq chain_depth_list (append chain_depth_list (list (read (strcat "(" (vl-string-translate "," " " chain) ")")))))
	)
  	(close csv_file_id)
  	(setq chain_origin (getpoint "\nPick point for chain origin: ")
	      chain_pline (vla-addlightweightpolyline (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
						      (vlax-safearray-fill (vlax-make-safearray vlax-vbdouble (cons 1 (* 2 (length chain_depth_list))))
									   (apply 'append (setq chain_vertices (mapcar '(lambda (chain) (mapcar '+ chain_origin (list (car chain) 0))) chain_depth_list)))
						      )
			  )
	      depth_pline (vla-copy chain_pline)
	)
  	(vla-put-coordinates depth_pline
	  		     (vlax-safearray-fill (vlax-make-safearray vlax-vbdouble (cons 1 (* 2 (length chain_depth_list))))
			       			  (apply 'append (setq depth_vertices (mapcar '(lambda (chain) (mapcar '+ chain_origin (list (car chain) (* -1 (cadr chain))))) chain_depth_list)))
			     )
	)
  	(vla-put-color chain_pline 1)
  	(vla-put-color depth_pline 2)
  	(mapcar '(lambda (dim_point_1 dim_point_2 number) (progn
								(setq dimension (vla-adddimrotated (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
										     		   (vlax-3d-point dim_point_1)
										     		   (vlax-3d-point dim_point_2)
										                   (vlax-3d-point dim_point_2)
										                   (* 0.5 pi)
										)
							      	)
							    	(vla-put-color dimension 3)
							    	(vlax-put dimension 'extline1suppress 1)
							    	(vlax-put dimension 'extline2suppress 1)
							    	(vla-put-arrowheadsize dimension 1.0)
							    	(vla-put-textheight dimension 0.75)
							     	(vlax-put dimension 'textinside 1)
							    	(vlax-put dimension 'textinsidealign 1)
							    	(vlax-put dimension 'forcelineinside 0)
							    	(vlax-put dimension 'suppresstrailingzeros 0)
							     	(vla-getboundingbox (vlax-ename->vla-object (entlast)) nil 'ruc)
								(setq chain_text (vla-addtext (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
										  	      (itoa (car number))
										  	      (setq alignment_point (vlax-3d-point (list (car dim_point_1) (+ 0.25 (cadr (vlax-safearray->list ruc))))))
										  	      0.5
									  	 )
								)
							    	(vla-put-color chain_text 7)
								(vla-put-alignment chain_text 1)
							    	(vla-put-textalignmentpoint chain_text alignment_point)
					    		  )
		 )
		 chain_vertices
		 depth_vertices
		 chain_depth_list
	)
	(princ)
)

 

0 Likes
Message 13 of 17

sharmaudit1189
Participant
Participant

Yes but in one time one dimension is create. So please guide me that create profile in one time.

0 Likes
Message 14 of 17

sharmaudit1189
Participant
Participant

Thanks for your effort but when i run this lisp only pline is create.

I want create dimension ever 3 mtr as per defined in csv. 

0 Likes
Message 15 of 17

komondormrex
Mentor
Mentor

if it does not draw dimensions than it should stop with an error which is output in the text window. what is it? 

this is what i've got on my side using your csv.

komondormrex_0-1694164942168.png

 

0 Likes
Message 16 of 17

sharmaudit1189
Participant
Participant

Lot of Thanks @komondormrex, its works

0 Likes
Message 17 of 17

sharmaudit1189
Participant
Participant

Could you please edit this, which is work from excel also.

 

Thanks and regards

0 Likes