Results 1 to 9 of 9

Thread: HVAC - Turning vanes in Duct Corner (90 degrees)

  1. #1
    Member
    Join Date
    2002-09
    Location
    Greeley, CO
    Posts
    44

    Default HVAC - Turning vanes in Duct Corner (90 degrees)

    See attached image. Does anyone have a lisp routine that draws turning vanes in the corner of the ductwork? Right now I am using a dynamic block and I would like to cut out the steps of having to stretch the vanes manually. What I would like is for the user to do it in 3 clicks. 1) Select the button to start the lisp. 2) Select the inside corner of the duct. 3) Select the outside corner of the duct. And the rest would automatically draw it in. The only requirements would be that the routine draws these lines on a specific layer and they are yellow. The other requirement is that the 2 lines not dashed are 3" offset from the inside corner of the ductwork. I've searched on augi for this lisp routine but I can't find any posts related to it. I have also googled it and again found very little info (unless I want to pay). Thanks in advance.

    Brad
    Attached Images Attached Images

  2. #2
    Administrator RobertB's Avatar
    Join Date
    2001-08
    Location
    Dallas TX USA
    Posts
    5,825

    Default Re: HVAC - Turning vanes in Duct Corner (90 degrees)

    Why not continue to use the DBlock? You can automate the setting of the dynamic properties of the block reference given your data.
    R. Robert Bell
    Design Technology Manager
    S P A R L I N G
    Opinions expressed are mine alone and do not reflect the views of Sparling.

  3. #3
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,214

    Default Re: HVAC - Turning vanes in Duct Corner (90 degrees)

    Brad,
    Give this a shot
    Just change the layer name on what you need
    See red line inside the code

    Code:
    ;;local defun
    (defun dxf (a eList) (cdr (assoc a eList)))
    ;; main part
    (defun c:DU (/ ang1 ang2 cec cp1 cp2 cp3 cp4 dp1 dp2 dp3 dp4
    	     el1 el2 el3 el4 ep1 ep2 ep3 ep4 filename ln1 ln2
    	     ln3 ln4 osm p1 p2 sp1 sp2 sp3 sp4 ss1 ss2 wid xp)
      
    (setq osm (getvar "osmode"))
    (setvar "osmode" 32)
    (setq cec (getvar "cecolor"))
    (setvar "cecolor" "256")
    (setq cla (getvar "clayer"))  
    (setvar "cmdecho" 0)
    (setq p1 (getpoint "\nPick the inside corner of the duct: "))
    
    (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)
          )
      (if (equal p1 sp1 0.0001)
          (setq ang1 (angle sp1 ep1))
          (setq ang1 (angle ep1 sp1))
        )
      (if (equal p1 sp2 0.0001)
          (setq ang2 (angle sp2 ep2))
          (setq ang2 (angle ep2 sp2))
        )
      (setq dp1 (polar p1 ang1 3.0)
    	dp2 (polar p1 ang2 3.0)
    	)
      
    (setq p2 (getpoint "\nPick the outside corner of the duct: "))
    (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)
    )
      (setq xp (vlax-curve-getclosestpointto ln3 p1))
      (setq wid (distance p1 xp))
      (setq cp1 (vlax-curve-getclosestpointto ln3 dp1)
    	cp2 (vlax-curve-getclosestpointto ln4 dp1)
    	cp3 (vlax-curve-getclosestpointto ln3 dp2)
    	cp4 (vlax-curve-getclosestpointto ln4 dp2)
    )
      (if (< (distance cp1 dp1)(distance cp2 dp1))
             (setq dp3 cp1)
             (setq dp3 cp2)
        )
     (if (< (distance cp3 dp2)(distance cp4 dp2))
             (setq dp4 cp3)
             (setq dp4 cp4)
        )
      (setvar "clayer" "ELBOW");<== change the layer for ducts to suit
      (command "line" "_non" dp1 "_non" dp3 "")
      (command "line" "_non" dp2 "_non" dp4 "")
      
      (if (not (tblsearch "ltype" "dashed"))
          (progn
          (if (zerop (getvar "measurement"))
          (setq filename "acad.lin")
          (setq filename "acadiso.lin"))
          (command "-linetype" "load" "dashed" filename "")
          )
        )
    
     (command "line" "_non" p1 "_non" p2 "")
     (command "chprop" "L" "" "LT" "DASHED" "S" "30" "")
     (setvar "cmdecho" 1)
     (setvar "clayer" cla)
     (setvar "cecolor" cec) 
     (setvar "osmode" osm)
     (princ)
     )
    (princ "\nLisp loaded. Start command with DU")
    (princ)
    ~'J'~
    Last edited by fixo; 2008-08-12 at 07:36 PM. Reason: local function added
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  4. #4
    Administrator RobertB's Avatar
    Join Date
    2001-08
    Location
    Dallas TX USA
    Posts
    5,825

    Default Re: HVAC - Turning vanes in Duct Corner (90 degrees)

    Fixo,

    Brad isn't going to get to far without:
    Code:
    (defun dxf (a eList) (cdr (assoc a eList)))
    R. Robert Bell
    Design Technology Manager
    S P A R L I N G
    Opinions expressed are mine alone and do not reflect the views of Sparling.

  5. #5
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,214

    Default Re: HVAC - Turning vanes in Duct Corner (90 degrees)

    Quote Originally Posted by RobertB View Post
    Fixo,

    Brad isn't going to get to far without:
    Code:
    (defun dxf (a eList) (cdr (assoc a eList)))
    Yes, you're right, it's my bad
    Thank you

    I added this local function

    Regards,

    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  6. #6
    Member
    Join Date
    2002-09
    Location
    Greeley, CO
    Posts
    44

    Default Re: HVAC - Turning vanes in Duct Corner (90 degrees)

    The amazing fixo does it again. Thanks. The lisp routine works perfectly. Thanks to you too RoberB.

  7. #7
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,214

    Default Re: HVAC - Turning vanes in Duct Corner (90 degrees)

    Hi Brad,
    Glad you got it to work
    Cheers

    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  8. #8
    Woo! Hoo! my 1st post
    Join Date
    2008-06
    Posts
    1

    Default Re: HVAC - Turning vanes in Duct Corner (90 degrees)

    Does anyone know why I'm getting this error?

    Command:
    DU
    Pick the inside corner of the duct: ; error: bad argument type: lselsetp nil
    Command:

    Thanks

  9. #9
    I could stop if I wanted to
    Join Date
    2006-01
    Posts
    286

    Default Re: HVAC - Turning vanes in Duct Corner (90 degrees)

    We use a command that inserts a block depending on layer. Sorry, I am not the best with error checking but I RARELY have problems with this lisp.

    Code:
    (defun c:90 (/ inspt currlay odctsize curros)
      (setq inspt (getpoint "\pick inside corner of duct for insertion: " ))
      (princ "\inspt accepted")
      (command "undo" "begin")
      (if (not dctsizea) (setq dctsizea 1))
      (if (not dctsizeb) (setq dctsizeb 1))
      (setq odctsize dctsizea)
      (setq cclayer (getvar "clayer"))
    
      (if
        (= (setq dctsizea (getdist (strcat "\nenter duct size<" (rtos odctsize 2 0) ">: ") inspt)) nil)
        (setq dctsizea odctsize)
        )
      (if
        (= (setq dctsizeb (getdist (strcat "\nenter duct size<" (rtos dctsizea 2 0) ">: ") inspt)) nil)
        (setq dctsizeb dctsizea)
        )
      (princ (strcat "Duct Size = " (rtos dctsizea 2 0)))
    
      (command "_ai_molc" inspt)
      (setq runlay (strcase (getvar "clayer")))
      (if (/=  runlay "M-SUPP-DUCT")
        (command "insert" "T:/CAD SUPP/Mechanical/Symbols/DYN ELR90" "x" dctsizea "y" dctsizeb "z" dctsizea inspt 0)
        )
      (if (= runlay "M-SUPP-DUCT")
        (command "insert" "T:/CAD SUPP/Mechanical/Symbols/DYN ELRV90" "x" dctsizea "y" dctsizeb "z" dctsizea inspt 0)
        )
      (setvar "Clayer" cclayer)
    
      (command "move" (entlast) "" (list 0 0)  (list (* -0.070731 dctsizea) 0))
    
      (princ (strcat "Duct Size = " (rtos dctsizea 2 0)))
      
      (command "rotate" (entlast) "" inspt pause)
      (command "undo" "end")
      (princ))


    Hope this works for you guys, Also, I would like to know any opinions on my method.

    Thanks all,
    Andre
    Attached Files Attached Files
    Last edited by RobertB; 2008-10-30 at 10:03 PM. Reason: added code tags

Similar Threads

  1. Turning Vanes and Hatch Up and Downs
    By cris8096 in forum Revit MEP - General
    Replies: 19
    Last Post: 2010-11-09, 02:49 PM
  2. Turning Vanes MEP 2010
    By mcoffey02 in forum AMEP General
    Replies: 2
    Last Post: 2009-09-28, 12:45 PM
  3. Turning Vanes
    By Ian Matthews in forum Revit MEP - Tips & Tricks
    Replies: 0
    Last Post: 2008-06-23, 02:39 AM
  4. Replies: 4
    Last Post: 2008-01-13, 06:56 PM

Posting Permissions

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