jcap91163 Posted December 17, 2011 Posted December 17, 2011 Hi everyone, I need to draw a stirrup in beams and columns, the goal is to draw a mline or a polyline with the respective offset (i.e. 3/8") but with rounded corners in which I put manually the main reinforcement. I tried every method possible but always I end up doing it the old fashion way, that is drawing a polyline and then applying a fillet radious, then offseting the pline and then join them and closing them. There is a way to do something more easy and practical? Many thanks in advance to all of you for helping me Quote
fixo Posted December 18, 2011 Posted December 18, 2011 Not sure about how it will be work for you Tested very limited on 2009 only [left];;===================== code start ===========================;; ;; done by Fatty T.O.H 2011 ;; feel free to screw it up (defun C:stir(/ *error* ang clay clr clt ent orth osm rot leg ofs p1 p2 po pt1 pt2 rad wid) (defun *error* (msg) (if (and msg (not (wcmatch msg "Function cancelled,quit / exit abort,console break"))) (princ (strcat "\nError: " msg)) ) (command) (command "_.undo" "_end") (setvar 'cmdecho 1) (if osm (setvar 'osmode osm) ) (if orth (setvar 'orthomode orth) ) (if clay (setvar 'clayer clay) ) (if clt (setvar 'celtype clt) ) (if clr (setvar 'cecolor clr) ) ) (command "_undo" "_be") (setq osm (getvar 'osmode)) (setq orth (getvar 'orthomode)) (setq clay (getvar 'clayer)) (setq clt (getvar 'celtype)) (setq clr (getvar 'cecolor)) ;; create layer if it's already exist, so Autocad will be ignore it with no problem (command "-layer" "_M" "M-Anno-Enforcement" "_Color" "12" "M-Anno-Enforcement" "");<-- change layer here (setvar 'osmode 0) (setvar 'cmdecho 1) (setvar 'orthomode 0) (setvar 'clayer "M-Anno-Enforcement");<-- change layer here (setvar 'celtype "bylayer") (setvar 'cecolor "bylayer") (setvar 'qaflags 0) (setvar 'offsetgaptype 0) (setq wid (getdist "\nEnter a width of stirupp (inner size): ")) (if (not (setq ofs (getdist "\nEnter offset <0.375>: "))) (setq ofs 0.375) ) (if (not (setq rad (getdist (strcat "\nEnter a fillet radius <" (rtos ofs 2 3) ">: ")))) (setq rad ofs) ) (setq p1 (getpoint "\nPick the first point to specify length of stirupp (inner size): ") p2 (getpoint p1 "\nPick the second point: ") ) (setq ang (angle p1 p2)) (setq leg (distance p1 p2)) (setq pt1 (polar p1 (* pi 1.5) (/ wid 2.))) (setq pt2 (list (+ (car pt1) leg) (+ (cadr pt1) wid))) (graphscr) (redraw) (command "rectangle" (list (car pt1) (cadr pt1)) (list (car pt2) (cadr pt2))) (setq rot (* 180.0 (/ ang pi))) (setq ent (entlast)) (command "rotate" ent "" "_non" p1 rot) (setq ent (entlast)) (setvar 'expert 5) (setvar 'filletrad rad) (vl-cmdf "fillet" "R" (rtos rad 2 2) "") (vl-cmdf) (vl-cmdf "fillet" "P" ent "") (setvar 'offsetdist (* ofs -1.)) (setq po (polar p2 ang (* 2 ofs)) po (list (car po) (cadr po)) ) (setq ent (entlast)) (vl-cmdf "offset" ofs ent po "");<-- offset outside (*error* nil) (princ) ) (vl-load-com) (prompt "\n Start command with STIR") (prin1) ;;===================== code end ===========================;;[/left] Quote
Lee Mac Posted December 18, 2011 Posted December 18, 2011 ;; done by Fatty T.O.H 2011 [highlight];; feel free to screw it up[/highlight] :lol: Quote
fixo Posted December 18, 2011 Posted December 18, 2011 I see you have bored then go there http://forum.dwg.ru/showpost.php?p=851244&postcount=1 Question is about how to copy text from source object to target without loosing formatting just in two clicks Quote
pBe Posted December 19, 2011 Posted December 19, 2011 (setvar 'filletrad rad) (vl-cmdf "fillet" "R" (rtos rad 2 2) "") (vl-cmdf) (vl-cmdf "fillet" "P" ent "") Interesting Oleg, never thought of doing it that way Quote
fixo Posted December 19, 2011 Posted December 19, 2011 To be honestly command 'fillet' is a real headache for me and I'm not sure that's right way I just have tried to bypass an error message If you do set the breakpoints in debug so the error message still occurs unfortunatelly, but the whole program is working though Cheers Quote
pBe Posted December 19, 2011 Posted December 19, 2011 honestly command 'fillet' is a real headache I agree, i still like your approach. Cheers 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.