git_thailand Posted April 19, 2012 Posted April 19, 2012 Need lisp for create rectangle (red colour) between rectangle (black colour) Quote
BlackBox Posted April 19, 2012 Posted April 19, 2012 Consider the Offset, and the Trim & Pedit, or the Pedit Commands. Quote
BIGAL Posted April 20, 2012 Posted April 20, 2012 Another way with lisp pick two diag corners xoff yoff can be different draws new rectang. 3pt answer if rectang on angle. I would go 3pt you can bet if you make it square only you need an angle version. Quote
ketxu Posted April 20, 2012 Posted April 20, 2012 Git_thailand, please re-read all off topic that you have posted. Please give more detail for what you want. Quote
pBe Posted April 20, 2012 Posted April 20, 2012 Need lisp for create rectangle (red colour) between rectangle (black colour) Looks easy enough. The only existing entiy is the black pline? and youre wanting to create 5 more? or just 4 not including the inner rectangle? Quote
Tharwat Posted April 20, 2012 Posted April 20, 2012 and youre wanting to create 5 more? or just 4 not including the inner rectangle? I guess there are only two , aren't they ? Quote
pBe Posted April 20, 2012 Posted April 20, 2012 (edited) I guess there are only two , aren't they ? Oh yeah. ... but it could also be four depending on how you see it. 5 even if you include the middle one as a separate entity. Oh well.... (defun c:BeatBox (/ _HiLow _Box _trans rec pts low high) (defun _HiLow (lev lst) (list (apply lev (mapcar 'car lst)) (apply lev (mapcar 'cadr lst)) ) ) (defun _Box (p1 p2) (command "_rectang" "_non" p1 "_non" p2) ) (setq _trans (lambda (pt) (trans pt 0 1))) (if (and (setq dist (cond ( (getdist (strcat "\nOffset Distance" (if dist (strcat " <" (rtos dist) ">: ") ": ") ) ) ) ( dist ) ) ) (setq rec (ssget '((0 . "LWPOLYLINE") (-4 . "&=") (70 . 1)) ) )) [color=blue](progn [/color] [color=blue](repeat (setq i (sslength rec)) [/color] (setq pts (mapcar 'cdr (vl-remove-if-not '(lambda (j) (= (car j) 10) ) (entget (setq e (ssname rec [color=blue](setq i (1- i))))[/color]) ) ) pts (mapcar '_trans pts) ) (setq Low (_HiLow 'min pts) High (_HiLow 'max pts) ) (_Box (list (car low) (+ (cadr low) dist)) (list (car high) (- (cadr high) dist)) ) (_Box (list (+ (car low) dist) (cadr low)) (list (- (car high) dist) (cadr high)) ) ) ) ) ) HTH UPDATED: Edited April 20, 2012 by pBe Updated for Multiple objects Quote
git_thailand Posted April 21, 2012 Author Posted April 21, 2012 create rectangle between two rectangle Quote
ReMark Posted April 21, 2012 Posted April 21, 2012 You really need a lisp routine to do this? Really?? Quote
pBe Posted April 21, 2012 Posted April 21, 2012 create rectangle between two rectangle Geez. I was right the first time. It is indeed 4. But then again... You really need a lisp routine to do this? Really?? I am wondering myself. Quote
git_thailand Posted April 21, 2012 Author Posted April 21, 2012 You really need a lisp routine to do this? Really?? yes. i need a lisp really. Quote
MSasu Posted April 22, 2012 Posted April 22, 2012 A simple AutoLISP routine that will draw a rectangle between two other (aligned) will be no gain in productivity - if you have Endpoint Osnap activated, then the use of RECTANGLE command require just two clicks to get the result, while a routine will require selection of two entities. Presuming that you have a big bunch of rectangles to connect on horizontal and vertical, then a routine may increase speed by allowing you to select all and then filtering them and connecting in pairs - but I'm afraind this will be a quite complicated code since need to validate coordinates of pairs and also check for potential overlapps. Quote
pBe Posted April 22, 2012 Posted April 22, 2012 - but I'm afraind this will be a quite complicated code since need to validate coordinates of pairs and also check for potential overlapps. I'll pass Mircea . Quote
git_thailand Posted April 23, 2012 Author Posted April 23, 2012 sorry i am stupid. but i need lisp create rectangle real. Quote
ReMark Posted April 23, 2012 Posted April 23, 2012 No one called you "stupid" and pBe gave you a lisp routine in post #7. If it does not suit your needs please explain where the routine falls short or try fixing it yourself. Quote
pBe Posted April 24, 2012 Posted April 24, 2012 see pic #8 Some members posts a somewhat "odd" requests but it doesnt mean it can't be done and "stupid" they're not. No offense git_thailand but what you're asking would redefine the word lackadaisicalness to a new level. Plus the first image you posted can be interpreted in many ways other than what you need [hence my mis-interpreted routine] If you badly need a code, you can start by explaining to us what that image really meant, I know that a picture is worth a thousand words but can you give us more information. Maybe there's more to it than what we like to think. Quote
pBe Posted April 26, 2012 Posted April 26, 2012 Request like a boss ^^ Yeah, that works 99% of the time, but it doesnt mean you're going to get what you asked for ALL the time. The result is only as good as the information you give us git_thailand. 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.