Author Topic: Rolling Offset  (Read 7998 times)

0 Members and 1 Guest are viewing this topic.

bayoubuoy

  • Guest
Rolling Offset
« on: February 18, 2011, 02:06:39 PM »
Greetings,
In the wonderful world of piping, a situation sometimes occurs making a rolling offset necessary.
I found this lisp by Abu Labib but am unable to get it to work.
Code: [Select]
(prompt "\nType  ROD to run the program:")
;ROD = Rolling Offset Dimension
;Created by : Abu Labib 23/06/09
(defun c:ROD () ; rolling offset dimension
(setq dimrun (entget(car(entsel "\n Choose Dimension-> Run:"))))
(setq dimrun1 (cdr (assoc 1 dimrun)))
(setq dimrun42 (cdr (assoc 42 dimrun)))
(if (= dimrun1 "")
(setq dimrun dimrun42)
(setq dimrun (atof dimrun1))
);if
(setq dimroll (entget(car(entsel "\n Choose Dimension-> Roll:"))))
(setq dimroll1 (cdr(assoc 1 dimroll)))
(setq dimroll42 (cdr(assoc 42 dimroll)))
(if (= dimroll1 "")
(setq dimroll dimroll42)
(setq dimroll (atof dimroll1))
);if
(setq dimc (sqrt (+ (expt dimrun 2) (expt dimroll 2))))

(setq dimrise (entget(car(entsel "\n Choose Dimension-> Rise:"))))
(setq dimrise1 (cdr (assoc 1 dimrise)))
(setq dimrise42 (cdr (assoc 42 dimrise)))
(if (= dimrise1 "")
(setq dimrise dimrise42)
(setq dimrise (atof dimrise1))
)

(setq travel (sqrt (+ (expt dimrise 2) (expt dimc 2))))

(setq pt1 (getpoint "\n Specify The First Point."))
(setq pt2 (getpoint pt1 "\n Specify The Second Point."))
(setq oldosn (getvar "osmode"))
(setvar "osmode" 0)
(command "_dimaligned" pt1 pt2 pause "")
(setq ed (entlast))
(command "_dimedit" "O" ed "" "-90" )
(setq edx (entlast))
(setq edim(entget edx))
(setq ed1 (assoc 1 edim))
(setq ed2 (cons 1 (rtos travel 2 1 )))
(setq edim (subst ed2 ed1 edim))
(entmod edim)
(entupd edx)
(setvar "osmode" oldosn)

(princ)
);defun
(princ)
A lisp to calculate rolling offsets would be very handy indeed for isometrics. And what would put the icing on the cake would be for the routine to calculate the offset angles.
A dialog for the input and results would really be first class.
I use vanilla 2005 and 2D only, by the way.

bayoubuoy
« Last Edit: February 18, 2011, 07:30:11 PM by bayoubuoy »

danallen

  • Guest
Re: Rolling Offset
« Reply #1 on: February 18, 2011, 04:50:49 PM »
for the ignorant architect, what is a rolling offset and how is it used?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Rolling Offset
« Reply #2 on: February 18, 2011, 05:26:17 PM »
Which angles are you looking for?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

bayoubuoy

  • Guest
Re: Rolling Offset
« Reply #3 on: February 18, 2011, 06:30:51 PM »
danallen,
I found a better image that may help explain. A rolling offset is a pipe running from an upper corner to a lower corner of an imaginary cube. It is generally used to avoid obstacles.

CAB,
This new image also shows the vertical and horizontal angles that are usually dimensioned on isometrics.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Rolling Offset
« Reply #4 on: February 18, 2011, 07:14:21 PM »
Sorry just got called to dinner. Not tested but should give you a start. :-)

Code: [Select]
(defun c:test ()
  (if
    (and
      (setq Run (getdist "\Enter or pick RUN."))
      (setq Rise (getdist "\Enter or pick RISE."))
      (setq Offset (getdist "\Enter or pick OFFSET."))
    )
     (setq hyp    (sqrt (+ (* Run Run) (* Offset Offset)))
           Travel (sqrt (+  (* Rise Rise) (* hyp hyp)))
           ang1   (atan (/ Rise hyp))
           ang2   (atan (/ hyp Rise))
     )
  )
  (princ travel)  (print)
  (princ ang1) (print)
  (princ ang2) (print)
)
« Last Edit: February 18, 2011, 08:26:56 PM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

