Jump to content

Is there a lisp to fillet non-coplanar lines/plines with different Z values?


Recommended Posts

Posted

Is there a lisp to fillet non-coplanar lines/plines with different Z values without setting Z and/or elevation of the lines to have the same value seperately? Thanks in advance.

Posted

Could you show us what you want the end result to look like?

For one thing... it won't be polylines, those need to be drawn in 1 plane.

3D polyline is possible, lines are possible.

 

Perhaps a sample dwg upload ?

Posted
7 minutes ago, Emmanuel Delay said:

Could you show us what you want the end result to look like?

For one thing... it won't be polylines, those need to be drawn in 1 plane.

3D polyline is possible, lines are possible.

 

Perhaps a sample dwg upload ?

 

lines.dwg

Posted

The two lines in your sample drawing are very close to be coplanar.   A lisp program could define a ucs via 3 points (the two ends of one line and one end of the other line) and then use flatten to yield two lines that could be filleted.  Would this be acceptable?

  • Like 1
Posted

See if you like this.

It's only for LINES. 

It can be expanded to work for more types of elements, but that would complicate it.  

 

You select the two lines, then you need to pick 1 point: this point sets the elevation for the end result.

The code sets all 4 endpoints to that elevation (Z-position)

Then a standard fillet is done.

 

 

(defun drawLine (p1 p2)
 (entmakex (list (cons 0 "LINE")
                 (cons 10 p1)
                 (cons 11 p2))))

;; FNC for fillet Non Colinear				   
(defun c:fnc ( / obj1 obj2 elvp elv p1 p2 p3 p4 p1_ p2_ p3_ p4_ )
	
	(setq obj1 (car (nentsel "\nLine1: ")))
	(setq obj2 (car (nentsel "\nLine2: ")))
	
	(setq elvp (getpoint "\nSelect a point for the elevation: "))
	
	;; endpoints
	(setq 
		p1 (cdr (assoc 10 (entget obj1)))
		p2 (cdr (assoc 11 (entget obj1)))
		p3 (cdr (assoc 10 (entget obj2)))
		p4 (cdr (assoc 11 (entget obj2)))
		
		elv (if (nth 2 elvp) (nth 2 elvp) 0.0)
	)
	;; endpoints, but all on the same elevation
	(setq 
		p1_ (list (nth 0 p1) (nth 1 p1) elv) 
		p2_ (list (nth 0 p2) (nth 1 p2) elv) 
		p3_ (list (nth 0 p3) (nth 1 p3) elv) 
		p4_ (list (nth 0 p4) (nth 1 p4) elv) 
	)
	
	
	;; let's put the elevation of the lines even
	(entmod (subst
		(cons 10 p1_)
		(assoc 10 (entget obj1))
		(entget obj1)
	))
	(entmod (subst
		(cons 11 p2_)
		(assoc 11 (entget obj1))
		(entget obj1)
	))
	
	(entmod (subst
		(cons 10 p3_)
		(assoc 10 (entget obj2))
		(entget obj2)
	))
	(entmod (subst
		(cons 11 p4_)
		(assoc 11 (entget obj2))
		(entget obj2)
	))
	
	(command "_fillet" obj1 obj2)
	(princ)
)

 

  • Like 1
Posted
3 hours ago, lrm said:

The two lines in your sample drawing are very close to be coplanar.   A lisp program could define a ucs via 3 points (the two ends of one line and one end of the other line) and then use flatten to yield two lines that could be filleted.  Would this be acceptable?

 

Yes, this woould work for me.

Posted

Busy day today but my solution is just shooting whoever gave you a drawing with lines at the wrong levels? Would that work as a lesson for them?

 

A lot of my work is 2d and so I'd be tempted to set the axis for both to be the same (remembering the original draughter has just been shot, have to do it myself).

 

If you need it to join from one 'z''; level to another you might need a temporary construction line to make the fillet (or some maths), rotate the view, rotate the fillet from horizontal and join the ends to the upper line. Yup a LISP for that.

 

However a busy day, there is a cake in the oven , one to look at later if that's what you want

 

 

  • Like 1

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...