+ Reply to Thread
Page 2 of 5 FirstFirst 1 2 3 4 ... LastLast
Results 11 to 20 of 50

Thread: Lisp program

  1. #11
    Forum Deity
    Using
    not specified
    Join Date
    Jul 2004
    Location
    Anchorage, Alaska
    Posts
    2,074

    Default

    Registered forum members do not see this ad.

    He's setting up a list like this based on ASMI's good suggestion on how to retrieve the second number based on user's input of the first number. And yes I also took the 2 numbers as outside & inside diameters.

    is parList a variable? Can I change it to hDN?
    do I write:
    (setq hDN(getdist"\nHeader DN? "))
    (setq hDN '((80 . 99)(100 . 122)(125 . 140)(150 . 177)))
    ; example
    ; if hDN user input is 80 then hDN = 99
    Like this:

    Code:
    (setq DiamList '((80 . 99)(100 . 122)(125 . 140)(150 . 177)(200 . 232)
       (250 . 286)(300 . 345)(375 . 426)(450 . 507)(525 . 587)(600 . 667)(675 . 122)
       (750 . 826)(900 . 923)(1000 . 1025)(1200 . 1229)(1400 . 1433)(1600 . 1637)
       (1800 . 1841)(2000 . 2045)(2200 . 2249)(2400 . 2453)(3000 . 3065)))
    (setq hDN (getdist"\nHeader DN? "));;user enters inner diam
    (setq hDIA (cdr (assoc hDN DiamList));;returns outer diam from list

  2. #12
    Super Member ASMI's Avatar
    Using
    AutoCAD 2008
    Join Date
    Nov 2005
    Location
    Oceanus Procellarum, Moon
    Posts
    1,427

    Default

    Yes dotted pairs lists is standard way datas storage in LISP. I write short example. It shows what external diameter corresponds internal and prints the table of diameters. All data are stored in the dotted pairs list. Subsequently it is possible to replace it no more efficiency duties, for example draw tee or an insert of the block.

    Code:
    (defun c:test(/ parLst hDn dDn)
      (setq parLst '((80 . 99)(100 . 122)(125 . 140)(150 . 177)
       (200 . 232)(250 . 286)(300 . 345)(375 . 426)
       (450 . 507)(525 . 587)(600 . 667)(675 . 122)
       (750 . 826)(900 . 923)(1000 . 1025)(1200 . 1229)
       (1400 . 1433)(1600 . 1637)(1800 . 1841)(2000 . 2045)
       (2200 . 2249)(2400 . 2453)(3000 . 3065)))
      (initget 128)
        (setq hDn
        (getint "\nSpecify internal diameter or [Table]: "))
      (if hDn
        (progn
          (if(= 'INT(type hDn))
     (if(setq dDn(cdr(assoc hDn parLst)))
        (princ(strcat "\nExteral diameter = " (itoa dDn)))
        (princ "\n>>> Undefound internal diameter <<< ")
       ); end if
     ); end if
          (if(= 'STR(type hDn))
     (if(=(strcase hDn) "T")
       (progn
         (princ "\n*** PIPES DIAMETERS TABLE ***")
         (princ "\n-----------------------------")
         (princ "\n| Itnernal Dn | Exteranl Dn |")
         (princ "\n-----------------------------")
         (foreach itm parLst
           (princ(strcat "\n| " (itoa(car itm))))
           (repeat(- 12(strlen(itoa (car itm))))
      (princ " ")
      ); end repeat
           (princ(strcat "| " (itoa(cdr itm))))
           (repeat(- 11(strlen(itoa (cdr itm))))
      (princ " ")
      ); end repeat
         (princ " |")
           ); end foreach
         (princ "\n-----------------------------")
         (textscr)
         ); end progn
       (princ "\nInvalid keyword option! ")
       ); end if
     ); end if
          ); end progn
          (princ "\nEmpty input! ")
        ); end if
      (princ)
      ); end of c:test

  3. #13
    Senior Member
    Using
    AutoCAD 2007
    Join Date
    Feb 2007
    Location
    Brisbane Australia
    Posts
    436

    Default Thank you!!!!!

    Australian pipes are DN and we are metric as well

    one 4" pipe = DN 100 australian pipe



    100mm = 4"
    DN stands for dimension nominal
    100 is a nice round number, easy to covert to imperial and refures to the outside diameter or OD
    However, the OD is a nominal dimension. It's actual size is 122mm

    I haven't even gone into inside diameter. It's another confusing story
    The ODs of Ausralian steel and stainless steel are the same.
    The wall thickness is different and stated by shedual 10, 20, 40, 80, or 160
    The American way of calling up wall thickness is standard, xs (extra strong) or xx

    schedual 40 is sometimes the same and sometimes different to american pipe std

    Tube is pipe of a different class with different dimensions
    pvc pipe is different again with different wall thickness
    DICL (ductil iron cement lined) w different wt
    ABS (plastic) - and again w different wt
    Pe (plastic) - again w different wt
    GRP (glass reinforced plastic) - again w different wt

    This is why I would like a lisp program because this is so confusing


    One top of this, I have a limited knowlege of lisp.
    I need to write many programs. Most of then similar.
    My programes work, (or they did 12 years ago) are easy to follow, modify, cut copy paste but are probably not the best way to write and probably look like an embaressing mess to a good programmer, but at least I understand it.
    Hense my stubborness ( I need it like.....not like.....)

    I must draw:
    pipes
    tees both equal and reducing
    bends (elbows) 90, 45, 22.5, 11.2
    reducers both concentric and encentric
    flanges all sizes and in ANSI, DIN, JIS, table d, e, and j

    I'm extremly grateful for your help

  4. #14
    Senior Member
    Using
    AutoCAD 2007
    Join Date
    Feb 2007
    Location
    Brisbane Australia
    Posts
    436

    Default

    the program will draw both equal and reducing tees
    hDN is the OD of the main pipe (header)
    bDN is the OD of the branch pipe

  5. #15
    Super Member ASMI's Avatar
    Using
    AutoCAD 2008
    Join Date
    Nov 2005
    Location
    Oceanus Procellarum, Moon
    Posts
    1,427

    Default

    I think you can store more datas of your tees in list. For example store some datas of DN80 and DN100 tees (of corse I don'n know right datas):
    Code:
    Command: (setq parLst '((80 99 136 84 25 16)(100 122 184 97 32 18)))
    Then extract datas for DN100 tee:
    Code:
    Command: (setq a(cdr(assoc 100 parLst)))
    (122 184 97 32 18)
    Then you can extract separate datas for tee draw:
    Code:
    Command: (nth 0 a)
    122
    
    Command: (nth 1 a)
    184
    
    Command: (nth 2 a)
    97
    
    Command: (nth 3 a)
    32
    
    Command: (nth 4 a)
    18
    I don't use 'car' and 'cadr' functions becorse there is mach datas and 'nth' more convinient to control right number.

    I can write special functions (subfunctions) to draw fittings for each standard and transfer datas as uniform list. For example:

    Code:
     (defun Draw_ANSI_Equal_Tee(paramList / ....)
    and call it from main program.

  6. #16
    Banned Alan Cullen's Avatar
    Using
    Map 3D 2009
    Join Date
    Jun 2006
    Location
    Cairns, Queensland, Australia
    Posts
    4,181

    Default

    rookie37....

    I've been trying to come up with a lisp routine to do what you want for years (for pressure pipelines, reservoir valve boxes, etc).......time constraints and the fact that I would probably only need it once a year decided what I would do for me.....

    I just get the relevant catalogue and manually draw the pressure fittings.......much quicker for one off situations.

  7. #17
    Senior Member
    Using
    AutoCAD 2007
    Join Date
    Feb 2007
    Location
    Brisbane Australia
    Posts
    436

    Default

    I work in waste water recyling.
    I work with RLs and ILs
    I look up pipe sizes and wall thicknesses daily
    I have many different pipes such as
    steel, uPVC, DICL, GRP, etc.
    However, the confusing part comes in because each pipe has a different class and each customer specify differently

    I.E.
    customer A wants:
    any uPVC used that is below DN100 will be series 1
    any uPVC used that is DN100 and above will be series 2 (different size)

    any DICL used that is below DN150 will be PN 20
    any DICL used that is DN150 and above will be PN 35 (different size)

    customer B wants:
    any PE used will be SDR 13.6

    customer C wants:
    any PE used will be SDR 9 (different size)


  8. #18
    Banned Alan Cullen's Avatar
    Using
    Map 3D 2009
    Join Date
    Jun 2006
    Location
    Cairns, Queensland, Australia
    Posts
    4,181

    Default

    Best of luck, rookie37.....

    None of the pipe manufacturer's have anything useful (I know because I constantly phone them to see if they have developed anything). And I don't know of any lisp routine that has been written for your situation. It's going to be a big undertaking......

  9. #19
    Super Member ASMI's Avatar
    Using
    AutoCAD 2008
    Join Date
    Nov 2005
    Location
    Oceanus Procellarum, Moon
    Posts
    1,427

    Default

    >Alan Cullen
    None of the pipe manufacturer's have anything useful (I know because I constantly phone them to see if they have developed anything). And I don't know of any lisp routine that has been written for your situation. It's going to be a big undertaking......
    I completely agree.

    >rookie37

    But in other if you want will learn to program, it not the most bad exercise.

  10. #20
    Banned Alan Cullen's Avatar
    Using
    Map 3D 2009
    Join Date
    Jun 2006
    Location
    Cairns, Queensland, Australia
    Posts
    4,181

    Default

    Registered forum members do not see this ad.

    rookie37....

    I've been thinking about this overnight....I think you are trying to get too accurate, when that accuracy is simply not needed.

    The situation is you design a pipe network and give it to the contractor. The contractor uses your drawing to represent what you require to be constructed. You try for ultimate accuracy in the design office......unfortunately all your accuracy is shot at the first pipe junction the contractor makes. And if you specify a flange joint for a pipe straight, the contractor may opt to use a gibault joint instead (because he has a lot of ductile straight offcuts). So straight away the accuracy you are trying to maintain in the desing office is lost on the construction site. It's called construction tolerance.

    All you need to do is draw your pipe network using the nominal pipe diameters, and position your tees, bends etc using the nominal dimensions shown in the pipe catalogue. That way you will come up with a pit size (or whatever) based on the nomimal dimensions. Then add say 500mm extra all round to allow for minor errors and maintenance workers being able to access the pit....

    Specify your pipe type and class in general notes.....the contractor will know what he has to do and use.... e.g. .....
    100 %%C PVC-U WATER MAINS TO BE CLASS 16
    RRJ, SERIES 2 TO AS1477.
    50 %%C PIPES TO BE CLASS 12 POLYETHYLENE.
    25 %%C AND 32 %%C PIPES TO BE CLASS 12 POLYETHYLENE.

    ALL DUCTILE IRON FITTINGS SHALL BE RILSAN NYLON 11 COATED,
    OR OTHER APPROVED COATING. ALL NUTS, BOLTS AND WASHERS
    SHALL BE GRADE 316 STAINLESS STEEL.
    Also as you draw each fitting....add it to your block library, so you don't have to draw it again.

    What you produce doesn't have to be super accurate....all it has to do is convey to the contractor what you require.

Similar Threads

  1. Which program would be best?
    By ChadPoehland in forum Autodesk Software General
    Replies: 0
    Last Post: 15th Jan 2007, 06:56 pm
  2. Need LISP program to select all objects in layer
    By Vigilante in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 30th Nov 2006, 08:35 pm
  3. Making a lisp a permanent part of the program?
    By New2CADmike in forum AutoCAD Beginners' Area
    Replies: 6
    Last Post: 24th Sep 2006, 12:15 am
  4. a question about my lisp program for ploting parabola
    By winglj in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 24th Feb 2006, 03:23 am
  5. How do I run this .VLX program?
    By Cadastrophic in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 2nd Nov 2004, 06:54 am

Bookmarks

Posting Permissions

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