Jump to content

3D pipes


danieldalio

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 4 years later...

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

Link to comment
Share on other sites

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