Jump to content

Does anyone know how to make a flexible hose lintype in LT?


naknakkus

Recommended Posts

I've seen LISP routines that achieve this, but I can't use them in LT. Is there a way to create a linetype that would allowed me to draw a flexible hose?

Link to comment
Share on other sites

  • Replies 26
  • Created
  • Last Reply

Top Posters In This Topic

  • viviancarvalho

    7

  • Tankman

    4

  • naknakkus

    4

  • lpseifert

    3

Top Posters In This Topic

Posted Images

This is by CAB I believe

*N12,Corrugated Pipe 000000000000000000000000
A,0,-.000403,["U",Standard,y=-.052104,s=.05],-.033333,["U",Standard,y=.047896,s=.05,r=180],-.000382

Works pretty well if the text style "Standard" uses the txt.shx font with a height of 0. You'll need to play with Celtscale to get the right size.

Link to comment
Share on other sites

Thanks. I tried that out, but it isn't exactly what I want. I've been drawing the lines with arcs, though, so at least I have a way to do it, albeit slowly. It works, but corners are tricky! Here's a screenshot of what I'm trying to do:

0416-MEL-PR-100 01-Model.png

Link to comment
Share on other sites

You could...

make a shape of a 'squiggle' and include it in a linetype definition.

use the tilde ~ as part of the linetype definition.

make a block of the 'squiggle', draw the flexible hose with a polyline, use measure to 'array' the block along the pline, erase the pline.

Link to comment
Share on other sites

Hi

Check out the attached Lisp.

I usually use it to show flexible ducts in my HVAC drawings.

 

Thanks & regards

Vivian

 

Vivian:

 

I tried your lisp however, I get error message and nothing happens after I select the center line. Am I doing something wrong?

 

Or, what should I be doing? :?

Link to comment
Share on other sites

Bummer. It's strange that squiggly linetypes like that aren't bundled with the program. I've done quite a few drawings that needed them.

 

Anyway, I managed to draw the stuff manually. Thanks for your responses.

Link to comment
Share on other sites

Hi Tankman

The lisp would work with drawings made in Milimeters only.

Just type "fd" & select the entity you would like to draw the flexible on.

The selected entity can be lwpolyline,arc,line etc. It works very fine with me.

Link to comment
Share on other sites

Ok Tankman

i also faced the same problem when i tried on a diff pc.

my mistake was that i dint make layers in the lisp which i m using

i ve rectified it. Try it now be sure that your dwg is in mm & the entity which you select are more of more length say 500 mm or so.

check it now & let me know.

I know i m not that pro in lisp but i somehow get my work done with i know.

 

 

 

FLEXIBLE DUCTS

;
;This lisp will draw flexible duct on the selected entity.
;Type fd & enter
;User needs to select the centre line of flexible.
;Thats all. You will have flexible duct in a blink of
;your eye
;
;
(defun c:fd(/ ce osm clyr fr cin c1 c2 c3 c4 c5 c6 c7 cl fb terr)
 (princ "\n Made easy for you by Vivian Carvalho")
 (setq ce(getvar "cmdecho")
   osm(getvar "osmode")
   clyr(getvar "clayer")
   fr(getvar "filletrad"))
 (setq terr *error*)
 (setq *error* SAD_SET)
 (setvar "cmdecho" 0)
 (setvar "osmode" 0)
 (setvar "filletrad" 100)
 (setq cl(car (entsel "\n Select the centre line of flexible : ")))
 (if (null (tblsearch "layer" "DUCTING"))
   (command "layer" "n" "DUCTING" "c" "magenta" "DUCTING" "")
   (princ))
 (if (= "LWPOLYLINE" (cdr (assoc 0 (entget cl))))
   (command "fillet" "p" cl)
   (princ))
 (command "change" cl"" "p" "la" "DUCTING" "")
 (setq    cin(cdr (assoc 10 (entget cl)))
   c1(polar cin 1.570796 100)
   c2(polar cin 4.712387 100)
   c3(polar cin 0.0 20)
   c4(polar c3 1.570796 50)
   c5(polar c3 4.712387 50)
   c6(polar c5 3.141592 40)
   c7(polar c4 3.141592 40))
 (command "pline" c1 c4 c5 c2 c6 c7 "c")
 (setq fb(entlast))
 (command "change" fb"" "p" "la" "DUCTING" "c" "7" "")
 (if (null(tblsearch "block" "flex"))
   (progn (command "block" "flex" cin fb"")
     (command "measure" cl "b" "flex" "y" "40"))
   (progn (command "measure" cl "b" "flex" "y" "40")
     (command "erase" fb"")))
 (command "clayer" clyr)
 (command "osmode" osm)
 (command "filletrad" fr)
 (command "cmdecho" ce)
 (princ))
