Jump to content
khoshravan

How can I draw square rapidly

Recommended Posts

khoshravan

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?

Share this post


Link to post
Share on other sites
paulmcz

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 this post


Link to post
Share on other sites
eldon

I use the command Polygon for it :D

Share this post


Link to post
Share on other sites
Cad64

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

 

 

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

 

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

Share this post


Link to post
Share on other sites
eldon

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

 

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 this post


Link to post
Share on other sites
BlackBox

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 this post


Link to post
Share on other sites
BlackBox
Perhaps the Forum should have a Pending flag, to show that someone was composing a reply. :D

 

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


Link to post
Share on other sites
dbroada
... 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 this post


Link to post
Share on other sites
Jack_O'neill

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 this post


Link to post
Share on other sites
Tyke
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 this post


Link to post
Share on other sites
Cad64
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 this post


Link to post
Share on other sites
nestly
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 this post


Link to post
Share on other sites
Tyke
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 this post


Link to post
Share on other sites
Cad64

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 this post


Link to post
Share on other sites
Tyke
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 :oops:

Share this post


Link to post
Share on other sites
nestly

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 this post


Link to post
Share on other sites
Jack_O'neill

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 this post


Link to post
Share on other sites
Tyke

 

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

 

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

Share this post


Link to post
Share on other sites
Jack_O'neill

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×