Search the Community
Showing results for tags 'pip'.
-
Hello Autolisp world I m an engineer and dealing with hydraulics alot. I have a hydraulic calculation software that accepts numbers as nodes incrementally in an common text editor. Every node however is unique in space connecting 2 pipes (e.g. through an elbow) or 3 pipes (e.g tee). The numbers are arbitrary. For instance 1 2 4 12U 2 3 4 5N 3 4 4 5E 4 5 4 5S 5 2 4 5W The above creates a square of 5 ft side made of of 4" pipes feeded by a riser of 4" and 12 ft high. The first two numbers for every line represent the start and end node. The next the nominal diameter of pipe and the last the length along with the orientation of it. I have made so far an autolisp routine that writes in a txt file lines like the above per every line sketched in Autocad representing accurately the pipe network using a while loop and a counter. I retrieve the coordinates of start and end points (x,y,z) using handles 10 & 11 and I concatenate the numbers so that I can make them unique in space. When one pipe has coordinates in space starting point 50,35,12 & endpoint 70,35,12 the number for the start & end point formed is 503512 & 703512 respectively. So my program writes in a new line 503512 703512 4 20E This pipe has starting node 503512, end node 703512, 4" size and runs 20 ft to the east (taking as given that positive y is north). Repeatedly this is done for all lines in the pipe network. Here begins my problem. My hydraulic software does not accept node numbers greater than 99999. So this means that I need to translate all of my points in the format xxyyzz to something less than 99999. No matter what it is but it has to be between 1 to 99999. It also has to be unique because on that node other pipes may be connected. I haven't been able to to so. I need a function I guess that gives me these unique converted values or something like a renumbering routine but I couldn't figure it out. Maybe my whole approach is not correct. Any help will be deeply appreciated.