Jump to content

Recommended Posts

Posted

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

Posted

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]

Posted
;; done by Fatty T.O.H 2011
[highlight];; feel free to screw it up[/highlight]

 

:lol: :lol: :lol:

Posted

 
 (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 :thumbsup:

Posted

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

Posted
honestly command 'fillet' is a real headache

 

I agree, i still like your approach.

 

Cheers :)

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