viviancarvalho Posted March 10, 2010 Share Posted March 10, 2010 (edited) 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 November 7, 2012 by SLW210 Quote Link to comment Share on other sites More sharing options...
Tankman Posted March 10, 2010 Share Posted March 10, 2010 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. Quote Link to comment Share on other sites More sharing options...
akbcad Posted November 7, 2012 Share Posted November 7, 2012 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 Quote Link to comment Share on other sites More sharing options...
ReMark Posted November 7, 2012 Share Posted November 7, 2012 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. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted November 7, 2012 Share Posted November 7, 2012 Please read the CODE POSTING GUIDLINES in the future. Quote Link to comment Share on other sites More sharing options...
welldriller Posted March 14, 2014 Share Posted March 14, 2014 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. Quote Link to comment Share on other sites More sharing options...
welldriller Posted May 2, 2014 Share Posted May 2, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.