Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: RADIUS ELBOW (HVAC DUCTWORK LSP)

  1. #1
    Member
    Join Date
    2002-09
    Location
    Greeley, CO
    Posts
    44
    Login to Give a bone
    0

    Default RADIUS ELBOW (HVAC DUCTWORK LSP)

    Does anyone have a lisp routine they are willing to share that fillets two sets of 90 degree lines so that a radius is made? See attached image. X is the variable and it would be the width of the lines and also the radius of the inside arc. The outside arc would be 2x the inner radius. It would also need to insert lines from the endpoints of the arcs. What I would like the routine to do is have the user select the inside corner of the duct, then the outside corner and have it fillet the lines automatically. We have always done this process manually and there has to be lsp routines out there that do such a basic thing. Any help is greatly appreciated.

    In all fairness I should post a lisp routine for you all. It's simple but very cool. 2 keystrokes to change from tilemode 1 to 0 or vis versa. T Enter

    (defun c:t ()
    (setvar "tilemode" (- 1 (getvar "tilemode")))
    (princ))
    Attached Images Attached Images

  2. #2
    AUGI Addict
    Join Date
    2006-04
    Location
    (getpoint "Anywhere on the Enter Key =>")
    Posts
    1,160
    Login to Give a bone
    0

    Default Re: RADIUS ELBOW (HVAC DUCTWORK LSP)

    Hi,
    I used to work with HVAC industry for years.
    What I understood was that you probably also need some thing for duct riser/dropper, duct transition, insulation, pipework, diffusser, etc.
    You'd be better off if you have had an add-on package rather than a single function routine.
    As I known so far, draPro is the one you're after. You may also need to do a search on the net.

    Cheers.


    Quote Originally Posted by brad.39101 View Post
    Does anyone have a lisp routine they are willing to share that fillets two sets of 90 degree lines so that a radius is made? See attached image. X is the variable and it would be the width of the lines and also the radius of the inside arc. The outside arc would be 2x the inner radius. It would also need to insert lines from the endpoints of the arcs. What I would like the routine to do is have the user select the inside corner of the duct, then the outside corner and have it fillet the lines automatically. We have always done this process manually and there has to be lsp routines out there that do such a basic thing. Any help is greatly appreciated.

    In all fairness I should post a lisp routine for you all. It's simple but very cool. 2 keystrokes to change from tilemode 1 to 0 or vis versa. T Enter

    (defun c:t ()
    (setvar "tilemode" (- 1 (getvar "tilemode")))
    (princ))
    Last edited by BoKirra; 2008-07-11 at 02:18 AM.

  3. #3
    Member
    Join Date
    2007-04
    Posts
    3
    Login to Give a bone
    0

    Default Re: RADIUS ELBOW (HVAC DUCTWORK LSP)

    Quote Originally Posted by brad.39101 View Post
    Does anyone have a lisp routine they are willing to share that fillets two sets of 90 degree lines so that a radius is made? See attached image. X is the variable and it would be the width of the lines and also the radius of the inside arc. The outside arc would be 2x the inner radius. It would also need to insert lines from the endpoints of the arcs. What I would like the routine to do is have the user select the inside corner of the duct, then the outside corner and have it fillet the lines automatically. We have always done this process manually and there has to be lsp routines out there that do such a basic thing. Any help is greatly appreciated.

    In all fairness I should post a lisp routine for you all. It's simple but very cool. 2 keystrokes to change from tilemode 1 to 0 or vis versa. T Enter

    (defun c:t ()
    (setvar "tilemode" (- 1 (getvar "tilemode")))
    (princ))
    I had one that I wrote years ago. I'll insert the code and you can go from there.

    ELBOW.LSP

    ;*****************************************************************************
    ;*
    ;* ELBOW.LSP - Draws 90° Elbow using current layer.
    ;* T M Gambill 2/1/99
    ;*****************************************************************************
    ;
    (defun 90elbow()
    (setq dcl_id (load_dialog "elbow.dcl"))
    (if (not (new_dialog "elbow" dcl_id))
    (exit)
    )
    (if (not L1-DIM) (setq L1-DIM "6"))
    (if (not L2-DIM) (setq L2-DIM "6"))
    (if (not W1-DIM) (setq W1-DIM "12"))
    (if (not W2-DIM) (setq W2-DIM "12"))
    (set_tile "L1_DIM" L1-DIM)
    (set_tile "L1_DIM_SLD" L1-DIM)
    (set_tile "L2_DIM" L2-DIM)
    (set_tile "L2_DIM_SLD" L2-DIM)
    (set_tile "W1_DIM" W1-DIM)
    (set_tile "W1_DIM_SLD" W1-DIM)
    (set_tile "W2_DIM" W2-DIM)
    (set_tile "W2_DIM_SLD" W2-DIM)
    (action_tile "L1_DIM_SLD" "(up_l1_dim_box)")
    (action_tile "L2_DIM_SLD" "(up_l2_dim_box)")
    (action_tile "L1_DIM" "(up_l1_dim_sld)")
    (action_tile "L2_DIM" "(up_l2_dim_sld)")
    (action_tile "W1_DIM_SLD" "(up_w1_dim_box)")
    (action_tile "W2_DIM_SLD" "(up_w2_dim_box)")
    (action_tile "W1_DIM" "(up_w1_dim_sld)")
    (action_tile "W2_DIM" "(up_w2_dim_sld)")
    (action_tile "cancel" "(done_dialog)(setq gperr \"\")(exit)")
    (action_tile "accept"
    "(90get_data)(done_dialog)"
    )
    (start_dialog)
    (unload_dialog dcl_id)
    )

    (defun up_l1_dim_box()
    (setq L1-DIM (get_tile "L1_DIM_SLD"))
    (set_tile "L1_DIM" L1-DIM)
    )

    (defun up_l2_dim_box()
    (setq L2-DIM (get_tile "L2_DIM_SLD"))
    (set_tile "L2_DIM" L2-DIM)
    )

    (defun up_l1_dim_sld()
    (setq L1-DIM (get_tile "L1_DIM"))
    (set_tile "L1_DIM_SLD" L1-DIM)
    )

    (defun up_l2_dim_sld()
    (setq L2-DIM (get_tile "L2_DIM"))
    (set_tile "L2_DIM_SLD" L2-DIM)
    )

    (defun up_w1_dim_box()
    (setq W1-DIM (get_tile "W1_DIM_SLD"))
    (set_tile "W1_DIM" W1-DIM)
    )

    (defun up_W2_dim_box()
    (setq W2-DIM (get_tile "W2_DIM_SLD"))
    (set_tile "W2_DIM" W2-DIM)
    )

    (defun up_w1_dim_sld()
    (setq W1-DIM (get_tile "W1_DIM"))
    (set_tile "W1_DIM_SLD" W1-DIM)
    )

    (defun up_w2_dim_sld()
    (setq W2-DIM (get_tile "W2_DIM"))
    (set_tile "W2_DIM_SLD" W2-DIM)
    )

    (defun 90get_data()
    ; input data
    (setq L1 (atof (get_tile "L1_DIM")))
    (setq L2 (atof (get_tile "L2_DIM")))
    (setq W1 (atof (get_tile "W1_DIM")))
    (setq W2 (atof (get_tile "W2_DIM")))
    (setq W3 (+ L1 W2))
    )
    (defun 90draw_elbow()
    (setvar "OSMODE" 2)
    (setq p0 (getpoint "\nPick Insertion Point: "))
    (setq ang0 (getangle p0 "\nPick Insertion Angle: "))
    (setq ang1 (getangle p0 "\nPick Turn Direction: "))
    (setvar "OSMODE" 0)
    (setq ang2 (+ ang1 pi)
    W1H (/ W1 2)
    W2H (/ W2 2)
    )

    ; calc point locations
    (setq p1 (polar p0 ang1 W1H)
    p2 (polar p0 ang2 W1H)
    p3 (polar p1 ang0 L1)
    p4 (polar p2 ang0 (+ L1 W2))
    p5 (polar p3 ang1 L2)
    p6 (polar p5 ang0 W2)
    )

    ; draw Elbow
    (command "LINE" p1 p2 p4 p6 p5 p3 p1 "")
    (setq ccolor (getvar "CECOLOR"))
    (setvar "CECOLOR" "8")
    (command "LINE" p3 p4 "")
    (setvar "CECOLOR" ccolor)
    (setq W1-DIM W2-DIM)
    )
    (defun C:elbow ( / ltsave bpsave p0 p1 p2 p3 p4 p5 p6)
    (setvar "CMDECHO" 0)
    (setq ltsave (getvar "CELTYPE"))
    (setq snapmode (getvar "OSMODE"))
    (setq bpsave (getvar "BLIPMODE"))
    (setvar "BLIPMODE" 0)
    (90elbow)
    (90draw_elbow)
    (setvar "BLIPMODE" bpsave)
    (setvar "OSMODE" snapmode)
    (princ)
    )


    ELBOW.DCL

    // child for Duct Elbow
    elbow : dialog{
    label = "Duct 90° Elbow";
    :boxed_column {
    label = " Elbow Properties";
    :edit_box {
    label = "Leg-1 Length:";
    key = "L1_DIM";
    edit_width = 6;
    }
    :slider {
    key = "L1_DIM_SLD";
    edit_width = 6;
    min_value = 0;
    max_value = 12;
    small_increment = 2;
    big_increment = 6;
    }
    :edit_box {
    label = "Leg-2 Length:";
    key = "L2_DIM";
    edit_width = 6;
    }
    :slider {
    key = "L2_DIM_SLD";
    edit_width = 6;
    min_value = 0;
    max_value = 12;
    small_increment = 2;
    big_increment = 6;
    }
    :edit_box {
    label = "Width 1:";
    key = "W1_DIM";
    edit_width = 6;
    }
    :slider {
    key = "W1_DIM_SLD";
    edit_width = 6;
    min_value = 0;
    max_value = 96;
    small_increment = 2;
    big_increment = 6;
    }
    :edit_box {
    label = "Width 2:";
    key = "W2_DIM";
    edit_width = 6;
    }
    :slider {
    key = "W2_DIM_SLD";
    edit_width = 6;
    min_value = 0;
    max_value = 96;
    small_increment = 2;
    big_increment = 6;
    }
    }
    ok_cancel;
    }

  4. #4
    Active Member
    Join Date
    2007-08
    Posts
    81
    Login to Give a bone
    0

    Default Re: RADIUS ELBOW (HVAC DUCTWORK LSP)

    A dynamic block could also be an option (draw an elbow at 1 units and use the scale action, could add a flip action as well).

  5. #5
    Member
    Join Date
    2002-09
    Location
    Greeley, CO
    Posts
    44
    Login to Give a bone
    0

    Default Re: RADIUS ELBOW (HVAC DUCTWORK LSP)

    BoKirrra, I did a little searching through google for "radius elbow lsp" and funny thing is, this post comes up as the #1 hit. I need to do some more searching to see if it is out there. Tgambill, what I am looking for is a round radius elbow. Your lisp routine works great for square elbows. OCD, a dynamic block would be good but it is a lot of clicking.

    I guess to be more specific (see images) I would like to do this in 3 mouse clicks. 1) Click the button to start the lsp. 2) Pick the inside corner of the lines. 3) Pick the outside corner of the lines. Then the lsp routine would automatically trim all the lines and do the arcs and insert the lines.
    Attached Images Attached Images

  6. #6
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: RADIUS ELBOW (HVAC DUCTWORK LSP)

    This will get you started I hope
    Works good for me in A2008eng

    Code:
    ;; elb.lsp
    ;; load ActiveX dll
    (vl-load-com)
    
    ;; local defun
    ;; get value by key
    (defun dxf (key alist)
      (cdr (assoc key alist))
      )
    
    ;;================================ main programm ================================;;
    (defun C:ELB (/ aep1 aep2 arc1 arc2 asp1 asp2 el1 el2 el3 el4 ep1 ep2 ep3
    	      ep4 frad ip1 ip2 ln1 ln2 ln3 ln4 osm p1 p2 sp1 sp2 sp3 sp4 ss1 ss2 wid)
    (setq osm (getvar "osmode"))
    (setvar "osmode" 32)
    (setq frad (getvar "filletrad"))
    (setvar "cmdecho" 0)
    (setq p1 (getpoint "\nPick intersection point of inner lines: "))
    (setq ss1 (ssget "C" p1 p1 (list (cons 0 "LINE"))))
    (if (/= (sslength ss1) 2)
      (progn (exit) (princ)))
    (setq ln1 (ssname ss1 0)
          ln2 (ssname ss1 1)
          el1 (entget ln1)
          el2 (entget ln2)
          sp1 (dxf 10 el1)
          ep1 (dxf 11 el1)
          sp2 (dxf 10 el2)
          ep2 (dxf 11 el2)
          ip1 (inters sp1 ep1 sp2 ep2 nil)
          )
    (setq p2 (getpoint "\nPick intersection point of outer lines: "))
    (setq ss2 (ssget "C" p2 p2 (list (cons 0 "LINE"))))
    (if (/= (sslength ss2) 2)
      (progn (exit) (princ)))
    (setq ln3 (ssname ss2 0)
          ln4 (ssname ss2 1)
          el3 (entget ln3)
          el4 (entget ln4)
          sp3 (dxf 10 el3)
          ep3 (dxf 11 el3)
          sp4 (dxf 10 el4)
          ep4 (dxf 11 el4)
          ip2 (inters sp3 ep3 sp4 ep4 nil)
          )
    (setq wid (* (distance ip1 ip2) (cos (/ pi 4))))
    
    (setvar "filletrad" wid)
    (command "fillet" ln1 ln2 "")
    (setq arc1 (entlast))
    (setq asp1 (vlax-curve-getstartpoint arc1)
          aep1 (vlax-curve-getendpoint arc1)
          )
    (setvar "filletrad" (* wid 2.))
    (command "fillet" ln3 ln4 "")
    (setq arc2 (entlast))
    (setq asp2 (vlax-curve-getstartpoint arc2)
          aep2 (vlax-curve-getendpoint arc2)
          )
    (if (< (distance asp1 asp2) (distance asp1 aep2))
      (progn
        (command "line" "_non" asp1 "_non" asp2 "")
        (command "line" "_non" aep1 "_non" aep2 "")
        )
      (progn
        (command "line" "_non" asp1 "_non" aep2 "")
        (command "line" "_non" aep1 "_non" asp2 "")
        )
      )
    (setvar "cmdecho" 1)
    (setvar "osmode" osm)
    (setvar "filletrad" frad)
      (princ)
      )
      (princ "\nStart command with ELB")
    (princ)
    ~'J'~

  7. #7
    AUGI Addict
    Join Date
    2006-04
    Location
    (getpoint "Anywhere on the Enter Key =>")
    Posts
    1,160
    Login to Give a bone
    0

    Default Re: RADIUS ELBOW (HVAC DUCTWORK LSP)

    Quote Originally Posted by CAD Brad View Post
    BoKirrra, I did a little searching through google for "radius elbow lsp" and funny thing is, this post comes up as the #1 hit. I need to do some more searching to see if it is out there.
    I found the following for you:
    1) http://www.hvacware.net
    2) http://www.drapro.com

    Obviously, it's all about the money.
    If you're after a simple result, fixo's code may do for you.
    BTW, his code can only be applied to LINEs, not PLINEs.

    Hope it gives you a little help.

    Cheers!
    Last edited by BoKirra; 2008-08-04 at 02:59 AM.

  8. #8
    Member
    Join Date
    2002-09
    Location
    Greeley, CO
    Posts
    44
    Login to Give a bone
    0

    Default Re: RADIUS ELBOW (HVAC DUCTWORK LSP)

    Thanks for the LSP fixo. That's exactly what I need.

  9. #9
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: RADIUS ELBOW (HVAC DUCTWORK LSP)

    You're welcome
    Cheers

    ~'J'~

  10. #10
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    385
    Login to Give a bone
    0

    Default Re: RADIUS ELBOW (HVAC DUCTWORK LSP)

    we use a block with scaling in the lisp.
    This was set up with no error checking and may be a bit crude but it works.
    Another benefit is that you have the option to use a 1.0 or a 1.5 radius elbo.

    (defun c:r90 () (radius90))
    (defun ductr901 (/ inspt currlay odctsize)
    (command "undo" "begin")
    (if
    (not dctsize) (setq dctsize 12)
    )
    (setq odctsize dctsize)
    (setq inspt (getpoint "\pick inside corner of duct for insertion: " ))
    (princ "\inspt accepted")
    (if
    (= (setq dctsize (getdist (strcat "\nenter duct size<" (rtos odctsize 2 0) ">: ") inspt)) nil)
    (setq dctsize odctsize)
    )
    (princ (strcat "Duxt Size = " (rtos dctsize 2 0)))
    (setq currlay (getvar "Clayer"))
    (princ "\currlay accepted")
    (command "_ai_molc" inspt)
    (command "insert" "T:/AEI CAD/Mechanical/Symbols/EL902" "s" dctsize inspt 0)
    (command "move" (entlast) "" (list 0 0) (list (* -0.5 dctsize) 0))
    (princ (strcat "Duct Size = " (rtos dctsize 2 0)))
    (command "rotate" (entlast) "" inspt pause)
    (setvar "CLayer" currlay)
    (command "undo" "end")
    (princ))

    (defun radius90 (/ 91o915)
    (if (=
    (setq roinspt (getpoint "\pick inside corner for 1.5 radius elbo <use 1.0 radius elbo>: " ))
    nil)
    (setq 91o915 "91"))
    (if (= 91o915 "91") (ductr901))
    (if (/= 91o915 "91") (ductr9015))
    (if (/= 91o915 "91") (setq 91o915 "90"))

    (princ))

    (defun ductr9015 (/ inspt currlay odctsize)
    (setq inspt roinspt)
    (command "undo" "begin")
    (if
    (not dctsize) (setq dctsize 12)
    )
    (setq odctsize dctsize)
    ;(setq inspt (getpoint "\pick inside corner of duct for insertion: " ))
    ;(princ "\inspt accepted")
    (if
    (= (setq dctsize (getdist (strcat "\nenter duct size<" (rtos odctsize 2 0) ">: ") inspt)) nil)
    (setq dctsize odctsize)
    )
    (princ (strcat "Duxt Size = " (rtos dctsize 2 0)))
    (setq currlay (getvar "Clayer"))
    (princ "\currlay accepted")
    (command "_ai_molc" inspt)
    (command "insert" "T:/AEI CAD/Mechanical/Symbols/EL901" "s" dctsize inspt 0)
    (command "move" (entlast) "" (list 0 0) (list (* -1 dctsize) 0))
    (princ (strcat "Duct Size = " (rtos dctsize 2 0)))
    (command "rotate" (entlast) "" inspt pause)
    (setvar "CLayer" currlay)
    (command "undo" "end")
    (princ))
    Attached Files Attached Files

Page 1 of 2 12 LastLast

Similar Threads

  1. Revit Long Radius Elbow - Welded - Generic
    By jkrack890740 in forum Revit MEP - Families
    Replies: 6
    Last Post: 2018-03-26, 09:00 PM
  2. 2014: Customize Radius Elbow for Ductwork
    By rcsan85400224 in forum AMEP General
    Replies: 0
    Last Post: 2014-10-31, 04:10 PM
  3. 2013: Seeking RECTANGULAR DUCT RADIUS (curved) ELBOW...But VERTICAL?
    By spinalfarm in forum Revit MEP - General
    Replies: 0
    Last Post: 2013-10-13, 05:35 PM
  4. MEP Conduit Elbow Radius
    By Burns.229583 in forum AMEP General
    Replies: 0
    Last Post: 2010-01-14, 01:45 PM
  5. How do You show HVAC Ductwork with Revit Architecture?
    By bbebart in forum Revit Architecture - General
    Replies: 14
    Last Post: 2009-11-05, 02:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •