# How can I draw square rapidly

## Recommended Posts

I want to draw a square with a line as its side given.

I am looking for a rapid solution, like pressing shift while using rectangle command to make two sides equal. Is there any such a short cut for square?

• Replies 23
• Created

• 4

• 4

• 3

• 3

#### Popular Days

I use lisp for it

```(defun c:sq (/ osn aa ip cp1 point)
(setq osn (getvar "OSMODE"))
(if (= a nil)
(setq a 1.0)
)
(princ "\n Size < ")
(princ a)
(princ " > ?? : ")
(setq aa (getdist))
(if (= aa nil)
(setq a a)
(setq a aa)
)
(setq ip (getpoint "\n Insertion : "))
(setq cp1 (polar ip 0 a))
(setq point (polar cp1 (* pi 0.5) a))
(command "osmode" 0)
(command "rectang" ip point)
(setq e1 (entlast))
(setvar "osmode" osn)
(command "rotate" e1 "" ip pause)
(princ)
)```

##### Share on other sites

I use the command Polygon for it

##### Share on other sites

Try using the POLYGON command.

Command sequence:

Command: POLYGON

Enter number of sides : 4

Specify center of polygon or [Edge]: E

Specify first endpoint of edge: Click to select start point on screen

Specify second endpoint of edge: Hold Shift and drag out square

Edit: Looks like eldon snuck in while I was typing.

If you draw squares all the time, you could automate the polygon command like so:

```(defun c:SQ (/)
(command "polygon" "4" "e")
(princ)
)```

##### Share on other sites

Perhaps the Forum should have a Pending flag, to show that someone was composing a reply.

And to add to your fulsome reply, the second point of the leg can arrived at by dragging out the cursor in the direction, and typing in the length on the keyboard.

##### Share on other sites

Building on Eldon's, and Cad64's posts:

Keyboard shortcuts:

```(defun c:SQ () (c:SQUARE))
(defun c:SQUARE ()
(command "._polygon" 4 "edge" pause pause))
```

Toolbar macro:

```^C^C^P._polygon;4;"edge";\\
```

##### Share on other sites

Perhaps the Forum should have a Pending flag, to show that someone was composing a reply.

... Sounds like a feature at TheSwamp; once you've composed your reply, and hit Post, the site informs you of how many posts have been made while you were typing.

##### Share on other sites

... Sounds like a feature at TheSwamp; once you've composed your reply, and hit Post, the site informs you of how many posts have been made while you were typing.
we have that featue on a VW forum. Really annoying st times as I often press submit and walk waay only to come back 30 minutes later to see it still sitting there.
##### Share on other sites

You can do it with the rectangle command too:

```
(defun c:SQ (/)
(command "._rectangle" pause "d")
(princ)
)
```

Lots of ways to get there from here.

##### Share on other sites

Rectang with Polar Tracking angle 45

http://screencast.com/t/ibMJxfxgB

##### Share on other sites

Rectang with Polar Tracking angle 45

http://screencast.com/t/ibMJxfxgB

Nice one nestly. But how can you do that and enter the length of the square's side?

How about a parametric block on a palette with a pause for entering the length and an automatic explode?

##### Share on other sites

Nice one nestly. But how can you do that and enter the length of the square's side?

Watch your command line. You have options and one of them is "Dimensions". Just hit "D" while you're dragging out the square.

##### Share on other sites

Nice one nestly. But how can you do that and enter the length of the square's side?

I may have misunderstood the question. I thought the OP wanted to use an existing line to define the size of the square.

Honestly, when I want to draw a rectangle with known dimensions, I just type RECTANG X,Y

##### Share on other sites

Watch your command line. You have options and one of them is "Dimensions". Just hit "D" while you're dragging out the square.

But is that not the length of the diagonal and not the side?

##### Share on other sites

No, it's the "Dimensions" of the rectangle. Did you try it? It prompts you for the length and width, not the diagonal distance.

##### Share on other sites

No, it's the "Dimensions" of the rectangle. Did you try it? It prompts you for the length and width, not the diagonal distance.

Yup, I just tried it and you are correct, you have to enter width and height. Sorry

##### Share on other sites

Typing "D" is only necessary if Dynamic Input is turned off, otherwise you can just type the x and y after picking the first corner.

##### Share on other sites

With rectangle, you pick a start point, it then offers [Area/Dimensions/Rotation]. If you hit D it says "specify length for rectangles" so you enter whatever length, then it asks for the length. Again, enter the dimension you want. Then you pick to determine which direction it goes (right or left of your start point).

--edit--i gotta learn to type faster!!

##### Share on other sites

--edit--i gotta learn to type faster!!

nestly has got everybody today . Hey nestly tell us what you have as a keyboard, or do use speech-to-text?

##### Share on other sites

Now you know why all my common notes and such on drawings are blocks I insert!

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

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.