nestly Posted June 25, 2011 Posted June 25, 2011 nestly has got everybody today . Hey nestly tell us what you have as a keyboard, or do use speech-to-text? I can't type worth a darn. Anytime I get in first is purely luck. Quote
khoshravan Posted June 26, 2011 Author Posted June 26, 2011 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) ) Dear CAD64 Thanks for your detailed reply. This is enough for me, a 4 sided polygon with edges. Also other solutions for defining a function or keyboard shortcut is good. Thanks to all folks. Quote
BIGAL Posted June 28, 2011 Posted June 28, 2011 A slight variation to the theme may be usefull ; draw pits with 100mm walls ; by Alan H 2011 (setq oldsnap (getvar "osmode")) (setq oldlayer (getvar "clayer")) (command "_layer" "n" "Design-Drainage-Pits" "c" 4 "Design-Drainage-Pits" "") (setvar "clayer" "Design-Drainage-Pits") (setq length (getreal "\nPlease enter length m eg 0.9: ")) (setq width (getreal "\nPlease enter width : ")) (setq pt1 (getpoint "\npick 1st point to place pit : ")) (setq pt2 (getpoint "\nPick 2nd point for orientation")) (setvar "osmode" 0) (setq pt7 (getpoint "\Pick pt on pit side : ")) (setq ang (angle pt1 pt2)) (setq ang5 (angle pt2 pt7)) (setq diffang (- ang ang5)) (if (> diffang 1.5707) (setq ang2 (- ang 1.570796)) (setq ang2 (+ ang 1.570796)) ) (setq ang3 (+ ang 3.1415926)) (setq ang4 (- ang 1.570796)) (setq pt3 (polar pt1 ang length)) (setq pt4 (polar pt3 ang2 width)) (setq pt5 (polar pt4 ang3 length)) (command "pline" pt1 pt3 pt4 pt5 "c") (setq pt6 (polar pt1 ang 50.0)) (command "offset" 0.1 pt4 pt6 "") (setvar "osmode" oldsnap) (setvar "clayer" oldlayer) (princ) Quote
khoshravan Posted June 28, 2011 Author Posted June 28, 2011 A slight variation to the theme may be usefull ; draw pits with 100mm walls ; by Alan H 2011 (setq oldsnap (getvar "osmode")) (setq oldlayer (getvar "clayer")) (command "_layer" "n" "Design-Drainage-Pits" "c" 4 "Design-Drainage-Pits" "") (setvar "clayer" "Design-Drainage-Pits") (setq length (getreal "\nPlease enter length m eg 0.9: ")) (setq width (getreal "\nPlease enter width : ")) (setq pt1 (getpoint "\npick 1st point to place pit : ")) (setq pt2 (getpoint "\nPick 2nd point for orientation")) (setvar "osmode" 0) (setq pt7 (getpoint "\Pick pt on pit side : ")) (setq ang (angle pt1 pt2)) (setq ang5 (angle pt2 pt7)) (setq diffang (- ang ang5)) (if (> diffang 1.5707) (setq ang2 (- ang 1.570796)) (setq ang2 (+ ang 1.570796)) ) (setq ang3 (+ ang 3.1415926)) (setq ang4 (- ang 1.570796)) (setq pt3 (polar pt1 ang length)) (setq pt4 (polar pt3 ang2 width)) (setq pt5 (polar pt4 ang3 length)) (command "pline" pt1 pt3 pt4 pt5 "c") (setq pt6 (polar pt1 ang 50.0)) (command "offset" 0.1 pt4 pt6 "") (setvar "osmode" oldsnap) (setvar "clayer" oldlayer) (princ) All this long code is for drawing a simple four-sided square? 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.