Author Topic: AutoCAD DUCT Tool  (Read 11358 times)

0 Members and 1 Guest are viewing this topic.

KewlToyZ

  • Guest
AutoCAD DUCT Tool
« on: September 24, 2008, 06:35:36 PM »
I'm working with some older routines trying to make them into one system for drafting duct.
MEP while it has many bells and whistles consumes too many resources and training for adoption within our company.

I still need to make allowances for length entries in ft like: 12'
And finish structuring the error catch properly.

Let me know if you have a few fitting tools as well.

Attached is the tool thrown together so far.
Too long to post as code. :ugly:

GDF

  • Water Moccasin
  • Posts: 2081
Re: AutoCAD DUCT Tool
« Reply #1 on: September 25, 2008, 09:53:16 AM »
First thing I see is that you need to create the layers first and load the line types.


I'm an architect so I don't do mechanical work, however I have dabbled in it....
For ducts I use a modified version of autocad's dline.lsp routine; in a dialog box interface.

Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: AutoCAD DUCT Tool
« Reply #2 on: September 25, 2008, 10:38:37 AM »
Sounds like a suite of dynamic blocks would be easier?
James Buzbee
Windows 8

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: AutoCAD DUCT Tool
« Reply #3 on: September 25, 2008, 10:43:39 AM »
I just got a bunch of error messages.   :|
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

KewlToyZ

  • Guest
Re: AutoCAD DUCT Tool
« Reply #4 on: September 25, 2008, 11:40:55 AM »
Yeah I have to run a repair routine for it to run on a drawing at times.
Trying to nail down the exact variables causing the measurements to error.
The repair.lsp has a ton of variable settings I use in house for our files to keep standard environments for everyone. There are many other ways to do it, but this is how I've been handling it.

The qduct.lsp does automatically load the layers and our linetypes so that may be the first error your getting, not having the lin file. That is how the LRM routine works. Give me a minute, I may have other files referenced by it. Have to read through it again and try to nail down the exact variables so I don't need the repair.
« Last Edit: September 25, 2008, 12:12:26 PM by KewlToyZ »

KewlToyZ

  • Guest
Re: AutoCAD DUCT Tool
« Reply #5 on: September 25, 2008, 11:59:32 AM »
Here is the package of tools I use with it, lintype files, a repair routine to set the drawing variables, the reactor for the cannoscale tool, the scalelistedit updates for SetScale.lsp & dvb.

KewlToyZ

  • Guest
Re: AutoCAD DUCT Tool
« Reply #6 on: September 25, 2008, 11:59:59 AM »
Ooops forgot to attach

KewlToyZ

  • Guest
Re: AutoCAD DUCT Tool
« Reply #7 on: September 25, 2008, 12:41:28 PM »
One of the things killing me is with the while loop making sure the selected EndCapPt is cleared from the last routine then set from the next selection. I thought I had it fixed yesterday, ran it a dozen times after tweaking a few things beleiving I had it fixed, then I shut down, start back up and it doesnt work again.

But the Radius and rAngle keep dying again today, worked yesterday when I shut down, now it won't read and still gets ambiguous responses for the selection letters between initget & getkword. Everytime I fixed the Elle & eanGle the Radius & rAngle quit working and vice versa. Really not sure why.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: AutoCAD DUCT Tool
« Reply #8 on: September 25, 2008, 03:29:01 PM »
I assume you have looked at this thread.
http://www.theswamp.org/index.php?topic=13556.0
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KewlToyZ

  • Guest
Re: AutoCAD DUCT Tool
« Reply #9 on: September 25, 2008, 03:42:50 PM »
Interesting, but I'm not in the UK and only available to those in the UK? They all seem to be in Metric libraries?
I am playing around with your FLEX_DUCT_17.lsp file though. Awesome tool CAB !!
I wish I really had as good a handle on the code as that.

Any chance you might know why my inputs accept ft every other fitting with my routine?
i.e. 20' is accepted on one fitting loop for (getpoint "Next Point:"), the next fitting (same one) it says invalid input, the next it accepts it again? It's always fitting loop after the first one, never works the first loop.
« Last Edit: September 25, 2008, 04:01:53 PM by KewlToyZ »

