TTR lisp creation

TTR lisp creation

SAPER59
Advocate Advocate
2,086 Views
25 Replies
Message 1 of 26

TTR lisp creation

SAPER59
Advocate
Advocate

I need to create inside Lisp a TTR circle to use as fillet arc between a line and an arc

The point is that when the convexity of the arc changes (try to go far from line end point) the arc is created to the other side, extending the line, when I make a FILLET with R=3

The only way I found is create a TTR circlle, and then trim or break the portion outside intersection objects point

Thanks in advance

0 Likes
Accepted solutions (1)
2,087 Views
25 Replies
Replies (25)
Message 2 of 26

john.uhden
Mentor
Mentor

@SAPER59 ,

I have run into the same thing probably thousands of times in my AutoCAD career and have had to do the same as you.

Never did attempt to program a way around it.  Maybe it's time.

We did have lengthy discussions on tangents this year, so there's probably a lot of pertinent code out there (and in my laptop) to help this adventure along.

John F. Uhden

0 Likes
Message 3 of 26

Sea-Haven
Mentor
Mentor

Ok the answer is like 30+ years old and was in some CIVIL software called Civilcad, the way it worked was to select an approximate center point it would then fillet correctly. There was like 4 possible solutions which you have found with the fillet command, like John its been a problem since Acad was first developed.

 

There is lengthy discussions about it here but they may be a few years old, was always on my to do list, the most obvious is arc arc arc. Started some where may be time to have another go, maybe a ttr and a intersectwith.

0 Likes
Message 4 of 26

devitg
Advisor
Advisor

@SAPER59 


@SAPER59 wrote:

I need to create inside Lisp a TTR circle to use as fillet arc between a line and an arc

 

 

  As I can see at the DWG , it are not LINE , it are POLYLINES

Could it be exploded to be LINE ?

 


 

0 Likes
Message 5 of 26

Sea-Haven
Mentor
Mentor

 The dwg does not make sense, please have another go, a 3 radius from bottom line to arc will result in a double arc result, a very short red section.

0 Likes
Message 6 of 26

komondormrex
Mentor
Mentor

you just need to change the direction of that very pline's arc segment right to the opposite, i.e. if its bulge is negative make it positive and vice versa. then the 'fillet' command will do correct filleting. 

0 Likes
Message 7 of 26

Rick_Tolleshaug_TSC
Advocate
Advocate

Fillet will also execute correctly if you simply increase bulge (tighter radius) of the pline's arc segment but that's not the point.  AutoCAD should radius-fillet predictably in the scenario presented. 

0 Likes
Message 8 of 26

SAPER59
Advocate
Advocate

I can not change the polyline because what I upload was a piece of main object. I know the point is how the arc tangent arrive to the intersection point. Thats why I saw that TTR option in circle doesn't care about bulge and create the circle without problem, and then I can trim it, but because what I need is something inside main application, I need to solve it in another way.

Thanks anyway

0 Likes
Message 9 of 26

SAPER59
Advocate
Advocate

They are arc segement of polyline, and the problem is with arcs, not with lines .

0 Likes
Message 10 of 26

komondormrex
Mentor
Mentor

i did not get it. you do not need to change the entire pline, just sign of the bulge of ONE arc segment. or you cannot change it too? what is the main object for that piece? just curious.

0 Likes
Message 11 of 26

SAPER59
Advocate
Advocate

This objects  are part or complex group of windows profiles.

The point is that some profiles have a bulge and others has inverse of that, so I can't change anything in main profiles, otherwise I will modify main profile.

Is the same if you select one or the other as first object

If you see in second profile where bulge is inverse it does ok

But if you apply TTR circle allway do it inside te profiles, and this will solve the point, trimming the rest of circle between intersection points

0 Likes
Message 12 of 26

Kent1Cooper
Consultant
Consultant

It's not clear to me in the second sample drawing what's "before" and what's "after," what was selected and where, or at what desired radius, etc.

 

