Results 1 to 7 of 7

Thread: Auto label at end of drainage line

  1. #1
    Login to Give a bone
    0

    Default Auto label at end of drainage line

    Hi,
    I design plumbing services for various types of building projects using Autocad 2013 (2D only) and would like to know if anyone knows of a a way to:
    a) calculate the end elevation (invert level of pipe) of a line representing a sewer main as the line is drawn (with known % grade & invert level at start of line); and
    b) label the end of the line with the calculated elevation.
    I know that this routine may be available in Civil CAD or similar, but I use only 2D in my designs much like a PI & D drawing in plan view.
    At the moment if I have an extensive sewer network I measure distance between points, calculate the rise/fall, given a known grade required, and manually place text at start/ end points. This is very tedious and time consuming.
    I have very little lisp experience or I would try myself to write a routine, however this is out of my comfort zone and I don't even know if it can be done.
    I have attached a jpeg that shows what I am trying to acheive. The arrow indicates direction of flow for clarity, and the grade of pipe is 1.65%.
    Many thanks in advance for any assistance.

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Auto label at end of drainage line

    I'm sure we can help you out.

    Your attached image isn't showing up; could you also provide an example of the desired end-result?

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Login to Give a bone
    0

    Default Re: Auto label at end of drainage line

    Thank you for your interest BlackBox.
    Not sure what happened to the attachment - will try again as it shows clearly what I am trying to achieve. (The instructions for attachments in FAQ are a little confusing - To attach a file to your post, you need to be using the main 'New Post' or 'New Thread' page and not 'Quick Reply'. To use the main 'New Post' page, click the 'Post Reply' button in the relevant thread)- nothing about attaching a file to the "Reply to Thread" button? I am new at this, so patience please.Example2-Model.jpg

    If a routine is possible(or already out there somewhere), I am sure many people will benefit from sharing it, as it would be a real time saver.
    By the way, I should have said that still use ACAD R14 for a lot of my grunt work, as I find much less cumbersome to use for the simple drafting work I do. I have a very good plumbing add-on program called EzyDraft by US company Car Lee Software for R14 that I have customized over the years to suit my needs and to 'Australianize' it, as our terminology for plumbing fixtures and fittings are quite different from those that are used in the US. Of course it won't work with the latest Autocad releases and I am not sure if Car Lee are still around, so I think an update is I think out of question. I use Acad 2013 to prepare base building documentation and to finalize and fine tune drawings before issue.
    Any help greatly appreciated.

  4. #4
    Login to Give a bone
    0

    Default Re: Auto label at end of drainage line

    OOPS - I have attached the image but did not resize it.
    Hope this is OK

  5. #5
    Login to Give a bone
    0

    Default Re: Auto label at end of drainage line

    Hi all,
    Can anyone help with this?
    Maybe a program or add-on that will help?

  6. #6
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    385
    Login to Give a bone
    0

    Default Re: Auto label at end of drainage line

    Here is a rough start, I did not include a reset or repeat.
    You also need a block called "IE-ATTRIBUTE" containing an atttribute"

    Code:
    (defun c:foo (/ oil-ie sp1 sp2 local-dist local-fall ofall-per-foot bn bs att1)
      (setq bn "IE-ATTRIBUTE")
      (setq bs (getvar "Dimscale"))
      
      (if (not il-ie) (setq il-ie (getreal "\nspecify start invert elevation:" )))
      (setq oil-ie il-ie)
    
      (if (not fall-per-foot) (setq fall-per-foot 0.125))
      (setq ofall-per-foot fall-per-foot)
        
        
    
      (princ (strcat "\nfall per foot = " (rtos fall-per-foot 4 4) "\nstarting elevation = " (rtos (/ il-ie 12) 2 3)))
      (setq sp1 (getpoint "\nspecify start point: "))  
    
      (if (/= sp1 nil)
        (progn
          (setq sp2 (getpoint "\nspecify next point of pipe run: " sp1))
          (setq local-dist (distance sp1 sp2))
          (setq local-fall (* local-dist fall-per-foot))
          (setq il-ie (+ oil-ie local-fall))
          (princ (strcat "\nnew elevation is " (rtos (/ il-ie 12) 2 3)))      
          (setq att1 (rtos (/ il-ie 12) 2 3))
          (command "-insert" bn "S" bs "r" 0 "non" sp1)
          (command att1)
          (command "rotate" (entlast) "" "non" sp1 pause)
          ))
        
      (princ))

  7. #7
    Member
    Join Date
    2012-06
    Posts
    13
    Login to Give a bone
    0

    Default Re: Auto label at end of drainage line

    try this one:
    Code:
    ;اعداد وتصميم المهندس مطيع ملازي
    ;designed by eng:motee malazi syria
    (defun c:slpca (/ p1 pt11 txtstr1 dlv1 )
      (setq clyr(getvar"clayer"))
        (while
          (setq p1 (getpoint "\n click point(2d or 3d point)"))
      (setq osmd(getvar"osmode"))
      (setvar"osmode"0)
      (command "layer" "m" "centerline-lvl" "")
      (command "layer" "c" "2" "centerline-lvl" "")
      (command "color""bylayer")   
      (command "text" p1 "1" 50 (rtos(last p1) 2 2))
     
      (initget 1)
        (setq pt11 (entget (car (entsel "\nSelect point text level: "))))
        
        (setq txtstr1 (assoc 1 pt11))
      (setq dlv1 (atof(cdr txtstr1)))
        
       (princ dlv1);;;;;;;;;;;;;;
    (setq hx dlv1)
        (if(null hx)
        (setq hx dlv1))
      (setq hxnew(getreal(strcat"\n enter level or hit enter to accept reading level<"(rtos hx 2 3)">:")))
      (if hxnew(setq hx hxnew))
      (setvar"osmode"646)
      (setq p2(getpoint p1"\n click side point"))
      (setvar"osmode"0)
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (if(null slop%)(setq slop% -2.0))
      (setq slop%new (getreal (strcat"\n
     enter slop% or press enter to accept last slop%<"(rtos slop% 2 3)">:")))
      ;(if(null slop%new)(setq slop%new slop%))
      (if slop%new(setq slop% slop%new))
    
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ;(setq slop%(getreal"\n enter slop value %(+ -):"))
      (setq slop(/ slop% 100))
      (setq sloptxt(rtos slop 2 5))
      (setq lcros(sqrt(+(expt(-(car p2)(car p1))2)(expt(-(cadr p1)(cadr p2))2))))
      (setq lvlp2(+ hx(* slop lcros)))
      (command "layer" "m" "side-lvl" "")
      (command "layer" "c" "2" "side-lvl" "")
      (command "color""bylayer")   
      (command "text"(list(car p2)(cadr p2) lvlp2) 0.2 100 (rtos lvlp2 2 3))
      (command "layer" "m" "side-lvl-circle" "")
      (command "layer" "c" "2" "side-lvl-circle" "")
      (command "color""bylayer")
      (command"circle"(list(car p2)(cadr p2) lvlp2)0.05"")
    (setvar"clayer"clyr)
    (setvar"osmode"osmd);;;;;;;;;;   
      ))

Similar Threads

  1. Thin Line (TL) auto on at load?
    By still.james in forum Revit Architecture - General
    Replies: 1
    Last Post: 2010-06-08, 01:36 PM
  2. Auto align line to text
    By j-majm in forum AutoLISP
    Replies: 3
    Last Post: 2010-04-19, 08:21 AM
  3. Command line Auto-Hide
    By Steve_Bennett in forum ACA/AMEP Tips & Tricks
    Replies: 6
    Last Post: 2009-09-15, 07:07 PM
  4. Command Line Auto-Hide
    By Steve_Bennett in forum AMEP Wish List
    Replies: 1
    Last Post: 2005-06-04, 04:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •