|Page (1) of 1 - 09/27/01||email article||print page|
Vertical Offset - part 1
Sometimes in a vertical line there is a pipe that's not under an angle of 90 degrees. What we then have is called a vertical offset.
A vertical offset is drawn in an isometric piping drawing. Let's make an AutoLISP program that makes a drawing for a vertical offset.
The drawing for a vertical offset is in fact a triangle. The triangle has a vertical hatch in it.
In ACAD Newsletter Vol 1 No 5 was an article about programming. Let's follow the steps that were explained in that article.
The steps are:
2 drawing diagrams
3. writing code
First we'll do research. We can't draw diagrams in this newsletter. But we can give a description. The code will be given.
The testing and the corrections are a little bit different then usual. The program works. So no testing. But maybe you want to make some changes.
A vertical offset consists of three lines. The lines represent a pipe. The upper line and the lower line are vertical. The line in the middle is under an angle.
Starting from the upper line the line under an angle can go to the right. It can also go to the left. That decides how the offset drawing is made.
The offset drawing consists of two lines and a hatch. The first line is a vertical line coming from the upper line. The hatch is vertical.
The second line has an angle of 150 degrees or 210 degrees if the line in the middle goes to the right. If not an angle of 30 degrees or 330 degrees.
What angle is to be used depends on the position of valves in the vertical line or the position of connecting lines. There are rules for that.
We don't want to border with the rules. The program draws a vertical offset. After drawing it asks whether it's OK. If not the angle is changed.
To make it easy to change the angle that's used the offset is drawn with the GRDRAW function. The REDRAW function clears the screen.
At first a pipe in offset is selected. After the selection the offset drawing is made. Then is asked whether the drawing is OK.
If the offset drawing is OK then the drawing is made permanent. If it's not OK the angle is changed and a permanent drawing is made.
The offset drawing consists of two lines and a hatch. One line vertical. That one doesn't change. The other line has an angle.
At first the GRDRAW function is used. The used angle is 210 degrees for a line going to the right. If the line goes to the left the angle is 30 degrees.
The distance between the lines of the hatch is 5. A function is used to draw the vertical offset. The function can make temporarily and permanent drawings.
The second part will be printed next week.
Jos van Doorn is an AutoCAD specialist, AutoLISP programmer and ACAD newsletter publisher. His newsletter is for people who want to learn more about AutoCAD and AutoLISP. It's FREE. To subscribe: mailto:[email protected] He has written six AutoCAD books. Interested in the books? Let him know. Send an e-mail to: mailto:[email protected]
Source:Digital Media Online. All Rights Reserved