CadFrank Posted January 27, 2016 Posted January 27, 2016 Hi, I'd like to know if it is possible to create a rectangle from middlepoint as they do in SolidWorks. Regards. Quote
Tharwat Posted January 27, 2016 Posted January 27, 2016 Hi Frank, Does it mean that you want to divide a rectangle into four rectangles ? If not, give an example. Quote
CadFrank Posted January 27, 2016 Author Posted January 27, 2016 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. Quote
hanhphuc Posted January 27, 2016 Posted January 27, 2016 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 Quote
rkent Posted January 27, 2016 Posted January 27, 2016 ...(Tharwat will help ) ); end of if +1 Great response! Quote
Tharwat Posted January 27, 2016 Posted January 27, 2016 @ hanhphuc, I completely forgot about the polygon command Happy to see you posting around. Quote
Lee Mac Posted January 27, 2016 Posted January 27, 2016 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). Quote
hanhphuc Posted January 27, 2016 Posted January 27, 2016 thanks Tharwat me too, im happy need you guys here with sharp eyes @ hanhphuc, I completely forgot about the polygon command 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 Quote
hanhphuc Posted January 27, 2016 Posted January 27, 2016 WOW!! your coding speed is faster than my reply to Tharwat's post #6 as usual very nice idea Lee Quote
Lee Mac Posted January 27, 2016 Posted January 27, 2016 WOW!! your coding speed is faster than my reply to Tharwat's post #6as usual very nice idea Lee Thanks! Quote
CadFrank Posted January 27, 2016 Author Posted January 27, 2016 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 Quote
Lee Mac Posted January 27, 2016 Posted January 27, 2016 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 Quote
AIberto Posted January 28, 2016 Posted January 28, 2016 Here have a example. http://cadtips.cadalyst.com/linear-objects/draw-rectangle-midpoint Quote
BIGAL Posted January 28, 2016 Posted January 28, 2016 Hmm draw a 1x1 sq make it a block with the insertion pt in the centre change x & y scale 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.