Arc and Line joining

Arc and Line joining

Pihu_2024
Enthusiast Enthusiast
545 Views
7 Replies
Message 1 of 8

Arc and Line joining

Pihu_2024
Enthusiast
Enthusiast

Dear Sir,

 

Please find the attached sample drawing.

I want to Arc and Line joining programming.

0 Likes
Accepted solutions (1)
546 Views
7 Replies
Replies (7)
Message 2 of 8

Brock_Olly
Collaborator
Collaborator

if they were closed, they could be joined with JOIN.
Now when zooming in they are not closed, which point should the program take?
Arc, Line or in the middle?

Brock_Olly_0-1742824575670.png

 

0 Likes
Message 3 of 8

ВeekeeCZ
Consultant
Consultant

done by

removing all the straight segments - select similar 

convert all arc segments to pl

mpedit add type with 80 fuzz 

all done

0 Likes
Message 4 of 8

ronjonp
Mentor
Mentor

@Pihu_2024 Why aren't you using a block for this?

Message 5 of 8

Pihu_2024
Enthusiast
Enthusiast

Dear Sir,

 

This is default block output the software. I am not making.

0 Likes
Message 6 of 8

ВeekeeCZ
Consultant
Consultant

Right. Since 2025 introduced so cool tool to blockify repetitive geometries... it would be an easy job to do. Unless... wait, it's not a chair or sink.. so it might not work. Who knows, it's experimental.

Message 7 of 8

komondormrex
Mentor
Mentor
Accepted solution

provided that

1. arcs and 2d-polylines were generated with some software

2. user has not changed any of those

and no extra sorting is needed, check this starting one.

you need to select paired arcs and 2d-plines and that's it.

(defun c:make_oval (/ arc_line_sset less_more_list more_less_list)
	(if (setq arc_line_sset (ssget '((0 . "polyline,arc"))))
		(progn
    		(foreach object (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex arc_line_sset))))
    		  	(cond
					((= "AcDbArc" (vla-get-objectname object))
						(if (< (vla-get-startangle object) (vla-get-endangle object))
							(setq less_more_list (cons object less_more_list))
							(setq more_less_list (cons object more_less_list))
						)
					)
					(t)
				)
    		)
			(if (and less_more_list 
					 more_less_list
					 (= (length less_more_list) (length more_less_list))  
				)
				(progn
					(mapcar '(lambda (<arc> >arc<) (vla-put-closed (vla-addlightweightpolyline (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
																		   					   (vlax-safearray-fill (vlax-make-safearray vlax-vbdouble '(0 . 7))
																		   											(apply 'append (mapcar '(lambda (point) (mapcar '+ '(0 0) point)) 
																		   															 		(list (vlax-get <arc> 'startpoint) (vlax-get <arc> 'endpoint)
																		   															 			   (vlax-get >arc< 'startpoint) (vlax-get >arc< 'endpoint)
																		   															 		)
																		   														   )
																		   											)
																		   					   )
																   )
																   :vlax-true
												   )
												   (vla-setbulge (vlax-ename->vla-object (entlast)) 0 1)
												   (vla-setbulge (vlax-ename->vla-object (entlast)) 2 1)
							 )
							 less_more_list
							 more_less_list
					)
					(command "_erase" arc_line_sset "")
				)
			)
		)
	)
)

 

Message 8 of 8

Pihu_2024
Enthusiast
Enthusiast

Thanks Sir,

 

Working is very good.

0 Likes