Jump to content

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


naknakkus

Recommended Posts

Hi Kev

Thats for you. Let me know if it worked out for you or not. Coz i ve done it in a bit hurry.

 

;FLEXIBLE DUCTS english
(defun c:fd2(/ 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")
(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 (> 8 fdia)
(setvar "filletrad" (mti 100))
(setvar "filletrad" (mti 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 (mti 20))
c4(polar c3 1.570796 (mti 50))
c5(polar c3 4.712387 (mti 50))
c6(polar c5 3.141592 (mti 40))
c7(polar c4 3.141592 (mti 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" "1.57480315"))
(progn (command "measure" cl "b" bn "y" "1.57480315")
(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)
)
;mm to inches
(defun mti (a)
(/ a 25.4))

 

Regards

Vivian

Edited by SLW210
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

If you want to create a new custom linetype, you can use the manual way and edit the respective .LIN file using a text editor - e.g. NOTEPAD (following instructions in the AutoCAD Customization Guide).

 

 

A more convenient way is to make use of the MKLTYPE Express Tool and generate your linetype directly from a pre-drawn drawing (you can use PLINEs, SHAPEs...). For shapes you can use a similar tool - MKSHAPE.

Express Tools are included in AutoCAD 2004 and higher.

Link to comment
Share on other sites

  • 2 years later...

Tankman,

After experimenting with this lisp routine it appears you need a layer called DUCTING before it will work.

Unfortunately it does not draw a wiggly line, but a series of narrow hexagons along a centre line. Not really good for representing a flexible hose.

Perhaps Autodesk has a suggestions box where you could post this as a future enhancement ? I would welcome it, as flexible hoses on P&ID's are a pain in the *rse to draw.

Andy

Link to comment
Share on other sites

You can submit your suggestions for future enhancements over at the AUGI website via the "Wish List".

 

You make it sound like every flexible hose you draw is unique. Draw what you need (one, two or three versions) and save it as a block.

 

Post an image of what you are doing currently.

Link to comment
Share on other sites

  • 1 year later...

My computer crashed so at the library but have you tried making a 1 inch square - put your lines it - make it into a block - then insert the block where & when you need it ? Don't know if this will help you or not. Just a thought.

Link to comment
Share on other sites

  • 1 month later...

Back at the library -- NAKNAKKUS -- did any of the help on here work ? did you find a way to make it work ? It would be soooo nice if people would give a final report as to what they have done with the problem dropped it, found a solution, anything is better then nothing.

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