Jump to content
danieldalio

3D pipes

Recommended Posts

danieldalio

Good night,

I am trying to draw some pipes in 3D.

What I want to is to create a path, let's say from 0,0,0 going 10 feet up, then 15 feet to the left, then 8 feet forward, then 3 feet down and so on.

I want smooth corners, not 90 degrees.

It is my understanding that I can't make a 3D polyline with arcs on it.

I'd like to make my piping by extruding a surface along a path.

Is it any way to make my piping other than creating segments and elbows and joining everything?

Thanks in advance.

Share this post


Link to post
Share on other sites
Lazer

What version of Autocad are you using? I would suggest using the sweep command or extrude along a path (for older versions).

 

Edit: Simple way for the sweep command is build your path using extruded boxes then you can do it in one hit.

Share this post


Link to post
Share on other sites
CarlB

I played with it, all I came up with;

 

-Draw 3dpolyline as you described

-explode to 3dlines

-use fillet command to create 3darcs at angles

-draw circle for pipe section at end of each element, for use in extrusion

(create ucs with "za" "ob" options for drawing circles)

-extrude circle along each straight section and arc

-"union" command to join solid pieces

Share this post


Link to post
Share on other sites
Hugh_Compton

To make your 3D Poly line have curves simply click on the Polyline then, in properties (under fit/smooth), select cubic. If you need the pipe run to have "tighter"/smaller radii then select quadratic (but bear in mind that quadratic uses a LOT more memory so in large drawings it is best to be avoided.

 

If you have a choice between using sweep and extrude then I recommend going for the extrude option because the resulting pipe run will again be less memory intensive.

 

The problem with the 3D polyline method is that the radii aren't exact. If you needed the run to represent an ANSI steel run then your path wouldn't match your fittings (this might be acceptable for you). You will also run into problems if you wanted to do a BOM/parts list (much simpler when using singular pipe fittings).

 

If you truelly need to define pipe runs by their paths without having to manually insert the pipe fittings then you would need a program such as AutoCAD MEP.

 

If you would be happy with individual pipe fittings then try one of these:

 

3D AutoCAD Pipework – http://www.HerculeDesign.com

Pipework & Structural Steel http://www.3DCADMax.com

Share this post


Link to post
Share on other sites
ASMI

Some of 3D-pipes programs. xpipe - for solid pipes, xtube - for solid pipes with hole.

 

(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

Share this post


Link to post
Share on other sites
danieldalio

Many thanks !!!!

Sincerely.

Daniel

Share this post


Link to post
Share on other sites
ASMI

Excuse... XTUBE - this:

 

(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

Share this post


Link to post
Share on other sites
khama
Good night,

I am trying to draw some pipes in 3D.

What I want to is to create a path, let's say from 0,0,0 going 10 feet up, then 15 feet to the left, then 8 feet forward, then 3 feet down and so on.

I want smooth corners, not 90 degrees.

It is my understanding that I can't make a 3D polyline with arcs on it.

I'd like to make my piping by extruding a surface along a path.

Is it any way to make my piping other than creating segments and elbows and joining everything?

Thanks in advance.

 

Sure you can...

 

type: pline (enter)

a (enter) this will take you into the arc command for polylines

to go back to a straight line type: L

 

As far as making piping using the extrude command or sweep command. Make a chosen path, fillet the corners using this formula

1.525 x Diameter of the pipe. It is really quite simple. I am sure you will work it out. Aternatively, you can use ready made 3d blocks from programs like Inventor or Mech-Q. That is even easier again..

Share this post


Link to post
Share on other sites
AndrewCollins94

How do I keep this in AutoCAD XPIPE and XTUBE as they are ideal for my job?

Share this post


Link to post
Share on other sites
ReMark

How do you keep them? You download them to your computer and put them in a folder with your other custom lisp routines.

Share this post


Link to post
Share on other sites
tzframpton
How do I keep this in AutoCAD XPIPE and XTUBE as they are ideal for my job?
Have you given thought of an Autodesk Vertical Product, complete with a full catalog of pipes/fittings/etc?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×