Presentation is loading. Please wait.

Presentation is loading. Please wait.

LESSON 6 AUTOLISP DRAWING (continued) In this lesson we will continue drawing the cylinder liner and end up with the drawing below.

Similar presentations


Presentation on theme: "LESSON 6 AUTOLISP DRAWING (continued) In this lesson we will continue drawing the cylinder liner and end up with the drawing below."— Presentation transcript:

1 LESSON 6 AUTOLISP DRAWING (continued) In this lesson we will continue drawing the cylinder liner and end up with the drawing below.

2 As you will recall the top profile had been drawn and we can name it The new code will continue in this space. We will first “HATCH” the top profile

3 The hatch command (command "hatch" "ANSI31" "20" "0" TopProfile "") has the following parameters hatch pattern type  (/////) The size of the hatch  (appropriate for this drawing) Angle of hatch  (default 45 degrees to the right) Selected object(s)  Return  (to stop selecting objects) Last minute note ! You should put a zoom command before the hatch process so that selection occurs. (command "_zoom" "Extents")

4 The liner side profile will be drawn by 2 rectangles (one in the other). Therefore the 2 corners of the outer rectangle are set to the variables and 2 corners of the inner rectangle are set to the variables and

5 Let us take a closer look at The “x” component is aligned with the end of the outer arc (p1) Therefore the “x” component is set to (car p1) The “y” component is lowered by a distance of (R1/2) from p1 Thefore the “y” component is set to (- (cadr p1) (/ R1 2)) Second component of p1 (R1/2)

6 Let us take a closer look at The “x” component is (2 x R2) to the right from Therefore the “x” component is set to (+ (car R1C1) (* R2 2)) The “y” component is lowered by a distance of H from R1C1 Thefore the “y” component is set to (- (cadr R1C1) H) Second component of R1C1

7 After and are defined the rectangle is drawn by (command "rectangle" R1C1 R1C2) After drawing the rectangle assign it to the variable by selecting the “last” entity and assigning it. (ssget “L”) (setq Rectangle1 (ssget "L"))

8 Do the same for and then “hatch the area between them by selecting the outer rectangle and then the inner rectangle (command "hatch" "ANSI31" "20" "0" Rectangle1 Rectangle2 "")

9 DIMENSIONING Only “LINEAR” dimensioning will be covered. The “DIM” command turn on the dimensioning mode. The “exit” command will end the dimensioning mode. There are various SYSTEM VARIABLES about dimensioning. These can be set during the dimensioning mode. For example the following can be set ; (command "dim") (command "dimasz" "5")  (sets the arrow head size) (command "dimtxt" "5")  (sets the text height) (command "dimdec" "1")  (sets the decimal digits) (command "dimexo" "5")  ( sets the extension line gap) (command "exit")

10 Add the general dimension variables in unit

11 d1d1 R1C1 R1C2 d2d2 d3d3 (command "dim" "aligned" d1 d2 "A" "90" d3 "" "exit") 1.Computes and writes the distance between d1&d2 2.d3 is the position of the dimension to the right of the points d1&d2 3."A" "90“ turns the dimension text by 90 deg.

12 d1d1 d2d2 d3d3 (command "dim" "aligned" d1 d2 d3 "" "exit") 1.Computes and writes the distance between d1&d2 2.d3 is the position of the dimension to the top of the points d1&d2

13 d1 d2 d3 (command "dim" "aligned" d1 d2 d3 "" "exit") 1.Computes and writes the distance between d1&d2 2.d3 is the position of the dimension to the bottom of the points d1&d2

14 This is what you should see when you press the button

15 Now I would like to talk about the technique I used. 1.Open Delphi and run ME426 and run AutoCad from within the program. 2.Go to......and open 3.Open in the directory 4.Write in.. the following directive c:\Progra~1\Autoca~1\ACAD.EXE /b c:\me426\project\sample 5.Write the code in and then save it 6.Close with 7.Press....OK 8.After finishing and testing the drawing (steps 5-6-7) the new lines from into your 9.Add to the beginning and to the end of these newly inserted lines.

16 WHAT IF YOUR DRAWING HAS AN ERROR ? 1.When AutoCad is open right click on the command line and click on 2.Press Right click in and click on 4.Examine the fault and switch to 5.Make changes in and go thru steps 5 – 6 – 7 on the previous page.


Download ppt "LESSON 6 AUTOLISP DRAWING (continued) In this lesson we will continue drawing the cylinder liner and end up with the drawing below."

Similar presentations


Ads by Google