visible stretching of polyline poligon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello all, i made list for making simple line and closed polyline like in picture bellow. the routine looks like this. I need to modify it, and i try to explain what i want.
(defun C:strechpol ( / *error* oOSMODE tA tB t1 t2 t3 t4)
(defun *error* (errmsg)
(if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
(princ (strcat "\nError: " errmsg))
)
(setvar 'OSMODE oOSMODE)
(princ)
)
(setq oOSMODE (getvar 'OSMODE))
(setq tA (getpoint "\n First point A "))
(setq tB (getpoint "\n Second point B "))
(setq a (getreal "\n Insert dimension a: "))
(setq b (getreal "\n Insert dimension b: "))
(setq ang (angle tA tB))
(SETQ ANP (+ ANG (* PI 0.5)))
(SETQ T1 (POLAR TA ANP A))
(SETQ T4 (POLAR TA ANP (- B)))
(SETQ T2 (POLAR TB ANG A))
(SETQ T3 (POLAR TB ANP (- B))))
(command "_line" tA tB "")
(command "_pline" t1 t2 t3 t4 t1 "")
(setvar 'OSMODE oOSMODE)
(princ)
)On picture as you see i have magenta line AB, and that line cant change. Points TA and TB are fixed. From it I made closed polyline T1, T2, T3 and T4 (blue polygon). In many cases this is only what i need. But there is a cases where I have some lines which intersect magenta line like those yellow ones and then I need blue poligon to be between yellow lines.
There are no specific requirements, such as the distance from the polygon to yellow lines, lenght of polygon or something like that. I just need to have a option to stretch the blue polygon from point A to new pick point C, and from point B to new pick point D. the polygon must stay in direction of line AB. when doing this, all the time, i need to see poligon stretching because I will put it correctly between the lines and it dont touch them.
As I said earlier the line AB must stay on place and I need new (setq TC... ) (setq TD...) and new changed (setq T1... )(setq T2... )(setq T3.. )(setq T4... )
because i need them later for continuing my routine.
And here is a picture, and example file is attached too.
thanks for your time and effort.