BUT all Polyline aspects seem to be at zero width, so there's nothing in that way to be lost by Exploding.  Would it work for you to Explode a profile, save the resulting pieces into a selection set, do the Filleting on just a Line & Arc or two Arcs or two Lines, add the resulting new Arc into the selection set, and finally join that selection set into a Polyline again?

Kent Cooper, AIA
0 Likes
Message 13 of 26

komondormrex
Mentor
Mentor

 

(setq pline_data (entsel "\nPick arc segment: "))
(setq arc_param (fix (vlax-curve-getparamatpoint pline (vlax-curve-getclosestpointto (car pline_data) (cadr pline_data)))))
(vla-setbulge (vlax-ename->vla-object (car pline_data)) arc_param (- (vla-getbulge (vlax-ename->vla-object (car pline_data)) arc_param))) 

 

 komondormrex_0-1730146902932.pngkomondormrex_1-1730146916186.pngkomondormrex_2-1730146935181.png

komondormrex_0-1730147107168.png

 

0 Likes
Message 14 of 26

john.uhden
Mentor
Mentor

@SAPER59 ,

I haven't started on a rebuild, but I did remember something that helps some of the times.

When you pick a point on a line segment, pick nearest the end where you want the fillet.

johnuhden_1-1730151303694.png

 

John F. Uhden

0 Likes
Message 15 of 26

SAPER59
Advocate
Advocate

John

The point is I pick in right point, but when arc end  is like try to go far from the other segment  the fillet arc is drawn in wrong way,  to the other side, so doesn't intersec with main objects as it does when the end try to to go to the other object side

I mean if you see the dwg I upload I need to have the 2nd case of your image, but even picking in point 1 and 2 of sencond image situation if you try for example setting trimmode to 0 you will see the arc is drawn but not in the desired way.

The point as I mentioned if I select circle TTR it does it OK  independent of arc curvature for one or the other side

0 Likes
Message 16 of 26

Sea-Haven
Mentor
Mentor

I like others, a bit lost about what your trying to achieve and working with exploded object as suggested may be a good step forward. If your doing complex 3rd Arc addition then as I suggested need some thing that works with aapproximate center to work out correct direction of a new arc. 

 

As asked already need a before and after dwg, to really see what your starting with and what final result should be.

 

I am sure there is geometry answers just need to find. 2 arcs the same, 2 different options.

SeaHaven_0-1730173961700.png

 

 

 

0 Likes
Message 17 of 26

komondormrex
Mentor
Mentor

fyi, distance between mid points of arc segment and reversed arc segment is 1.42091e-11.

0 Likes
Message 18 of 26

Rick_Tolleshaug_TSC
Advocate
Advocate

SAPER59,

I developed and sold a collection of Polyline editing tools in 2004 called TSPedit(tm) back when AutoCAD could not fillet polylines. I have extracted the portions of that code and nearly done reworking it to create a simple but reliable PLine Fillet command.  I will be posting later today.

0 Likes
Message 19 of 26

SAPER59
Advocate
Advocate

OK Rick, I will have a look when you have uploaded it to see if I can arrive to a solution using and updating it to my requirements

Thanks in advance

0 Likes
Message 20 of 26

Rick_Tolleshaug_TSC
Advocate
Advocate
Accepted solution

Gustavo,

Sorry it took a day longer to get this to you but here it is. The attached LISP file defines command PLFILLET which is intended to be an adjunct to AutoCAD’s FILLET command, not replace it. It is designed to fillet Polylines primarily. Think of PLFILLET as a command to use when AutoCAD's FILLET fails to yield a desired result when filleting Polylines, like the scenario you originally posted.

 

Where PLFILLET can step in when AutoCAD's FILLET falls short:
 1. filleting non-adjacent segments on a single polyline
 2. filleting a Polyline and Arc object
 3. radius-filleting Polyline arc segments with very large radii (your scenario)

 

Try it out and let me know if this will serve your needs or not.  Thanks.

0 Likes