Jump to content

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?

Link to post
Share on other sites
  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • nestly

    4

  • Tyke

    4

  • khoshravan

    3

  • Cad64

    3

Top Posters In This Topic

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)
)

Link to post
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. :P

 

 

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

 

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

Link to post
Share on other sites

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.

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";\\

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.

Link to post
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.
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.

Link to post
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.

Link to post
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

Link to post
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?

Link to post
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 :oops:

Link to post
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.

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!!

Link to post
Share on other sites

 

--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?

Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...