(defun SAD_SET (ERRORMSG)
 (command nil nil nil)
 (if (not (member ERRORMSG '("console break" "Function Cancelled")))
   (princ (strcat "\nError:" ERRORMSG)))
 (setvar "cmdecho"   ce)
 (setvar "osmode"    osm)
 (setvar "clayer"    clyr)
 (princ  "\nAttention! An Error Has Occurred!")
 (princ  "\nProgram Now Restoring The User Settings.")
 (terpri)
 (setq *error* terr)
 (princ)
)

Edited by SLW210
Link to comment
Share on other sites

Vivian:

 

Certainly worked excellent! Is there a way to adjust the flexible duct diameter?

 

The diameter is, or appears, always the same although I can scale to suit.

 

Again, excellent work.

 

Now, we'll have to get some large tiewraps to secure the flexible duct work. :wink:

Link to comment
Share on other sites

I use the spline curve command to draw flexible ductwork and the diameter is set by the linetype scale when prompted. Note the macro will set your ltscale to 1 & psltscale to 0 automatically. This will only work with a drg ltscale of 1 so you need to work with object or layer ltscales within the drawing for all. It also creates a layer for you. I use the following Menue Macro in AutoCAD LT 2007 from a customised menu button.

 

^C^C_-ltype;load;flexduct;acadltiso.lin;;;^Cltscale;1;psltscale;0;-layer;make;m-duct-flex;c;white;;ltype;flexduct;;;ortho;off;-ltype;set;bylayer;;spline;\\^O;\\chprop;last;;ltscale;\;

 

For this macro to work you need to download the shape file es.shx and put in the correct autocad support directory depending on version.

 

You will also need to create the following custom linetype: -

 

*FLEXDUCT,Flexible duct [][][][][][][][][][][][][][]
A,.01,-.01,[bOX,es.shx,x=-.1,s=.5],-.25,.01

 

You may need to play around a bit as may dislay differently in different versions but is a great macro.

 

Good luck and enjoy.

Edited by SLW210
Link to comment
Share on other sites

Without unwanted gap in macro.

 

^C^C_-ltype;load;flexduct;acadltiso.lin;;;^Cltscale;1;psltscale;0;-layer;make;m-duct-flex;c;white;;ltype;flexduct;;;ortho;off;-ltype;set;bylayer;;spline;\\^O;\\chprop;last;;ltscale;\;

 

Sorry guys. Gaps appeared when pasted in.

Edited by SLW210
Link to comment
Share on other sites

You need to remove the unwanted spaces in the prevoius thread/macro. They appear when I post the response. All enter's in the macro are by ";" so all gaps/spaces in the macro need to be removed.

 

I try again anyway

 

^C^C_-ltype;load;flexduct;acadltiso.lin;;;^Cltscale;1;psltscale;0;-layer;make;m-duct-flex;c;white;;ltype;flexduct;;;ortho;off;-ltype;set;bylayer;;spline;\\^O;\\chprop;last;;ltscale;\;

Edited by SLW210
Link to comment
Share on other sites

Thanks Tankman.

I dint make it to have variable diameters, Coz it would require extra input time. Anyways the flexible ducts we use are hardly from a range of dia 150 to dia 300, hence when printed on a scale of 1 : 100 the difference will hardly be of 1 mm. Then to if you want me to do it that way for you i surely will. Just let me know. Are you also into hvac drafting ??

Regards

Vivian

Link to comment
Share on other sites

Hi Tankman

 

Try this routine. Its as you desired.

 

;            FLEXIBLE DUCTS
;
;This lisp will draw flexible duct on the selected entity.
;Type fd & enter
;User needs to select the centre line of flexible & provide diameter.
;Thats all. You will have flexible duct in a blink of
;your eye
;
;
(defun c:fd(/ ce osm clyr fr cin c1 c2 c3 c4 c5 c6 c7 cl fb fdia bn terr)
 (princ "\n Made easy for you by Vivian Carvalho")
 (setq ce(getvar "cmdecho")
   osm(getvar "osmode")
   clyr(getvar "clayer")
   fr(getvar "filletrad"))
 (setq terr *error*)
 (setq *error* SAD_SET)
 (setvar "cmdecho" 0)
 (setvar "osmode" 0)
 (setq cl(car (entsel "\n Select the centre line of flexible : ")))
 (setq fdia(getdist "\n Specify Diameter of the flexible : "))
 (if (> 200 fdia)
   (setvar "filletrad" 100)
   (setvar "filletrad" 200))
 (if (null (tblsearch "layer" "DUCTING"))
   (command "layer" "n" "DUCTING" "c" "magenta" "DUCTING" "")
   (princ))
 (if (= "LWPOLYLINE" (cdr (assoc 0 (entget cl))))
   (command "fillet" "p" cl)
   (princ))
 (command "change" cl"" "p" "la" "DUCTING" "")
 (setq    cin(cdr (assoc 10 (entget cl)))
   c1(polar cin 1.570796 (/ fdia 2))
   c2(polar cin 4.712387 (/ fdia 2))
   c3(polar cin 0.0 20)
   c4(polar c3 1.570796 50)
   c5(polar c3 4.712387 50)
   c6(polar c5 3.141592 40)
   c7(polar c4 3.141592 40))
 (command "pline" c1 c4 c5 c2 c6 c7 "c")
 (setq fb(entlast))
 (command "change" fb"" "p" "la" "DUCTING" "c" "7" "")
 (setq bn (strcat "FLEX"(rtos fdia 2 0)))
 (if (null(tblsearch "block" bn))
   (progn(command "block" bn cin "previous" "")
     (command "measure" cl "b" bn "y" "40"))
   (progn (command "measure" cl "b" bn "y" "40")
     (command "erase" fb"")))
 (command "clayer" clyr)
 (command "osmode" osm)
 (command "filletrad" fr)
 (command "cmdecho" ce)
 (princ))
(defun SAD_SET (ERRORMSG)
 (command nil nil nil)
 (if (not (member ERRORMSG '("console break" "Function Cancelled")))
   (princ (strcat "\nError:" ERRORMSG)))
 (setvar "cmdecho"   ce)
 (setvar "osmode"    osm)
 (setvar "clayer"    clyr)
 (princ  "\nAttention! An Error Has Occurred!")
 (princ  "\nProgram Now Restoring The User Settings.")
 (terpri)
 (setq *error* terr)
 (princ)
)

Edited by SLW210
Link to comment
Share on other sites

  • 2 months later...
Hi Viv,

any way you can make this lisp work if the drawing is in inches.

Thx

Kev

 

I will definately do that for you. I ll try to post it today itself, if possible.

Link to comment
Share on other sites

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