Luis Ternou Posted June 26, 2017 Posted June 26, 2017 Hello everyone! Can someone write a lisp that asks me for the length of four lines and then creates/draws a closed rectangle from that input? Other id Thanks in advance! Kind regards, Luis Quote
rkmcswain Posted June 26, 2017 Posted June 26, 2017 If it's a rectangle, then you only need the length of 2 of the sides, and this is already built into the RECTANGLE command. Run the RECTANGLE command, pick a start point, then enter "D" for dimensions, then enter the width and height. Quote
Luis Ternou Posted June 26, 2017 Author Posted June 26, 2017 Thanks for your reply! I solved it myself with the use of contrains (Paramatric) + two lines wich stay parallel (see image). It was difficult for me to explain what I needed but this is sufficient! Sorry for the inconvenience! Kind regards, Luis Quote
Luis Ternou Posted June 26, 2017 Author Posted June 26, 2017 ...sorry but no image. It asks me to enter a url(?). Quote
steven-g Posted June 26, 2017 Posted June 26, 2017 ...sorry but no image. It asks me to enter a url(?). I've never worked that one out myself ! I use attach file, (you first need to select "go advanced" and click on the paperclip icon which lets you pick a file from your computer and at the bottom of that dialogue is an option to "insert inline" which is how I always do it. Quote
tmelancon Posted June 30, 2017 Posted June 30, 2017 No response from the OP? I agree with rkmcswain. The REC command literally does exactly what he wants. Since a rectangle will always have 2 sides that are identical. rec·tan·gleˈrekˌtaNGɡəl/ noun noun: rectangle; plural noun: rectangles a plane figure with four straight sides and four right angles, especially one with unequal adjacent sides, in contrast to a square. Run the REC command select first point. Type "D" for dimensions (this is your first length, and your second length). Once you specify your lengths hit then move your cursor and click when you have desired rotation. The only thing I can think of that OP would want is a LISP that runs the rec command normally but chooses the "dimension" option automatically and then clicks and sets the rectangle automatically then exits so user doesnt have to interact much with the keyboard during running. IDK just my 2 cents. We will never know unless they come back and clarify. Thanks Quote
tmelancon Posted June 30, 2017 Posted June 30, 2017 Possibly something like this. (defun C:rectester(/ START LENGTH1 LENGTH2) (setq start (getpoint "\nSpecify starting point of rectangle...")) (setq length1 (getreal "\nSpecify first length...")) (setq length2 (getreal "\nSpecify second length...")) (command "_.rectang" start "D" length1 length2 start) (princ)) Quote
RobDraw Posted July 1, 2017 Posted July 1, 2017 No response from the OP? Please see post #3. A rectangle that behaves like a rectangle, not a polygon. Quote
Luis Ternou Posted July 3, 2017 Author Posted July 3, 2017 Sorry for my late response but many thanks so far! Here is the attachment. Quote
Luis Ternou Posted July 3, 2017 Author Posted July 3, 2017 ...and thanks steven-g for the how-to! 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.