Jump to content

Recommended Posts

Posted

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
  • Last Reply

Top Posters In This Topic

  • Tyke

    4

  • nestly

    4

  • Cad64

    3

  • khoshravan

    3

Top Posters In This Topic

Posted

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

Posted

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

Posted

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.

Posted

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

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

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

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.

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

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

Posted
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

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

Posted

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

Posted
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:

Posted

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.

Posted

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

Posted

 

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

Posted

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...