KewlToyZ

  • Guest
Re: AutoCAD DUCT Tool
« Reply #10 on: September 25, 2008, 03:58:50 PM »
Here is where I ended up, I stuck a spline command and a trim command into your flex routine to draw the centerlines on the fly and cleanup the collar ends with trim/extend. I do need to take the LRM routine out of flex since its already part of the while loop. I may break the routines out into their own routines completely like flex. Would make editing a heck of a lot easier.  :ugly:
Perhaps a dcl dialog with radio buttons would make it a better tool than the command line keying..

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: AutoCAD DUCT Tool
« Reply #11 on: September 25, 2008, 04:21:18 PM »
What's going on with this?
Code: [Select]
;(defun endCapCheck()
;(progn
(while

You have the defun commented out so it lookl like this part of the code runs when loaded.

If the units are not set to 3 or 4 then the foot mark may be rejected in the getpoint.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KewlToyZ

  • Guest
Re: AutoCAD DUCT Tool
« Reply #12 on: September 25, 2008, 05:10:40 PM »
I had trouble with it recognizing the rest of the defun commands or going back to the endcap check when I created it as a separate funtion from the rest of the command loop. Right now it detects the object or a blank space clicked on to get its width for a few of the commands. I'm trying to find a happy medium to break it up into smaller groups of Duct or Fittings. I initialize units to set it to 4 in every loop as far as I can tell, but seems to be skipping it every other time.

(command "cmdecho" 0)
(command "-units" "4" "16" "1" "2" "0" "N")
(command "cmdecho" 1)

Might have to set the units in each command or else in the ductfittings command to be a better suited control.
Now that you mention it, the endcap check is skipping over the units settings.... it jumps straight to ductfittings the first trip through..... doh!

I think this fixed it moving the units into ductfitting & continueduct
Code: [Select]
;======================================================================================================= ductfittings
(defun ductfittings ()
(command "osmode" 767)
(command "polarang" 15)
(command "autosnap" 29)

(command "cmdecho" 0)
(command "-units" "4" "16" "1" "2" "0" "N")
(command "cmdecho" 1)

(initget "Duct,D Radius,R rAngle,A Elle,E eanGle,G Htransition,H Ctransition,C Otransition,O rtakeoFf,F otaKeoff,K fleX,X" )
(setq fitting (getkword "Duct Radius rAngle Elle eanGle Htransition Ctransition Otransition rtakeoFf otaKeoff fleX:  \n< D/R/A/E/G/H/T/O/F/K/X > D = continue Duct:"))
(cond
((= fitting "Duct") (continueduct))
((= fitting "Radius") (radius))
((= fitting "rAngle") (radiusAngle))
((= fitting "Elle") (elle))
((= fitting "eanGle") (elleAngle))
((= fitting "Htransition") (htransition))
((= fitting "cTransition") (ctransition))
((= fitting "Otransition") (otransition))
((= fitting "rtakeoFf") (rtakeoff))
((= fitting "otaKeoff") (otaKeoff))
((= fitting "fleX") (c:flex))
)

;(command "polarang" userpol)
;(command "clayer" userlayer); -----------------------Return User Layer Settings
(*error* "") ; restore variables
(princ "\n Osnaps returned. ductfittings..") ; -----------------------Return User Osmode Settings
)

Now I need to break this up into some logical fitting type groups for a shorter and easier approach.
The Elle & elanGle are essentially identical as well as Radius & rAngle with the exception of the standard ones being 90 degree fittings and the others allow custom angles. Could be better to set 90 as the default if the inclAngle is nil....

So that would reduce 4 commands to 2 commands..
I think I will start it off with Duct / Elbows / Transitions / Fittings for the choices to make the choices more concise.
« Last Edit: September 25, 2008, 05:44:55 PM by KewlToyZ »

KewlToyZ

  • Guest
Re: AutoCAD DUCT Tool
« Reply #13 on: September 26, 2008, 03:57:29 PM »
Hmmm, I'm running into a whole new issue....
How does one structure a series of user condition input queires?

I never tried to drill down through them to make the lists shorter?

I went a roundabout way but it seems to loop back to the original ductfittings line everytime I make a selection:
Code: [Select]
;======================================================================================================= ductfittings
(defun ductfittings ()
(command "osmode" 767)
(command "polarang" 15)
(command "autosnap" 29)
(command "snapang" 0)
(command "cmdecho" 0)
(command "-units" "4" "16" "1" "2" "0" "N")
(command "cmdecho" 1)

(initget "Duct,D Elbow,E Transition,T tAkeoff,A fleX,X" )
(setq fitting (getkword "Duct \ Elbows \ Transitions \ takeOffs \ Flexduct :  \n< D/E/T/O/F > D = continue Duct:"))
(cond
((= fitting "Duct") (continueduct))
((= fitting "Elbows") (elbows))
((= fitting "Transitions") (transitions))
((= fitting "takeOffs") (takeoffs))
((= fitting "Flexduct") (c:flex))
)

;(command "polarang" userpol)
;(command "clayer" userlayer); -----------------------Return User Layer Settings
(*error* "") ; restore variables
(princ "\n Osnaps returned. ductfittings..") ; -----------------------Return User Osmode Settings
)
;======================================================================================================= End of ductfittings

;======================================================================================================= elbows
(defun elbows ()
(command "osmode" 767)
(command "polarang" 15)
(command "autosnap" 29)
(command "snapang" 0)
(command "cmdecho" 0)
(command "-units" "4" "16" "1" "2" "0" "N")
(command "cmdecho" 1)

(initget "Radius,R radiusAngle,A eLle,L Elleangle,E " )
(setq fitting (getkword "Radius / radiusAngle / eLle / Elleangle :  \n< R/A/L/E > L = Elle :"))
(cond
((= fitting "Radius") (radius))
((= fitting "radiusAngle") (radiusAngle))
((= fitting "eLle") (elle))
((= fitting "Elleangle") (elleAngle))
) ; End cond


(*error* "") ; restore variables
(princ "\n Osnaps returned. Elbows..") ; -----------------------Return User Osmode Settings
); End of Elbows
;======================================================================================================= End of Elbows

;======================================================================================================= transitions
(defun transitions ()
(command "osmode" 767)
(command "polarang" 15)
(command "autosnap" 29)
(command "snapang" 0)
(command "cmdecho" 0)
(command "-units" "4" "16" "1" "2" "0" "N")
(command "cmdecho" 1)

(initget " Htransition,H Ctransition,C Otransition,O " )
(setq fitting (getkword "Htransition / Ctransition / Otransition :  \n< H/C/O > C = concentric transition :"))
(cond
((= fitting "Htransition") (htransition))
((= fitting "Ctransition") (ctransition))
((= fitting "Otransition") (otransition))
)


(*error* "") ; restore variables
(princ "\n Osnaps returned. transitions..") ; -----------------------Return User Osmode Settings
)
;======================================================================================================= End of transitions

;======================================================================================================= takeoffs
(defun takeoffs ()
(command "osmode" 767)
(command "polarang" 15)
(command "autosnap" 29)
(command "snapang" 0)
(command "cmdecho" 0)
(command "-units" "4" "16" "1" "2" "0" "N")
(command "cmdecho" 1)

(initget "Rtakeoff,R Otakeoff,O " )
(setq fitting (getkword "Rtakeoff / Otakeoff :  \n< R/O > O = rectangular takeoff:"))
(cond
((= fitting "Rtakeoff") (rtakeoff))
((= fitting "OtaKeoff") (otaKeoff))
)


(*error* "") ; restore variables
(princ "\n Osnaps returned. takeoffs..") ; -----------------------Return User Osmode Settings
)
;======================================================================================================= End of takeoffs




Andrea

  • Water Moccasin
  • Posts: 2372
Re: AutoCAD DUCT Tool
« Reply #14 on: October 01, 2008, 09:18:22 AM »
Comming Soon....

;-)

Keep smile...

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: AutoCAD DUCT Tool
« Reply #15 on: October 01, 2008, 10:18:59 AM »
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

KewlToyZ

  • Guest
Re: AutoCAD DUCT Tool
« Reply #16 on: October 07, 2008, 08:52:43 AM »
AEC based content?

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: AutoCAD DUCT Tool
« Reply #17 on: October 07, 2008, 09:29:33 AM »
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

KewlToyZ

  • Guest
Re: AutoCAD DUCT Tool
« Reply #18 on: October 07, 2008, 11:07:10 AM »
AEC Just seems to hog too many resources for general application on our end.
Same cat skinning, more power required....
Don't get me wrong, I've found 3D to be an asset in some cases, but more often 2D does its intended purpose.
Of course we have all of our own customizations setup with minor tweaks here and there.
We have MEP 2008 & 2009 around 90 licenses.
All of this 3D is still file based and the prints are what get approved, not the files.
If a project can pay for the added resource requirements then we would use it.
But so far, the money/time/training isn't proving worth the investment for a large firm.
Small department investment sure, but the customers don't really demand this,
they want minimal costs for the engineering still.
« Last Edit: October 07, 2008, 11:14:36 AM by KewlToyZ »

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: AutoCAD DUCT Tool
« Reply #19 on: October 07, 2008, 11:53:03 AM »
So you guys aren't riding the "BIM train" yet?  Everyone around here is all fired up about BIM and Revit.  Woo hoo!  BIM!! REVIT!!  "Um... so you guys can do BIM, right?"   Yeah... we can "do BIM" you moron.  Do you even know what its all about??!?

We do 3D coordination for tight mechanical rooms or certain areas of a building that we know are problematic.  3D is NOT the standard around here.  And as for moving to Revit for all of our 3D... maybe next year, if Revit MEP is at least half-baked.  Structure is pretty good (hell it should be, it's been around for what, 5 years now?)


<sarcastic voive> 'Can you do BIM??' </sarcastic voice>

Take this BIM and shove it up.....
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

KewlToyZ

  • Guest
Re: AutoCAD DUCT Tool
« Reply #20 on: October 07, 2008, 12:26:29 PM »
LMAO! Sentiments agreed.
I still haven't seen many architects manage project data structure well enough with AutoCAD,
so what can I really expect with Revit???
The thing that bothers me most is that we can't really paralell the project development with the Architect in a Revit environment.
They really have to be nearly complete for us to have enough data to bother beginning our work for their design changes. Either that, or we end up in a continuous design change cycle with improper data leading to just as much labor and progress as a normal system we already have in place.
BIM is not a gravy train, its a concept.
We can add to BIM data, but, honestly,
I haven't seen a project that was done according to the theory yet from our clients.
Of course our costs are rather high to accept working with a BIM project because the process is cost prohibitive still.
We will gladly take it into CAD, get the permits completed and let the client continue working with it, but other than that, its a cluster f*^& of data we can say is nice, but hasn't really inspired us or proven cost beneficial for our industry.
Sure the examples look nice, but to get those templates setup to work according to the clients needs would require many different template setups for many clients. As a CADD manager, it sounds great, I can work on other things, the designers can handle everything, there isn't any customizations outside the template... until we run into what it can't do.
Sure let's buy a black box the vendor can't guarantee to do what we need, troubleshoot it on live projects, patch with AutoCAD until we get to the next version and re-work our production work flow again every 6 months to compensate for it and lose valuable time with interpretation rather than concentrate on making money predictably with what we already have in place  :ugly:

I don't mean to come off as obtuse or locked into one mentality, I do like the aspects of working smarter and not harder, but so far, it still appears to be working harder than smarter. Plus all of my experienced guys, will go back
to what they know under the deadline gun on multiple fronts everytime. I still have some of the most experienced and reliable guys running AutoCAD 2007 by choice because they are used to it. And I'm not going to force them through change for the sake of the software vendors pocketbooks.

Sebb77

  • Guest
Re: AutoCAD DUCT Tool
« Reply #21 on: October 07, 2008, 03:17:43 PM »
I do think REVIT is a great product but it requires a full implementation in order to achieve good performance. Otherwise it will often mean time and money losses. Up to now i almost never seen an engineer looking at 3D models on a construction site, it is still on paper, 2D. I do have a colleague mastering Revit, and providing calculations to an engineer who yet doesn't have the courage to entirely trust all of those... Most of the drawings have to be converted to dwg for our clients anyways. I do believe BIM is the "train" of the future and will be sooner than later but there is still some work to do with the ''rails" (or the rail if it has to be a monorail  :-D)...