bayoubuoy

  • Guest
Re: Rolling Offset
« Reply #5 on: February 18, 2011, 07:29:10 PM »
CAB, How was dinner?
I got an error:
; error: too many arguments

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Rolling Offset
« Reply #6 on: February 18, 2011, 08:23:38 PM »
Left overs but was fine.
I revised the Lisp, forgot to sum before square root.


I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Rolling Offset
« Reply #7 on: February 18, 2011, 08:41:08 PM »
BTW the angles are in radians.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Rolling Offset
« Reply #8 on: February 18, 2011, 11:04:43 PM »
This version will allow Offset of zero. No other error checking though.
Changed print for angles in degrees.
I have not tested the routine you posted but it works by selecting the dimensions to get the values needed and look like it is for 3d.
If I get some time tomorrow I will take a closer look.

Code: [Select]
(defun c:test ()
  (if
    (and
      (setq Run (getdist "\Enter or pick RUN."))
      (setq Rise (getdist "\Enter or pick RISE."))
      (setq Offset (getdist "\Enter or pick OFFSET."))
    )
     (if (zerop Offset)
       (setq Travel (sqrt (+ (* Rise Rise) (* Run Run)))
             ang1   (atan (/ Rise Run))
             ang2   (atan (/ Run Rise))
       )
       (setq hyp    (sqrt (+ (* Run Run) (* Offset Offset)))
             Travel (sqrt (+ (* Rise Rise) (* hyp hyp)))
             ang1   (atan (/ Rise hyp))
             ang2   (atan (/ hyp Rise))
       )
     )
  )
  (princ travel)
  (print)
  (princ (* 180.0 (/ ang1 pi)))
  (print)
  (princ (* 180.0 (/ ang2 pi)))
  (print)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Rolling Offset
« Reply #9 on: February 19, 2011, 02:32:50 AM »
for the ignorant architect, what is a rolling offset and how is it used?

Field explanation:(How a electrician explains it to a new guy.)
Pipe needs to offset up 4" and 2" to the left.

"Instead of offsetting your pipe 4" up, and another offset 2" to the left. Just make a 5" offset and roll the pipe over to left"

bayoubuoy

  • Guest
Re: Rolling Offset
« Reply #10 on: February 19, 2011, 08:27:48 AM »
for the ignorant architect, what is a rolling offset and how is it used?

Field explanation:(How a electrician explains it to a new guy.)
Pipe needs to offset up 4" and 2" to the left.

"Instead of offsetting your pipe 4" up, and another offset 2" to the left. Just make a 5" offset and roll the pipe over to left"
I've always been amazed at the way (some) electricians can bend conduit.
I've seen fitters/welders use a corner in the shop to get the cube and trial and error from that.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Rolling Offset
« Reply #11 on: February 19, 2011, 08:51:31 AM »
I just started learning about drawing in 3d so I made these for practice. 8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

bayoubuoy

  • Guest
Re: Rolling Offset
« Reply #12 on: February 19, 2011, 09:05:17 AM »
CAB,
I left out one of the important requirement of dimensioning isometric rolling offsets-the travel length.
It has been so long since I used a rolling offset that I was misled, and therefore misled you, with the images I posted. The need for the fitting angle is really important. Please look at the latest image and the attached pdf to see what my feeble mind is incapable of explaining.
For those that may not know,  pipe isometrics are used for both fabrication and installation and are not drawn to scale. There is two conditions that dictate the dimensions of the offset. The first is the use of 45 degree elbows (butt weld, socket weld, threaded, soldered, etc.) and the second is to bend the pipe or cut welded fitting to suit.

bayoubuoy

  • Guest
Re: Rolling Offset
« Reply #13 on: February 19, 2011, 09:10:50 AM »
I just started learning about drawing in 3d so I made these for practice. 8-)
Cool.
If I was 30 years younger with some gray matter left, I'd try 3D.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Rolling Offset
« Reply #14 on: February 19, 2011, 09:58:36 AM »
I'm pushing 63 so age is not a factor but the gray matter leak is. :cry:
Test this one.
Code: [Select]
(defun c:test ()
  (if
    (and
      (setq Run (getdist "\Enter or pick RUN."))
      (setq Rise (getdist "\Enter or pick RISE."))
      (setq Offset (getdist "\Enter or pick OFFSET."))
    )
     (if (zerop Offset)
       (setq Travel (sqrt (+ (* Rise Rise) (* Run Run)))
             ang1   (atan (/ Rise Run))
             ang2   (atan (/ Run Rise))
       )
       (setq hyp    (sqrt (+ (* Rise Rise) (* Offset Offset)))
             Travel (sqrt (+ (* Run Run) (* hyp hyp)))
             ang1   (atan (/ Rise hyp))
             ang2   (atan (/ hyp Rise))
       )
     )
  )
  (princ travel)
  (print)
  (princ (* 180.0 (/ ang1 pi)))
  (print)
  (princ (* 180.0 (/ ang2 pi)))
  (print)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

bayoubuoy

  • Guest
Re: Rolling Offset
« Reply #15 on: February 19, 2011, 01:49:16 PM »
I'm pushing 63 so age is not a factor but the gray matter leak is. :cry:
Thanks  CAB, I'll give it a test run.
I'm older than you are. I ain't gonna say by how much.

David Bethel

  • Swamp Rat
  • Posts: 656
Re: Rolling Offset
« Reply #16 on: February 20, 2011, 08:30:14 AM »
This is where a true 3D modeler put autocad to shame.  They can handle piping bends and offsets with ease.

If you can handle a Z axis delta and meshes in lieu of solids, then maybe this can help you.  ( back from my days of bending things )





http://www.davidbethel.com/swamp/tubeoffs.lsp

There is also a 3dpoly center line included for snaps

Good luck.  -David
« Last Edit: February 20, 2011, 03:39:10 PM by David Bethel »
R12 Dos - A2K

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Rolling Offset
« Reply #17 on: February 20, 2011, 02:07:53 PM »
David,
I guess your server is off line at this time?

I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

David Bethel

  • Swamp Rat
  • Posts: 656
Re: Rolling Offset
« Reply #18 on: February 20, 2011, 03:40:43 PM »
CAB,


Operator error on my part. it should work now.

I was looking for a FAQ on uploading things here ( to the lilly pond if I remember ) but couldn't find. it.  -David
R12 Dos - A2K

fixo

  • Guest
Re: Rolling Offset
« Reply #19 on: February 20, 2011, 03:41:18 PM »
David,
I guess your server is off line at this time?


Alan,
I've got it right now it's available
Try again

Oleg


IRONNIE

  • Guest
Re: Rolling Offset
« Reply #20 on: July 17, 2012, 09:29:10 AM »
Code: [Select]
(defun C:ROLL ()
  (setq RUN (UDIST NIL "\n   Run" RUN))
  (setq OFFSET (UDIST NIL "Offset" OFFSET))
  (setq RISE (UDIST NIL "  Rise" RISE))
  (setq `C` (sqrt (+ (expt RUN 2) (expt OFFSET 2))))
  (setq TRAVEL (sqrt (+ (expt RISE 2) (expt `C` 2))))
  (princ (strcat "Travel <" (rtos TRAVEL) ">\n\n"))
  (list RUN ROLL RISE TRAVEL)
)

(defun UDIST (SW MSG ANS / SW MSG ANS)
  (if (not ANS)
    (setq ANS 0)
  )
  (setq OANS ANS)
  (setq MSG (strcat MSG " <" (rtos ANS) ">: "))
  (if SW
    (setq ANS (getdist SW MSG))
    (setq ANS (getdist MSG))
  ) ;if
  (if (not ANS)
    (setq ANS OANS)
  )
  ANS
)
« Last Edit: July 17, 2012, 09:52:23 AM by CAB »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Rolling Offset
« Reply #21 on: July 17, 2012, 09:53:29 AM »
Welcome to the Swamp.
I added Code tags to your post.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.