Jump to content

Select Vertex from Rectangles


Juergen

Recommended Posts

Hi,

is it possible to select rectangles, then select a vertex and this selection will be accept for the other rectangles?

 

Thanks.

Link to comment
Share on other sites

So select rectangles then pick a corner and it finds same corner is that right ?

 

Ok so UL LL UR LR are 4 corners if rectangs are always ortho then its easy use VL bounding box.

 

have to go now will try later to write something.

Link to comment
Share on other sites

; https://www.cadtutor.net/forum/topic/75273-select-vertex-from-rectangles/
; Corner select by Alanh May 2022

(defun c:wow ( / ss cnr pointmin pointmax obj )
(setq ss (ssget (list (cons 0 "LWPOLYLINE"))))
(if (= ss nil)
(alert "No objects match so skipping")
(progn
(setq lst '())
(setq cnr (getstring "\n Enter UL LL UR or LR  "))
(repeat (setq x (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1)))))
(vla-GetBoundingBox obj 'minpoint 'maxpoint)
(setq pointmin (vlax-safearray->list minpoint))
(setq pointmax (vlax-safearray->list maxpoint))
(cond
((= (strcase cnr) "UL")(setq pt (list (car pointmin) (cadr pointmax)))(setq lst (cons pt lst)) )
((= (strcase cnr) "LL")(setq pt (list (car pointmin) (cadr pointmin)))(setq lst (cons pt lst)) )
((= (strcase cnr) "UR")(setq pt (list (car pointmax) (cadr pointmax)))(setq lst (cons pt lst)) )
((= (strcase cnr) "LR")(setq pt (list (car pointmax) (cadr pointmin)))(setq lst (cons pt lst)) )
)
)
)
)
(princ lst)
(princ)
)

Try this as a start can do the corner select better.

Edited by BIGAL
Link to comment
Share on other sites

Hi Bigal,

 

thank you for writing the program,

but it should work eg. the strech function.

 

It could be that a rectangle in the line must not

be to strech.

Link to comment
Share on other sites

If your just trying to stretch say all bottoms you do not need code stretch works that way when you use a partial window just window all bottoms.

 

Explain more.

Link to comment
Share on other sites

The reason why you can't grab multiple sides of a rectangle with handles by default in CAD is that they are not modified together.

Except for the STRETCH command

 

If you want to stretch each side of the rectangle with a constant offset, you can use the basic STRETCH command. 

As gif below

2022-05-30%2020;31;54.gif

 

2022-05-30%2020;29;43.gif

 

But for a simple rectangle, you can get information on each corner like BIGAL's code

and you can add some loop code for each rectangle to make it look like it's stretched together.

 

In this case, have to select the target rectangle anyway, so I'm not sure if there is a benefit compared to not using STRETCH. 

So, tell us 'detail' about your need. 

 

And it is more common to use BLOCK to modify multiple objects at the same time

because If only one BLOCK is modified, all of them are modified.

Edited by exceed
  • Thanks 1
Link to comment
Share on other sites

Hi exceed,

 

thanks for the video clip.

Now I understand what the stretch command exactly do.

 

Thanks for your support you solved my problem.

  • Like 1
Link to comment
Share on other sites

Thanks exceed for the video that is exactly what I was describing.

 

Which video capture do you use ? The one I use did an upgrade and now does not work so looking for another.

  • Like 1
Link to comment
Share on other sites

On 6/1/2022 at 9:52 AM, BIGAL said:

Thanks exceed for the video that is exactly what I was describing.

 

Which video capture do you use ? The one I use did an upgrade and now does not work so looking for another.

 

how about this? this is open source freeware

https://www.screentogif.com/

 

and I upload it to google blogger and paste it by other media -> insert image from URL

Edited by exceed
Link to comment
Share on other sites

That is what I have and it wants new .net libraries tried 3 times to install new library Microsoft .net says done but not working any more. Yes Gifs do not load to here.

Link to comment
Share on other sites

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