FordForever5305913 Posted January 30, 2006 Posted January 30, 2006 i am trying to make a exaust pipe for a semi i am making in autocad 2006 and the pipe bends at the top. so i was wondering how can i bend a 3d cylinder/pipe? Thanks Quote
ReMark Posted January 30, 2006 Posted January 30, 2006 Draw the centerline of the exhaust pipe, using a polyline, then draw and extrude a circle along this "path" corresponding to the O.D. of the pipe. Quote
Spageddie Posted January 31, 2006 Posted January 31, 2006 be sure to use a polyline with radiused corners for the bends... Quote
seanevans00 Posted February 9, 2006 Posted February 9, 2006 Hi, I am a bit of a novice when it comes to design but I can make way around AutoCAD 2006. How did you go about creating your exhaust pipe based on poly line? Regards Sean Quote
ASMI Posted February 10, 2006 Posted February 10, 2006 Try this two LISPs. (defun c:xpipe(/ ACTDOC ACTLAY ACTSP BASELINE BASESET CIRENT DICOUNT DIVDID EXCIR LAYST OBJTYPE OLDDIA OLDECHO STARTPT XORD YORD ZORD *ERROR*) (vl-load-com) (defun *error* (msg) (vla-put-Lock actLay laySt) (setvar "CMDECHO" oldEcho) (vla-EndUndoMark actDoc) (princ) ); end of *error* (if(not pipe:exDia)(setq pipe:exDia 40.0)) (setq actDoc (vla-get-ActiveDocument (vlax-get-Acad-object)) actLay(vla-get-ActiveLayer actDoc) oldDia pipe:exDia oldEcho(getvar "CMDECHO") ); end setq (vla-StartUndoMark actDoc) (setvar "CMDECHO" 0) (if(= 0(vla-get-ActiveSpace actDoc)) (setq actSp(vla-get-PaperSpace actDoc)) (setq actSp(vla-get-ModelSpace actDoc)) ); end if (setq laySt(vla-get-Lock actLay)) (vla-put-Lock actLay :vlax-false) (setq pipe:exDia (getreal (strcat "\nSpecify pipe diameter <"(rtos pipe:exDia)">: "))) (if(null pipe:exDia)(setq pipe:exDia oldDia)) (initget "Yes No") (setq delFlag (getkword "\nDelete extrude path(s)? [Yes/No] <No>: ")) (if(null delFlag)(setq delFlag "No")) (princ "\n<<< Select objects to extrude and press Enter >>>") (if (setq baseSet (ssget '((-4 . "<OR")(0 . "*LINE")(0 . "CIRCLE") (0 . "ARC")(0 . "ELLIPSE")(-4 . "OR>") (-4 . "<NOT")(-4 . "<OR")(0 . "SPLINE") (0 . "MLINE")(-4 . "OR>")(-4 . "NOT>")))) (progn (setq baseSet(vl-remove-if 'listp (mapcar 'cadr (ssnamex baseSet)))) (foreach pathEnt baseSet (setq baseLine (vlax-ename->vla-object pathEnt) objType(vla-get-ObjectName baseLine) startPt(vlax-curve-getStartPoint baseLine) 3dPos (vlax-curve-getFirstDeriv baseLine (vlax-curve-getParamAtPoint baseLine startPt)) diCount(strlen (itoa (apply 'max (mapcar 'abs (mapcar 'fix startPt))))) divDid "1" ); end setq (repeat diCount (setq divDid(strcat divDid "0")) ); end repeat (setq divDid(atoi divDid)) (if(/= 0.0(car 3dPos)) (setq XOrd(/(car 3dPos)divDid)) (setq XOrd (car 3dPos)) ); end if (if(/= 0.0(cadr 3dPos)) (setq YOrd(/(cadr 3dPos)divDid)) (setq YOrd (cadr 3dPos)) ); end if (if(/= 0.0(nth 2 3dPos)) (setq ZOrd(/(nth 2 3dPos)divDid)) (setq ZOrd (nth 2 3dPos)) ); end if (setq 3dPos(list XOrd YOrd ZOrd)) (setq exCir (vla-addCircle actSp (vlax-3d-Point startPt) (/ pipe:exDia 2))) (vla-put-Normal exCir(vlax-3D-point 3dPos)) (setq cirEnt(vlax-vla-object->ename exCir)) (command "_.extrude" cirEnt "" "_p" pathEnt) (command "_.erase" cirEnt "") (if(= "Yes" delFlag) (vla-delete baseLine) ); end if ); end foreach (vla-put-Lock actLay laySt) (setvar "CMDECHO" oldEcho) (vla-EndUndoMark actDoc) ); end progn ); end if (princ) ); end of c:xpipe (defun c:xtube(/ 3DPOS ACTDOC ACTLAY ACTSP BASELINE BASESET DICOUNT DIVDID EXCIR EXENT EXTUBE INCIR INENT INTUBE LAYST OBJTYPE OLDECHO oldWidth oldHeight STARTPT XORD YORD ZORD DELFLAG *ERROR*) (vl-load-com) (defun *error* (msg) (vla-put-Lock actLay laySt) (setvar "CMDECHO" oldEcho) (vla-EndUndoMark actDoc) (princ) ); end of *error* (if(not tube:Width)(setq tube:Width 40.0)) (if(not tube:Height)(setq tube:Height 37.0)) (setq actDoc (vla-get-ActiveDocument (vlax-get-Acad-object)) actLay(vla-get-ActiveLayer actDoc) oldWidth tube:Width oldHeight tube:Height oldEcho(getvar "CMDECHO") ); end setq (vla-StartUndoMark actDoc) (setvar "CMDECHO" 0) (if(= 0(vla-get-ActiveSpace actDoc)) (setq actSp(vla-get-PaperSpace actDoc)) (setq actSp(vla-get-ModelSpace actDoc)) ); end if (setq laySt(vla-get-Lock actLay)) (vla-put-Lock actLay :vlax-false) (setq tube:Width (getreal (strcat "\nSpecify external diameter <"(rtos tube:Width)">: ")) tube:Height (getreal (strcat "\nSpecify internal diameter <"(rtos tube:Height)">: ")) ); end setq (if(null tube:Height)(setq tube:Height oldHeight)) (if(null tube:Width)(setq tube:Width oldWidth)) (if(< tube:Height tube:Width) (progn (initget "Yes No") (setq delFlag (getkword "\nDelete extrude path(s)? [Yes/No] <No>: ")) (if(null delFlag)(setq delFlag "No")) (princ "\n<<< Select objects to extrude and press Enter >>>") (if (setq baseSet (ssget '((-4 . "<OR")(0 . "*LINE")(0 . "CIRCLE") (0 . "ARC")(0 . "ELLIPSE")(-4 . "OR>") (-4 . "<NOT")(-4 . "<OR")(0 . "SPLINE") (0 . "MLINE")(-4 . "OR>")(-4 . "NOT>")))) (progn (setq baseSet(vl-remove-if 'listp (mapcar 'cadr (ssnamex baseSet)))) (foreach pathEnt baseSet (setq baseLine (vlax-ename->vla-object pathEnt) objType(vla-get-ObjectName baseLine) startPt(vlax-curve-getStartPoint baseLine) 3dPos (vlax-curve-getFirstDeriv baseLine (vlax-curve-getParamAtPoint baseLine startPt)) diCount(strlen (itoa (apply 'max (mapcar 'abs (mapcar 'fix startPt))))) divDid "1" ); end setq (repeat diCount (setq divDid(strcat divDid "0")) ); end repeat (setq divDid(atoi divDid)) (if(/= 0.0(car 3dPos)) (setq XOrd(/(car 3dPos)divDid)) (setq XOrd (car 3dPos)) ); end if (if(/= 0.0(cadr 3dPos)) (setq YOrd(/(cadr 3dPos)divDid)) (setq YOrd (cadr 3dPos)) ); end if (if(/= 0.0(nth 2 3dPos)) (setq ZOrd(/(nth 2 3dPos)divDid)) (setq ZOrd (nth 2 3dPos)) ); end if (setq 3dPos(list XOrd YOrd ZOrd)) (setq exCir (vla-addCircle actSp (vlax-3d-Point startPt) (/ tube:Width 2)) inCir (vla-addCircle actSp (vlax-3d-Point startPt) (/ tube:Height 2)) ); end setq (vla-put-Normal exCir(vlax-3D-point 3dPos)) (vla-put-Normal inCir(vlax-3D-point 3dPos)) (setq exEnt(vlax-vla-object->ename exCir) inEnt(vlax-vla-object->ename inCir) ) ; end setq (command "_.extrude" exEnt "" "_p" pathEnt) (setq exTube(entlast)) (command "_.extrude" inEnt "" "_p" pathEnt) (setq inTube(entlast)) (command "_subtract" exTube "" inTube "") (command "_.erase" exEnt "") (command "_.erase" inEnt "") (if(= "Yes" delFlag) (vla-delete baseLine) ); end if ); end foreach (vla-put-Lock actLay laySt) (setvar "CMDECHO" oldEcho) ); end progn ); end if ); end progn (princ "\nInternal diameter more or equal external diameter! ") ); end if (vla-EndUndoMark actDoc) (princ) ); end of c:xtube Quote
ReMark Posted February 11, 2006 Posted February 11, 2006 ASMI: While I'm sure the two LISP programs work beautifully it begs the question, "Isn't that a bit over-the-top?" How about drawing the I.D. and O.D. in plan view, use the Region and Subtract (Solids) command, then changing the UCS and drawing the centerline of the exhaust pipe. Radius the bend at the top and then extrude the circles along the "path"? Slice the exhaust pipe at the appropriate point along the curve. Done. I think your LISP programs might be more suitable to someone doing a lot of piping runs. Just an observation...not a criticism. Please point out the error of my ways should I be mistaken. I can always benefit from learning something new. Thanks. Quote
ASMI Posted February 11, 2006 Posted February 11, 2006 >ReMark I draw sprinkler systems and I should draw hundreds pipes a day. Therefore XPIPE which allow to draw many pipes per time help to me very much . XTUBE I have written simply so. Quote
ReMark Posted February 12, 2006 Posted February 12, 2006 ASMI: Thank you for that explanation. As I suspected, you need to produce a good deal of piping runs in a short period of time. Your LISP program gives you that capability. I appreciate that you shared it with us. Quote
sibbles Posted February 15, 2006 Posted February 15, 2006 Hello I got Acad to load the lsp that are posted in here, but don't know how to get them to run Could you tell me what I need to draw to get the lsp to work, I drew a polyline and a circle at the end of it reprecenting the diameter i needed but all I got from both lsp was "; error: An error has occurred inside the *error* functionbad argument type: VLA-OBJECT nil" Any help is greatly appreciated Regards Atli F. Quote
ASMI Posted February 15, 2006 Posted February 15, 2006 >sibbles You use what version AutoCAD? Can be 2000 or 2002? I unfortunately do not have such version, but try this: (defun c:xpipe(/ ACTDOC ACTLAY ACTSP BASELINE BASESET CIRENT DICOUNT DIVDID EXCIR LAYST OBJTYPE OLDDIA OLDECHO STARTPT XORD YORD ZORD *ERROR*) (vl-load-com) (defun *error* (msg) (vla-put-Lock actLay laySt) (setvar "CMDECHO" oldEcho) (if(= 16(Asmi-AcadVersion nil)) (vla-EndUndoMark actDoc) ); end if (princ) ); end of *error* (if(not pipe:exDia)(setq pipe:exDia 40.0)) (setq actDoc (vla-get-ActiveDocument (vlax-get-Acad-object)) actLay(vla-get-ActiveLayer actDoc) oldDia pipe:exDia oldEcho(getvar "CMDECHO") ); end setq (vla-StartUndoMark actDoc) (setvar "CMDECHO" 0) (if(= 0(vla-get-ActiveSpace actDoc)) (setq actSp(vla-get-PaperSpace actDoc)) (setq actSp(vla-get-ModelSpace actDoc)) ); end if (setq laySt(vla-get-Lock actLay)) (vla-put-Lock actLay :vlax-false) (setq pipe:exDia (getreal (strcat "\nSpecify pipe diameter <"(rtos pipe:exDia)">: "))) (if(null pipe:exDia)(setq pipe:exDia oldDia)) (initget "Yes No") (setq delFlag (getkword "\nDelete extrude path(s)? [Yes/No] <No>: ")) (if(null delFlag)(setq delFlag "No")) (princ "\n<<< Select objects to extrude and press Enter >>>") (if (setq baseSet (ssget '((-4 . "<OR")(0 . "*LINE")(0 . "CIRCLE") (0 . "ARC")(0 . "ELLIPSE")(-4 . "OR>") (-4 . "<NOT")(-4 . "<OR")(0 . "SPLINE") (0 . "MLINE")(-4 . "OR>")(-4 . "NOT>")))) (progn (setq baseSet(vl-remove-if 'listp (mapcar 'cadr (ssnamex baseSet)))) (foreach pathEnt baseSet (setq baseLine (vlax-ename->vla-object pathEnt) objType(vla-get-ObjectName baseLine) startPt(vlax-curve-getStartPoint baseLine) 3dPos (vlax-curve-getFirstDeriv baseLine (vlax-curve-getParamAtPoint baseLine startPt)) diCount(strlen (itoa (apply 'max (mapcar 'abs (mapcar 'fix startPt))))) divDid "1" ); end setq (repeat diCount (setq divDid(strcat divDid "0")) ); end repeat (setq divDid(atoi divDid)) (if(/= 0.0(car 3dPos)) (setq XOrd(/(car 3dPos)divDid)) (setq XOrd (car 3dPos)) ); end if (if(/= 0.0(cadr 3dPos)) (setq YOrd(/(cadr 3dPos)divDid)) (setq YOrd (cadr 3dPos)) ); end if (if(/= 0.0(nth 2 3dPos)) (setq ZOrd(/(nth 2 3dPos)divDid)) (setq ZOrd (nth 2 3dPos)) ); end if (setq 3dPos(list XOrd YOrd ZOrd)) (setq exCir (vla-addCircle actSp (vlax-3d-Point startPt) (/ pipe:exDia 2))) (vla-put-Normal exCir(vlax-3D-point 3dPos)) (setq cirEnt(vlax-vla-object->ename exCir)) (command "_.extrude" cirEnt "" "_p" pathEnt) (command "_.erase" cirEnt "") (if(= "Yes" delFlag) (vla-delete baseLine) ); end if ); end foreach (vla-put-Lock actLay laySt) (setvar "CMDECHO" oldEcho) (if(= 16(Asmi-AcadVersion nil)) (vla-EndUndoMark actDoc) ); end if ); end progn ); end if (princ) ); end of c:xpipe (defun c:xtube(/ 3DPOS ACTDOC ACTLAY ACTSP BASELINE BASESET DICOUNT DIVDID EXCIR EXENT EXTUBE INCIR INENT INTUBE LAYST OBJTYPE OLDECHO oldWidth oldHeight STARTPT XORD YORD ZORD DELFLAG *ERROR*) (vl-load-com) (defun *error* (msg) (vla-put-Lock actLay laySt) (setvar "CMDECHO" oldEcho) (if(= 16(Asmi-AcadVersion nil)) (vla-EndUndoMark actDoc) ); end if (princ) ); end of *error* (if(not tube:Width)(setq tube:Width 40.0)) (if(not tube:Height)(setq tube:Height 37.0)) (setq actDoc (vla-get-ActiveDocument (vlax-get-Acad-object)) actLay(vla-get-ActiveLayer actDoc) oldWidth tube:Width oldHeight tube:Height oldEcho(getvar "CMDECHO") ); end setq (vla-StartUndoMark actDoc) (setvar "CMDECHO" 0) (if(= 0(vla-get-ActiveSpace actDoc)) (setq actSp(vla-get-PaperSpace actDoc)) (setq actSp(vla-get-ModelSpace actDoc)) ); end if (setq laySt(vla-get-Lock actLay)) (vla-put-Lock actLay :vlax-false) (setq tube:Width (getreal (strcat "\nSpecify external diameter <"(rtos tube:Width)">: ")) tube:Height (getreal (strcat "\nSpecify internal diameter <"(rtos tube:Height)">: ")) ); end setq (if(null tube:Height)(setq tube:Height oldHeight)) (if(null tube:Width)(setq tube:Width oldWidth)) (if(< tube:Height tube:Width) (progn (initget "Yes No") (setq delFlag (getkword "\nDelete extrude path(s)? [Yes/No] <No>: ")) (if(null delFlag)(setq delFlag "No")) (princ "\n<<< Select objects to extrude and press Enter >>>") (if (setq baseSet (ssget '((-4 . "<OR")(0 . "*LINE")(0 . "CIRCLE") (0 . "ARC")(0 . "ELLIPSE")(-4 . "OR>") (-4 . "<NOT")(-4 . "<OR")(0 . "SPLINE") (0 . "MLINE")(-4 . "OR>")(-4 . "NOT>")))) (progn (setq baseSet(vl-remove-if 'listp (mapcar 'cadr (ssnamex baseSet)))) (foreach pathEnt baseSet (setq baseLine (vlax-ename->vla-object pathEnt) objType(vla-get-ObjectName baseLine) startPt(vlax-curve-getStartPoint baseLine) 3dPos (vlax-curve-getFirstDeriv baseLine (vlax-curve-getParamAtPoint baseLine startPt)) diCount(strlen (itoa (apply 'max (mapcar 'abs (mapcar 'fix startPt))))) divDid "1" ); end setq (repeat diCount (setq divDid(strcat divDid "0")) ); end repeat (setq divDid(atoi divDid)) (if(/= 0.0(car 3dPos)) (setq XOrd(/(car 3dPos)divDid)) (setq XOrd (car 3dPos)) ); end if (if(/= 0.0(cadr 3dPos)) (setq YOrd(/(cadr 3dPos)divDid)) (setq YOrd (cadr 3dPos)) ); end if (if(/= 0.0(nth 2 3dPos)) (setq ZOrd(/(nth 2 3dPos)divDid)) (setq ZOrd (nth 2 3dPos)) ); end if (setq 3dPos(list XOrd YOrd ZOrd)) (setq exCir (vla-addCircle actSp (vlax-3d-Point startPt) (/ tube:Width 2)) inCir (vla-addCircle actSp (vlax-3d-Point startPt) (/ tube:Height 2)) ); end setq (vla-put-Normal exCir(vlax-3D-point 3dPos)) (vla-put-Normal inCir(vlax-3D-point 3dPos)) (setq exEnt(vlax-vla-object->ename exCir) inEnt(vlax-vla-object->ename inCir) ) ; end setq (command "_.extrude" exEnt "" "_p" pathEnt) (setq exTube(entlast)) (command "_.extrude" inEnt "" "_p" pathEnt) (setq inTube(entlast)) (command "_subtract" exTube "" inTube "") (command "_.erase" exEnt "") (command "_.erase" inEnt "") (if(= "Yes" delFlag) (vla-delete baseLine) ); end if ); end foreach (vla-put-Lock actLay laySt) (setvar "CMDECHO" oldEcho) ); end progn ); end if ); end progn (princ "\nInternal diameter more or equal external diameter! ") ); end if (if(= 16(Asmi-AcadVersion nil)) (vla-EndUndoMark actDoc) ); end if (princ) ); end of c:xtube (defun Asmi-AcadVersion(Generation) (if Generation (substr (getvar "ACADVER")1 4) (substr (getvar "ACADVER")1 2) ); end if ); end of Asmi-AcadVersion Quote
rusty105 Posted April 20, 2007 Posted April 20, 2007 ok, sorry to be late to the party, but xtube works good for me. The only question I have is when 2 tubes come together, how do I trim the parts of the tube I do not want? Thanks Rusty Quote
gender123 Posted August 29, 2010 Posted August 29, 2010 what command should i type in the commandline? Quote
areyes Posted November 14, 2012 Posted November 14, 2012 does anyone out there know the command for 'xpipe? (xpipe) does not work Quote
JD Mather Posted November 14, 2012 Posted November 14, 2012 does anyone out there know the command for 'xpipe? (xpipe) does not work Did you load the LISP? Quote
hoss Posted November 15, 2012 Posted November 15, 2012 does anyone out there know the command for 'xpipe? (xpipe) does not work You have to save the lisp on you pc first "name.lsp" The use "Appload" to load it or simply drag and drop the file the drawing area then you shoud get Command: (LOAD "C:/Users/xxxx/Desktop/test.lsp") C:XTUBE now you can type xpipe or xtube and follow the command line Quote
hoss Posted November 15, 2012 Posted November 15, 2012 For some reason I see "& # 4 0 ; " instead of open bracket "(" and same for all others Is this something to do with the web codes Quote
SLW210 Posted November 15, 2012 Posted November 15, 2012 Here is the LISPs I have. They seem to be working. xpipe.lsp xtube.lsp Quote
the downing effect Posted November 21, 2012 Posted November 21, 2012 great routine, thanks for sharing Quote
Buzza Posted November 28, 2012 Posted November 28, 2012 The xtube and xpipe seem great. only thing is when i try to use xtube i works the same as xpipe. It does not put a channel in the tube but just makes a pipe to the OD. Anyone know whats wrong? Quote
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.