Jump to content

Plumbing Invert


Heredias2020

Recommended Posts

Can Anyone help me create a lisp routine that calculates the invert of a plumbing run by selecting a pline and inputting that distance information into a formula shown below? 

length in feet (selected Pline) X slope (.125) + 30" (footing) = total in feet / 12

maybe output the answer with a leader if posible

 

Thank you 

much appreciated

Link to comment
Share on other sites

Here is a very rough say 1st version. You need to makeup your mind how you want it labelled, same with slope is it drop per foot, slope or a %.

 

(setq slope (getreal "\nEnter slope"))
(setq obj (vlax-ename->vla-object (car (entsel "Pick object "))))
(setq Len (vlax-get Obj 'Length))
(setq drop (/ (+ (* len slope) 2.5) 12.0))

 

Link to comment
Share on other sites

Hello Bigal, its slope of 1/8 

most of my slopes are 1/8 (.125) id love to just select my pipe run and out-put a description with the invert calculation mentioned above 

i can see it on the 1st version, how do i make it to prompt for a selection of the pline?

thank you so much for the reply by the way i really appreciate it, this will make my production super fast 

Link to comment
Share on other sites

try this Note no error checking etc.

 

(defun c:lslope ( / slope obj len drop)
;(setq slope (getreal "\nEnter slope"))
(setq slope 0.125)
(setq obj (vlax-ename->vla-object (car (entsel "\nPick Pline "))))
(setq Len (vlax-get Obj 'Length))
(setq drop (/ (+ (* len slope) 2.5) 12.0))
(command "qleader" (getpoint "\nPick 1st leader point")(getpoint "\nPick end point") "" 0 (strcat (rtos drop 4 2) " Drop") "")
)
(c:lslope)

 

Link to comment
Share on other sites

On 27/02/2020 at 21:20, Heredias2020 said:

Can Anyone help me create a lisp routine that calculates the invert of a plumbing run by selecting a pline and inputting that distance information into a formula shown below? 

length in feet (selected Pline) X slope (.125) + 30" (footing) = total in feet / 12

maybe output the answer with a leader if posible

 

Thank you 

much appreciated

 

Are your drawing units in inches or feet? I ask as you specify length in feet and the footing in inches

Link to comment
Share on other sites

Awesome!!! Bigal you are a genious..

i did a couple of changes to make it work like i need it to but nothing major just moving things around 

this is how it changed 

 

(defun c:lslope ( / slope obj len drop)
;(setq slope (getreal "\nEnter slope"))
(setq slope 0.125)
(setq obj (vlax-ename->vla-object (car (entsel "\nPick Pline "))))
(setq Len (vlax-get Obj 'Length))
(setq drop (+ (/ (* len slope) 12.0) 30))
(command "qleader" (getpoint "\nPick 1st leader point")(getpoint "\nPick end point") "" 0 " X SANITARY SEWER INVERT @"(strcat (rtos drop 4) " BELOW FINISHED FLOOR 1/8 SLOPE DFUS") "")
)
(c:lslope)

 

my next step is to ask me for a dfu count and based on that it would automatically output a pipe size at the beginning of the text this would be an example

 

8" SANITARY SEWER INVERT

@ 6'-4" BELOW FINISHED FLOOR

1/8 SLOPE

1,292 DFUS

 

here are the dfu/pipe size ranges:

0-180 = 4"

181-700 = 6"

701-1,600 = 8"

 

can this be done?

thank you 

Link to comment
Share on other sites

Not sure what the plumbing terms are maybe this

 

(cond
((< len 180.0000001)(setq dia "4"))
((< len 700.0000001)(setq dia "6"))
((< len 1600.0000001)(setq dia "8"))
((> len 1600.0000001) ((alert "Length is greater than 1600\nwill now exit")(exit))
)

 

Link to comment
Share on other sites

Im super excited for this lisp and what it could become for me as a tool

this would be the ideal sequence, i am trying to play with it but i get lost some times being new to lisp routines. can this be done?

 

at the very beginning of the lisp it would ask the amount of dfu's (drain fixture units) it would then leave that number below the text out put (example below on red next to the dfus)

based on this amount it would then place a number where 8" is below. (example below on red next to the sanitary sewer invert)

the sizes are based on this ranges 

0-180 = 4"

181-700 = 6"

701-1,600 = 8"

 

8" SANITARY SEWER INVERT

@ 6'-4" BELOW FINISHED FLOOR

1/8 SLOPE

1,292 DFUS

Link to comment
Share on other sites

  • 2 months later...
(defun c:lslope ( / slope obj len drop)
;(setq slope (getreal "\nEnter slope"))
(setq slope 0.125)
(setq obj (vlax-ename->vla-object (car (entsel "\nPick Pline "))))
(setq Len (vlax-get Obj 'Length))
(setq drop (+ (/ (* len slope) 12.0) 30))
((< len 180.0000001)(setq dia "4"))
((< len 700.0000001)(setq dia "6"))
((< len 1600.0000001)(setq dia "8"))
((> len 1600.0000001) ((alert "Length is greater than 1600\nwill now exit")(exit))

(command "qleader" (getpoint "\nPick 1st leader point")(getpoint "\nPick end point") "" 0 " (strcat dia (chr 34) " SANITARY SEWER INVERT") @"(strcat (rtos drop 4) " BELOW FINISHED FLOOR 1/8 SLOPE DFUS") "")
)
(c:lslope)

im not sure what is wrong here i cant get it to work, please help

Link to comment
Share on other sites

41 minutes ago, Heredias2020 said:

(defun c:lslope ( / slope obj len drop)
;(setq slope (getreal "\nEnter slope"))
(setq slope 0.125)
(setq obj (vlax-ename->vla-object (car (entsel "\nPick Pline "))))
(setq Len (vlax-get Obj 'Length))
(setq drop (+ (/ (* len slope) 12.0) 30))

((< len 180.0000001)(setq dia "4"))
((< len 700.0000001)(setq dia "6"))
((< len 1600.0000001)(setq dia "8"))
((> len 1600.0000001) ((alert "Length is greater than 1600\nwill now exit")(exit))

(command "qleader" (getpoint "\nPick 1st leader point")(getpoint "\nPick end point") "" 0 " (strcat dia (chr 34) " SANITARY SEWER INVERT") @"(strcat (rtos drop 4) " BELOW FINISHED FLOOR 1/8 SLOPE DFUS") "")
)
(c:lslope)

im not sure what is wrong here i cant get it to work, please help

 

You messed up the leader text strcat. 

 

Try this

 

(command "qleader" (getpoint "\nPick 1st leader point")(getpoint "\nPick end point") "" 0 (strcat dia (chr 34) " SANITARY SEWER INVERT" "\\P" " @ " (rtos drop 4) " BELOW FINISHED FLOOR 1/8 SLOPE DFUS") "")

 

If you were trying to make a multiline MText, this will now work. If you only want one line remove the "\\P" between "SANITARY SEWER INVERT" and  " @ "

Edited by dlanorh
  • Thanks 1
Link to comment
Share on other sites

This is how im putting it together, however when i try to run it. it gives me a malformed list on input error

my goal with this is to;

1) Pick a Pline

2) prompt for a dfu value where i can manually input (based on the dfu list below) which would automatically place the pipe size at the beginning of the sentence 

my final product would look like this 

     8" SANITARY SEWER INVERT

     @ 6'-4" BELOW FINISHED FLOOR

     1/8 SLOPE

     1,292 DFUS

 

Please help..

this is what i have so far..

 

(defun c:lslope ( / slope obj len drop)
;(setq slope (getreal "\nEnter slope"))
(setq slope 0.125)
(setq obj (vlax-ename->vla-object (car (entsel "\nPick Pline "))))
(setq Len (vlax-get Obj 'Length))
(setq drop (+ (/ (* len slope) 12.0) 30))
(setq dfus)
(cond
((< dfus 180.0000001)(setq dia "4"))
((< dfus 700.0000001)(setq dia "6"))
((< dfus 1600.0000001)(setq dia "8"))
((> dfus 1600.0000001) ((alert "dfus is greater than 1600\nwill now exit")(exit))
)
(command "qleader" (getpoint "\nPick 1st leader point")(getpoint "\nPick end point") "" 0 (strcat dia (chr 34) " SANITARY SEWER INVERT" "\\P" " @ " (rtos drop 4) " BELOW FINISHED FLOOR 1/8 SLOPE DFUS") "")
)
(c:lslope)

Link to comment
Share on other sites

1 hour ago, Heredias2020 said:

This is how im putting it together, however when i try to run it. it gives me a malformed list on input error

my goal with this is to;

1) Pick a Pline

2) prompt for a dfu value where i can manually input (based on the dfu list below) which would automatically place the pipe size at the beginning of the sentence 

my final product would look like this 

     8" SANITARY SEWER INVERT

     @ 6'-4" BELOW FINISHED FLOOR

     1/8 SLOPE

     1,292 DFUS

 

Please help..

this is what i have so far..

 

(defun c:lslope ( / slope obj len drop)
;(setq slope (getreal "\nEnter slope"))
(setq slope 0.125)
(setq obj (vlax-ename->vla-object (car (entsel "\nPick Pline "))))
(setq Len (vlax-get Obj 'Length))
(setq drop (+ (/ (* len slope) 12.0) 30))
(setq dfus)
(cond
((< dfus 180.0000001)(setq dia "4"))
((< dfus 700.0000001)(setq dia "6"))
((< dfus 1600.0000001)(setq dia "8"))
((> dfus 1600.0000001) ((alert "dfus is greater than 1600\nwill now exit")(exit))
)
(command "qleader" (getpoint "\nPick 1st leader point")(getpoint "\nPick end point") "" 0 (strcat dia (chr 34) " SANITARY SEWER INVERT" "\\P" " @ " (rtos drop 4) " BELOW FINISHED FLOOR 1/8 SLOPE DFUS") "")
)
(c:lslope)

 

What should variable dfus be? It isn't being set to anything (setq dfus). If it is the length of the pline then use the top lisp below. If you want to set it use the bottom lisp.

 

(defun c:lslope ( / slope obj len drop)
  ;(setq slope (getreal "\nEnter slope"))
  (setq slope 0.125)
  (setq obj (vlax-ename->vla-object (car (entsel "\nPick Pline "))))
  (setq Len (vlax-get Obj 'Length))
  (setq drop (+ (/ (* len slope) 12.0) 30))
  (cond ( (<= len 180.0) (setq dia "4"))
        ( (<= len 700.0)(setq dia "6"))
        ( (<= len 1600.0)(setq dia "8"))
        ( (> len 1600.0) (alert "dfus is greater than 1600\nwill now exit") (vl-exit-with-error ""))
  )
  (command "qleader" 
    (getpoint "\nPick 1st leader point")
    (getpoint "\nPick end point") "" 0 
    (strcat dia (chr 34) " SANITARY SEWER INVERT" "\\P" " @ " (rtos drop 4) " BELOW FINISHED FLOOR 1/8 SLOPE " (rtos len 4) " DFUS")
    ""
  )
)

(defun c:lslope ( / slope obj len drop dfus dfust)
  ;(setq slope (getreal "\nEnter slope"))
  (setq slope 0.125)
  (setq obj (vlax-ename->vla-object (car (entsel "\nPick Pline "))))
  (setq Len (vlax-get Obj 'Length))
  (setq drop (+ (/ (* len slope) 12.0) 30))
  (setq dfus (getreal "\nEnter DFUS Value : "))
  (cond ( (<= dfus 180.0) (setq dia "4"))
        ( (<= dfus 700.0)(setq dia "6"))
        ( (<= dfus 1600.0)(setq dia "8"))
        ( (> dfus 1600.0) (alert "dfus is greater than 1600\nwill now exit") (vl-exit-with-error ""))
  )
  (if (zerop (rem dfus 1.0)) (setq dfust (itoa (fix dfus))) (setq dfust (rtos dfus 4)))
  (command "qleader" 
    (getpoint "\nPick 1st leader point")
    (getpoint "\nPick end point") "" 0 
    (strcat dia (chr 34) " SANITARY SEWER INVERT" "\\P" " @ " (rtos drop 4) " BELOW FINISHED FLOOR 1/8 SLOPE " dfust " DFUS")
    ""
  )
)

 

I am off to bed as I need plenty of beauty sleep. :sleeping:  Will try to answer any further questions in the morning.

 

 

Edited by dlanorh
  • Thanks 1
Link to comment
Share on other sites

14 hours ago, dlanorh said:

 

What should variable dfus be? It isn't being set to anything (setq dfus). If it is the length of the pline then use the top lisp below. If you want to set it use the bottom lisp.

 


(defun c:lslope ( / slope obj len drop)
  ;(setq slope (getreal "\nEnter slope"))
  (setq slope 0.125)
  (setq obj (vlax-ename->vla-object (car (entsel "\nPick Pline "))))
  (setq Len (vlax-get Obj 'Length))
  (setq drop (+ (/ (* len slope) 12.0) 30))
  (cond ( (<= len 180.0) (setq dia "4"))
        ( (<= len 700.0)(setq dia "6"))
        ( (<= len 1600.0)(setq dia "8"))
        ( (> len 1600.0) (alert "dfus is greater than 1600\nwill now exit") (vl-exit-with-error ""))
  )
  (command "qleader" 
    (getpoint "\nPick 1st leader point")
    (getpoint "\nPick end point") "" 0 
    (strcat dia (chr 34) " SANITARY SEWER INVERT" "\\P" " @ " (rtos drop 4) " BELOW FINISHED FLOOR 1/8 SLOPE " (rtos len 4) " DFUS")
    ""
  )
)

(defun c:lslope ( / slope obj len drop dfus dfust)
  ;(setq slope (getreal "\nEnter slope"))
  (setq slope 0.125)
  (setq obj (vlax-ename->vla-object (car (entsel "\nPick Pline "))))
  (setq Len (vlax-get Obj 'Length))
  (setq drop (+ (/ (* len slope) 12.0) 30))
  (setq dfus (getreal "\nEnter DFUS Value : "))
  (cond ( (<= dfus 180.0) (setq dia "4"))
        ( (<= dfus 700.0)(setq dia "6"))
        ( (<= dfus 1600.0)(setq dia "8"))
        ( (> dfus 1600.0) (alert "dfus is greater than 1600\nwill now exit") (vl-exit-with-error ""))
  )
  (if (zerop (rem dfus 1.0)) (setq dfust (itoa (fix dfus))) (setq dfust (rtos dfus 4)))
  (command "qleader" 
    (getpoint "\nPick 1st leader point")
    (getpoint "\nPick end point") "" 0 
    (strcat dia (chr 34) " SANITARY SEWER INVERT" "\\P" " @ " (rtos drop 4) " BELOW FINISHED FLOOR 1/8 SLOPE " dfust " DFUS")
    ""
  )
)

 

I am off to bed as I need plenty of beauty sleep. :sleeping:  Will try to answer any further questions in the morning.

 

 

Thank you dlanorh this worked great!!! 

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