SLW210 Posted June 6 Posted June 6 Any thoughts on the best method to do an offset or stretch on a taper? It would be nice to go both directions, since people change their minds. The amount of offset varies and so does the tapers, etc. The arcs and side tapered parts would be nice to do if possible, but just the tops need extended for now. Offset at taper.dwg Quote
CyberAngel Posted June 6 Posted June 6 If the sides are parallel, you could set the UCS to them and stretch with ortho on. Too simple? 1 Quote
devitg Posted June 6 Posted June 6 1 hour ago, SLW210 said: Any thoughts on the best method to do an offset or stretch on a taper? It would be nice to go both directions, since people change their minds. The amount of offset varies and so does the tapers, etc. The arcs and side tapered parts would be nice to do if possible, but just the tops need extended for now. Offset at taper.dwg 114.32 kB · 1 download Why not the old OFFSET command ? Command: _offset Current settings: Erase source=No Layer=Source OFFSETGAPTYPE=0 Specify offset distance or [Through/Erase/Layer] <Through>: Specify second point: Select object to offset or [Exit/Undo] <Exit>: Specify point on side to offset or [Exit/Multiple/Undo] <Exit>: Select object to offset or [Exit/Undo] <Exit>: *Cancel* Command: Offset at taper by offset command-Model.pdf Offset at taper by offset command.dwg 1 Quote
Stefan BMR Posted June 6 Posted June 6 Hi I have something that works fine with straight segments, but fails if the picked segment or the connected ones are bulged. It uses grread with a rudimentary osnap implementation and it just allow picking points, you can't specify offset distance. 1 Quote
troggarf Posted June 6 Posted June 6 This link does this but it asks for an area instead of a length 1 Quote
SLW210 Posted June 6 Author Posted June 6 2 hours ago, CyberAngel said: If the sides are parallel, you could set the UCS to them and stretch with ortho on. Too simple? Hence the Taper part of my question, only need to adjust the top height, the sides are tapered 1 hour ago, devitg said: Why not the old OFFSET command ? Command: _offset Current settings: Erase source=No Layer=Source OFFSETGAPTYPE=0 Specify offset distance or [Through/Erase/Layer] <Through>: Specify second point: Select object to offset or [Exit/Undo] <Exit>: Specify point on side to offset or [Exit/Multiple/Undo] <Exit>: Select object to offset or [Exit/Undo] <Exit>: *Cancel* Command: Offset at taper by offset command-Model.pdf 9.38 kB · 1 download Offset at taper by offset command.dwg 97.16 kB · 0 downloads That offset the entire shape, as in the image and .dwg, just the top line in this example. 28 minutes ago, Stefan BMR said: Hi I have something that works fine with straight segments, but fails if the picked segment or the connected ones are bulged. It uses grread with a rudimentary osnap implementation and it just allow picking points, you can't specify offset distance. That looks workable. 22 minutes ago, troggarf said: This link does this but it asks for an area instead of a length I might could adapt something in that thread. Quote
BIGAL Posted June 6 Posted June 6 My idea is must be a pline else pick the 3 lines, when you select a pline segment can get angle of segment so the offset is a sin cos tan answer using polar with corrected distance, then just redo the vertice X&Y value. I think its cos ang * offset. ang is 90 to offest line. maybe later today 1 Quote
GLAVCVS Posted June 7 Posted June 7 (edited) I think the most important thing is to have something that returns a list of the three segments involved in the modification: - the segment to the left of the selected one - the selected segment - the segment to the right of the selected one. Once this is done, it's a matter of moving the selected segment and calculating the new vertices with the other two segments by calculating intersections. I've attached some code for this. Note that: x = list of an lwpolyline returned by entget pk = point returned by entsel when selecting the segment on the screen (defun dameSgmtos (x pk / f d p i s a tam a1 a2 b1 b2 c1 c2 sa sp) (setq tam (* (* (getvar "PICKBOX") (/ (getvar "VIEWSIZE") (cadr (getvar "SCREENSIZE")) ) ) 2 ) b1 (cdr (assoc 10 x)) b2 (cdr (assoc 10 (cdr (member (cons 10 b1) x)))) c2 (cdr (assoc 10 (reverse x))) c1 (cdr (assoc 10 (cdr (member (cons 10 c2) (reverse x))))) ) (while (and (setq a1 (cdr p) a2 f f (cdr (assoc (if pk 10 11) (setq x (cdr (member (setq p (assoc 10 x)) x)))))) (if pk (not (inters f (cdr p) (polar pk (+ (setq a (angle f (cdr p))) 1.5708) tam) (polar pk (- a 1.5708) tam)))) ) ) (setq sc (list (cdr p) f) f (cdr (assoc (if pk 10 11) (cdr (member (setq p (assoc 10 x)) x)))) sp (if f (list (cdr p) f) (list b1 b2)) sa (if a1 (list a1 a2) (list c1 c2)) ) (list sa sc sp) ) If you do not find a way to use it, I'll try to do it this afternoon or tomorrow. But this is not certain because I have been quite busy for a few days. Edited June 8 by GLAVCVS 1 Quote
BIGAL Posted June 7 Posted June 7 @GLAVCVS agree need the 3 sides, then can work out the internal angle which results in working out the new length of the side lines and a new point, then update the points. This is get segment of pline. (defun getplineseg ( / elst ename pt param preparam postparam) (setq elst (entsel "\nSelect pline segment: ")) (setq ename (car elst)) (setq pt (cadr elst)) (setq pt (vlax-curve-getClosestPointTo ename pt)) (print (setq param (vlax-curve-getParamAtPoint ename pt)) ) (print (setq preparam (fix param)) ) (print (setq postparam (1+ preparam)) ) (setq pt1 (vlax-curve-getPointAtParam ename preparam) pt2 (vlax-curve-getPointAtParam ename postparam)) ) I would have a go but very busy at moment. maybe later on have a couple of outstanding tasks. Some one welcome to use the code provided as a start point, get internal angle is out there also. 1 Quote
GLAVCVS Posted June 8 Posted June 8 I think it turned out nicely. And I hope it's what you need, too ;******************* p o r d e s í a r g o ******************** ;************************ G L A V C V S ************************* ;************************** F E C I T *************************** (defun c:mueveSegmto (/ lstSg dist i se lado op pr pr1 pa pb p1 p2 p3 p4 sgC r dameSgmtos) (defun dameSgmtos (x pk / f d p s a tam a1 a2 b1 b2 c1 c2 sa sp) (setq tam (* (* (getvar "PICKBOX") (/ (getvar "VIEWSIZE") (cadr (setq ss (getvar "SCREENSIZE"))) ) ) 2 ) b2 (cdr (assoc 10 (cdr (member (cons 10 (setq b1 (cdr (assoc 10 x)))) x)))) c1 (cdr (assoc 10 (cdr (member (cons 10 (setq c2 (cdr (assoc 10 (reverse x))))) (reverse x))))) ) (while (and (setq a1 (cdr p) a2 f f (cdr (assoc (if pk 10 11) (setq x (cdr (member (setq p (assoc 10 x)) x)))))) (not (setq i (inters f (cdr p) (polar pk (+ (setq a (angle f (cdr p))) 1.5708) tam) (polar pk (- a 1.5708) tam)))) ) ) (setq sc (list (cdr p) f) f (cdr (assoc (if pk 10 11) (cdr (member (setq p (assoc 10 x)) x)))) sp (if f (list (cdr p) f) (list b1 b2)) sa (if a1 (list a1 a2) (list c1 c2)) ) (list sa sc sp) ) (setq dist (getreal "\nDistance of traslation (ENTER to get the distance on screen): ")) (if (setq lstSg (dameSgmtos (entget (car (setq se (entsel "\nSelect any segment in LWPOLYLINE...")))) (setq pr (cadr se)))) (if (setq pr1 (getpoint (setq pr i) "\nSide to act...")) (if (setq op (if (and (> (setq aC (angle (setq p2 (car (setq sgC (cadr lstSg)))) (cadr sgC))) (setq aR (angle pr pr1))) (< (abs (- aC aR)) PI) ) - + ) ) (setq dist (if dist dist (distance pr1 (inters p2 (setq p3 (cadr sgC)) (polar pr1 (- (setq ar (angle p2 p3)) (/ pi 2)) 9999) (polar pr1 (+ aR (/ pi 2)) 9999) nil)) ) pa (polar p2 (setq a (op (angle p2 (setq p3 (cadr sgC))) (/ pi 2.0))) dist) pb (polar p3 a dist) px1 (inters pa pb (car (car lstSg)) p2 nil) px2 (inters pa pb p3 (cadr (last lstSg)) nil) r (entmod (subst (cons 10 px1) (cons 10 p2) (entget (car se)))) r (entmod (subst (cons 10 px2) (cons 10 p3) (entget (car se)))) ) ) ) ) (princ) ) 1 Quote
GLAVCVS Posted June 8 Posted June 8 (edited) PS: The option to measure the offset distance with the cursor will always be calculated orthogonally with respect to the vector defined by the selected segment It is also possible that I have forgotten to include some of the variables in the list of local variables: this is a small job that I leave for whoever wants to use this code. Edited June 8 by GLAVCVS 1 Quote
ScottMC Posted June 9 Posted June 9 Simply nice and useful as being able to enter distance and use entity snaps helps much! -- Keep up the good work. Quote
SLW210 Posted June 10 Author Posted June 10 I've been out of town, I'll give everything a look tomorrow when I get back to work. Quote
GLAVCVS Posted June 11 Posted June 11 Better armored version, proof against extravagant users ;******************* p o r d e s í a r g o ******************** ;************************ G L A V C V S ************************* ;************************** F E C I T *************************** (defun c:mueveSegmto (/ lstSg dist i se lado op pr pr1 pa pb p1 p2 p3 p4 sgC r aC aR asr dameSgmtos erroria errores error0) (defun erroria () (defun errores (mens) (setq *error* error0) (prin1) ) (setq error0 *error* *error* errores ) ) (defun asr (p1 p2 p3 / a b) (if (> (abs (- (setq a (angle p1 p2)) (setq b (angle p2 p3)))) PI) (if (< a b) (if (> (+ a PI PI) b) - +) (if (> (- a PI PI) b) - +) ) (if (> a b) - +) ) ) (defun dameSgmtos (x pk / f d p s a tam a1 a2 b1 b2 c1 c2 sa sp) (if (= (cdr (assoc 0 x)) "LWPOLYLINE") (progn (setq tam (* (* (getvar "PICKBOX") (/ (getvar "VIEWSIZE") (cadr (setq ss (getvar "SCREENSIZE"))) ) ) 2 ) x (if (= (rem (cdr (assoc 70 x)) 2) 1) (cons (assoc 10 (reverse x)) x) x) b2 (cdr (assoc 10 (cdr (member (cons 10 (setq b1 (cdr (assoc 10 x)))) x)))) c1 (cdr (assoc 10 (cdr (member (cons 10 (setq c2 (cdr (assoc 10 (reverse x))))) (reverse x))))) ) (while (and (setq a1 (cdr p) a2 f f (cdr (assoc (if pk 10 11) (setq x (cdr (member (setq p (assoc 10 x) ) x)))))) (not (setq i (inters f (cdr p) (polar pk (+ (setq a (angle f (cdr p))) 1.5708) tam) (polar pk (- a 1.5708) tam)) )) ) ) (setq sc (list (cdr p) f) f (cdr (assoc (if pk 10 11) (cdr (member (setq p (assoc 10 x)) x)))) sp (if f (list (cdr p) f) (list b1 b2)) sa (if a1 (list a1 a2) (list c1 c2)) ) (list sa sc sp) ) ) ) (erroria) (setq dist (getreal "\nDistance of traslation (ENTER to get the distance on screen): ")) (if (setq lstSg (dameSgmtos (entget (car (setq se (entsel "\nSelect any segment in LWPOLYLINE...")))) (setq pr (cadr se)))) (if (setq pr1 (getpoint (setq pr i) "\nSide to act...")) (if (setq op (asr (setq p2 (car (setq sgC (cadr lstSg)))) pr pr1)) (setq dist (if dist dist (distance pr1 (inters p2 (setq p3 (cadr sgC)) (polar pr1 (- (setq aR (angle p2 p3)) (/ pi 2)) 9999) (polar pr1 (+ aR (/ pi 2)) 9999) nil)) ) pa (polar p2 (setq a (op (angle p2 (setq p3 (cadr sgC))) (/ pi 2.0))) dist) pb (polar p3 a dist) px1 (inters pa pb (car (car lstSg)) p2 nil) px2 (inters pa pb p3 (cadr (last lstSg)) nil) r (entmod (subst (cons 10 px1) (cons 10 p2) (entget (car se)))) r (entmod (subst (cons 10 px2) (cons 10 p3) (entget (car se)))) ) ) ) (princ "\nSelected object is not LWPOLYLINE....Exiting...") ) (princ) ) 1 3 Quote
pkenewell Posted June 11 Posted June 11 On 6/6/2025 at 8:03 AM, SLW210 said: The arcs and side tapered parts would be nice to do if possible, but just the tops need extended for now. @SLW210 FWIW, The arc sections could be much more complicated than they seem. I guess it depends on the relationships you're trying to maintain - such as tangency. A good way to see this is by adding some tangency parametric constraints, then offsetting an arc segment, then see what happens to the shape when you relocate the vertices. The examples below is not perfect, but you can see how the shape effects all the other arc features. 1 Quote
GLAVCVS Posted June 11 Posted June 11 54 minutes ago, pkenewell said: @SLW210 FWIW, The arc sections could be much more complicated than they seem. I guess it depends on the relationships you're trying to maintain - such as tangency. A good way to see this is by adding some tangency parametric constraints, then offsetting an arc segment, then see what happens to the shape when you relocate the vertices. The examples below is not perfect, but you can see how the shape effects all the other arc features. Arc segments aren't covered in the code. We don't even know (at least I don't) how they should behave when offsetting. 1 Quote
SLW210 Posted June 11 Author Posted June 11 The small radii are irrelevant (sort of) it's the larger radii that would change, the smaller in between are just rounded off. Examples: Offset at taper 2.dwg 1 Quote
SLW210 Posted June 11 Author Posted June 11 I currently just explode them, PEdit them back to Plines, offset, then extend/trim as needed. The smaller round offs I just use Circle, TTR and guess a good radius, usually between 1-1/2" - 3" or 4" and trim. 1 Quote
pkenewell Posted June 11 Posted June 11 (edited) This is something that could possibly be done geometrically, but a robust solution would be better done mathematically. I don't know exactly how I would handle it, but it would be a good challenge for some of the better mathematical programmers that are here. EDIT: perhaps this would involve changing the bulge values to the selected segments and the adjacent segments by some inversely proportional amount? Maybe using: https://www.lee-mac.com/bulgeconversion.html Edited June 11 by pkenewell 1 Quote
Recommended Posts
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.