• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

lisp for pipe construction

  • Thread starter Thread starter nakata2411
  • Start date Start date

nakata2411

Guest
Hello everyone,
work in the field of gas and oil, drawing every day longitudinal profiles with the course of the pipelines. then straight tubes, manually curved and curved from 30°,45° etc.
my question is this, you can create a lisp where you can insert the input type:
- tube length (e.g. 12mt) and diameter;
in the case of tube to be curved must be specified
- curved centre, angle of curvature and fitting radius (e.g. 12 mt long tube at 6mt angle 12° radius of connection 24.80 mt and a)

to facilitate speeding up work .
Thank you.
 
I didn't understand what you want your final result. Do you want the profile of the only tube? so that various length and diameter?
 
Exactly for now I would like to create the profile of the only tube. because I explain, I usually work in the field profile generated by other programs and imported in autocad.
Afterwards to create the profile of the conduct I put myself to draw manually under the profile of the ground, tube for tube, according to the lengths of the available pipes and the corners I need to ensure the cover from the country floor.

so the lisp would serve me to draw the single tube according to the features I told you above: tube length, curved centre, corner and fitting radius.
 
Last edited:
... the lisp would serve me to draw the single tube according to the characteristics I mentioned above: tube length, curved centre, corner and fitting radius. Hello nakata2411

in this period we are all at home to have some time to plan
I made a small lisp that tracks two lines as you indicated.
to try it type
(load "gas").
the program asks: ltotal, ltaglio, angle, fitting
and draw trait1 - fitting - stretch 2 in line format.
you can work on it to improve it.
Hi.
 

Attachments

Hello betoniera,
thank you so much I tested the lisp and it is a good start !!!:) great
I unfortunately understand very little about programming, and I kindly ask you if you can set the lisp in mt and not in mm and the angles expressed in degrees/min/sec.
then if you want we can feel so maybe I can explain what I have in my head!! :
Thank you.
 
Hello nakata2411
about your requests:
- m or mm is indifferent. Anyway I changed the word
- for the corner you have to be careful. in the programming are always using radiants therefore the input is in degrees then the program turns them into radiants for calculations (the user should not worry).
the input I predicted is in grades with decimal fraction. for example 15.5 degrees correspond to 15 degrees 30 first and 00 seconds.
it is possible to use the grade/min/sec format but it is very uncomfortable because you can no longer use the numbers (15.30 is not equal to 15.50).
special input is required. You can do it but I strongly disagree.

improvements:
as you said that we are on the right path I added the calculation of the straight traits and the curved tract and I wrote the relative lengths.
the text height is set to the row 5 ("textsize" 0.2) equal to 0.2 m.
in case you can change the number according to your preferences.
Bye.

to run the program (load "gas2").
 

Attachments

Hello nakata2411
it is preferable to continue to make the job public because it can affect others and why the most experts can give suggestions
I send you the gas3.lsp program
the following changes have been made:
- the central line has been transformed into polylinea
- the thickness of the pipes in mm has been added
- the thickness of the tube has been drawn by offset above and below the central line of half tube.
Bye.
 

Attachments

Okay, the lisp stops me after joining everything in polylinea. I can't create the offset
 
I checked the program, it works on my computer.
You probably have some osnap on.
I entered the program the deactivation of the osnap gas4.lsp
We need to do some tests.
first put large diameters with close zoom.
then try to put small diameters.
to better understand the problem,
Hi.
 

Attachments

Hello nakata2411

I found another simpler solution to draw the tube.
I implemented it in the gas5.lsp file
the tube is drawn with red line (command "_color" 1).
other colors are 3,4,5,6,7 (just change the last line terz number).
there is no more the offset command that gave problems, but you also enlarge the screen.
It should work, but let us know.
Bye.
 

Attachments

Good morning.
I tested the lisp, there's a problem as you can see from the photo.
if in the corner command I write a positive angle it goes ok, if instead you want to go down and insert a negative angle the axis line works correctly instead the thickness of the tube creates a strange fitting, as you can see.
then I noticed that, if I change ucs the lisp only generates the axis line without thickness.
Thank you.
 

Attachments

  • Cattura.webp
    Cattura.webp
    11.2 KB · Views: 33
Hello nakata2411
the problem of the negative angle comes from the conversion that makes autocad from degrees and radiants.
I fixed it by differentiating the points of the polylinea tube depending on the sign of the angle.
the problem of theucs comes from the fact that the design is based on the point of insertion that is in relative and not absolute coordinates.
you can convert the coordinates from program. I'll do it later.
for now do the tests with negative and positive corners so that any other problems emerge.
Easy, easy, we'll get to the destination. we are of those who do not give up.
Bye.
 

Attachments

I tried to change the ucts and test the program both with positive and negative angles.
It does not give me any problem even without intervening on the coordinates.
therefore the problem of the ucts was connected to that of the negative angle that was solved.
Hi.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top