visible stretching of polyline poligon

visible stretching of polyline poligon

miroslav.pristov
Advocate Advocate
1,056 Views
9 Replies
Message 1 of 10

visible stretching of polyline poligon

miroslav.pristov
Advocate
Advocate

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.

 

Untitled.jpg

 

thanks for your time and effort.

0 Likes
1,057 Views
9 Replies
Replies (9)
Message 2 of 10

Kent1Cooper
Consultant
Consultant

@miroslav.pristov wrote:

.... 

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. ... i need to see poligon stretching because I will put it correctly between the lines and it dont touch them. 

....


If you could have the corners of the shorter rectangle touch the yellow Lines, or even if they should end up a specific distance from them, I can imagine a way to do this, without the need for you to see it Stretching and presumably eyeball the final position.  When you say "put it correctly," if "correctly" can be defined adequately, the routine can do that for you.  Is that "correct" relationship something you can define?

 

[By the way, doing it manually, if the rectangle corners can touch the Lines, would be a lot easier by Stretching from a corner of the rectangle to an intersection of the corresponding long edge with a yellow Line, than from A to C and B to D.]

Kent Cooper, AIA
0 Likes
Message 3 of 10

miroslav.pristov
Advocate
Advocate

ok then let it be ofset 5 from yelow lines. the distance of corners

0 Likes
Message 4 of 10

miroslav.pristov
Advocate
Advocate

its no important to me how you manage with that. i only need polyline pooligon not to touch yellow objects and to be between them. the line AB must stay as it is

0 Likes
Message 5 of 10

elshawadfy
Collaborator
Collaborator

Is this what you need? (see the drawing below)..

0 Likes
Message 6 of 10

miroslav.pristov
Advocate
Advocate

yes something like that, but dont need those white lines visible besides yellow lines. And to mention those yellow lines can be everything, single line, polyline or polygon, circle etc

0 Likes
Message 7 of 10

elshawadfy
Collaborator
Collaborator

The white lines are on a none-plot layer..

 

As for the rest, now the only solution would programming.. Dynamic constrains won't suffice..

0 Likes
Message 8 of 10

miroslav.pristov
Advocate
Advocate

Actually i dont need programing. if is possible to make visible stretch of polygon. that is all what i need. and to define those points

0 Likes
Message 9 of 10

elshawadfy
Collaborator
Collaborator

OK.. Try this dynamic block then:


1- Use the align paramiter to align to to the axis..

2- Drag the grips in the extention of the long side of the grey regtangle until you intersect the yellow lines

(the rectangle also on a none-plottable layer that you can turn off)..

3- you can modify the dimensions and offsets within the block, but revise the actions accordingly..

0 Likes
Message 10 of 10

miroslav.pristov
Advocate
Advocate

thank you on your effort but actualy i need that few lines in routine to finish the rest what i want

0 Likes