Jump to content

Recommended Posts

Posted

Hi,

 

I'd like to know if it is possible to create a rectangle from middlepoint as they do in SolidWorks.

 

Regards.

Posted

Hi Frank,

 

Does it mean that you want to divide a rectangle into four rectangles ?

If not, give an example.

Posted

Well you know when you use "getcorner" you kinda see the rectangle.

 

So I'd like to see the rectangle crow from the middle.

 

I've already created a Lisp routine that make a rectangle but with no preview of what it look like.

Posted
Hi,

 

I'd like to know if it is possible to create a rectangle from middlepoint as they do in SolidWorks.

 

Regards.

(if (not

(Command "polygon" ))

;4 sides & circumcised & half radius?

(Tharwat will help )

); end of if

:)

Posted
...

(Tharwat will help )

); end of if

:)

 

+1

 

Great response!

Posted

@ hanhphuc, I completely forgot about the polygon command :thumbsup:

 

Happy to see you posting around.

Posted

Consider the following example:

(defun c:crec ( / a b f l p q x z )
   (if (setq p (getpoint "\nSpecify center of rectangle: "))
       (progn
           (setq z (trans '(0 0 1) 1 0 t)
                 f
               (lambda ( a v )
                   (list
                       (mapcar '+ a v)
                       (mapcar '+ a (list (- (car v)) (cadr v)))
                       (mapcar '- a v)
                       (mapcar '+ a (list (car v) (- (cadr v))))
                   )
               )
           )
           (while (= 5 (car (setq q (grread t 13 0))))
               (redraw)
               (setq l (f p (mapcar '- (cadr q) p)))
               (mapcar '(lambda ( a b ) (grdraw a b -1)) (cons (last l) l) l)
           )
           (if (= 3 (car q))
               (entmake
                   (append
                      '(
                           (000 . "LWPOLYLINE")
                           (100 . "AcDbEntity")
                           (100 . "AcDbPolyline")
                           (090 . 4)
                           (070 . 1)
                       )
                       (mapcar '(lambda ( x ) (cons 10 (trans x 1 z))) (f p (mapcar '- (cadr q) p)))
                       (list (cons 210 z))
                   )
               )
           )
       )
   )
   (redraw) (princ)
)

However, the above uses grread, and therefore sacrifices all standard drawing aids (Object Snap, Orthomode, Tracking etc).

Posted

thanks Tharwat me too, im happy need you guys here with sharp eyes 8)

 

@ hanhphuc, I completely forgot about the polygon command :thumbsup:

 

not yet.. command polygon is easy if square rectangle but not irregular L x W

 

...to create a rectangle from middle point as they do in SolidWorks.

Regards.

 

i dunno solidworks, so i would just subscribe here

Posted

WOW!! :notworthy: your coding speed is faster than my reply to Tharwat's post #6

as usual very nice idea Lee :thumbsup:

Posted
WOW!! :notworthy: your coding speed is faster than my reply to Tharwat's post #6

as usual very nice idea Lee :thumbsup:

 

Thanks! :)

Posted
However, the above uses grread, and therefore sacrifices all standard drawing aids (Object Snap, Orthomode, Tracking etc).

 

How come you know that much.... what ever we ask, you can code it...

 

Thanks alot

Posted
How come you know that much.... what ever we ask, you can code it...

 

I can't yet write a program to make your coffee - I'll keep working on it though ;)

 

You're welcome Frank :thumbsup:

Posted

Hmm draw a 1x1 sq make it a block with the insertion pt in the centre change x & y scale

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