Presentation is loading. Please wait.

Presentation is loading. Please wait.

DRAWING THE PIN ME 426 INTERNAL COMBUSTION ENGINE DESIGN.

Similar presentations


Presentation on theme: "DRAWING THE PIN ME 426 INTERNAL COMBUSTION ENGINE DESIGN."— Presentation transcript:

1 DRAWING THE PIN ME 426 INTERNAL COMBUSTION ENGINE DESIGN

2 INITIAL STEPS OPEN THE LISP FILE OPEN THE LISP FILE CALL THE PROCEDURE FOR INITIALIZATION OF AUTOCAD CALL THE PROCEDURE FOR INITIALIZATION OF AUTOCAD MODIFY IF NECESSARY ANY SYSTEM VARIABLES MODIFY IF NECESSARY ANY SYSTEM VARIABLES

3 begin SN := NTurns; s :=DrawingPath+LispFile;{LISP file with full path;} AssignFile(F,s); ReWrite(F); { START DRAWING } WriteInitialLines(F); Writeln(F,'(command "dim")'); Writeln(F,'(command "dimasz" "2")'); Writeln(F,'(command "dimtxt" "2")'); Writeln(F,'(command "dimexo" "2")'); Writeln(F,'(command "exit")'); OPEN THE LISPFILE (NAME IS ASSIGNED IN UNIT “MAIN” ) INITIALIZATION OF AUTOCAD MODIFY THE SIZE OF THE ARROWHEADS, TEXT AND EXTENSION LINES

4 SET THE DIMENSIONS SKETCH THE DRAWING ON PAPER (PREFERABLY GRIDED) SKETCH THE DRAWING ON PAPER (PREFERABLY GRIDED) SELECT AND PLACE THE NECESSARY DIMENSIONS SELECT AND PLACE THE NECESSARY DIMENSIONS CHECK IF THESE DIMENSONS ARE PROVIDED BY THE PROGRAM (PERHAPS FROM PREVIOUS UNITS) CHECK IF THESE DIMENSONS ARE PROVIDED BY THE PROGRAM (PERHAPS FROM PREVIOUS UNITS) CARRY THE DIMENSIONS INTO THE AUTOLISP PROGRAM CARRY THE DIMENSIONS INTO THE AUTOLISP PROGRAM

5

6 Writeln(F,';PISTON PIN DIMENSIONS'); Writeln(F,';Piston Pin Outer Diameter'); str(dexValue*1000:5:1,OuterDiameter); Writeln(F,'(setq OD '+OuterDiameter+')'); Writeln(F,';Piston Pin Inner Diameter'); str(dintValue*1000:5:1,InnerDiameter); Writeln(F,'(setq ID '+InnerDiameter+')'); Writeln(F,';Piston Pin Length'); str(lpp_pin*1000:5:1,PinLength); Writeln(F,'(setq LP '+PinLength+')'); dexValue variable is calculated in unit “Piston” therefore unit “Pin” uses “Piston” OuterDiameter is a local string variable OD is an AutoLisp variable (you don’t declare it) AUTOLISP VARIABLES OD, ID and LP ARE DECLARED AND SET

7 GETTING READY DECLARE AND SET THE VALUES OF ANY OTHER DIMENSIONS (IF NECESSARY) DECLARE AND SET THE VALUES OF ANY OTHER DIMENSIONS (IF NECESSARY) PICK THE ORIGIN PICK THE ORIGIN DRAW THE CENTERLINES DRAW THE CENTERLINES

8 Writeln(F,'(setq p0 cen)'); Writeln(F,'(setq R1 (/ OD 2))'); Writeln(F,'(setq R2 (/ ID 2))'); writeln(F,';DRAW THE CENTERLINES'); writeln(F,'(command "Layer" "Set" "0_centerline" "")'); writeln(F,'(setq cenx1 (list (- (car cen) (* R1 1.5)) 0 0))'); writeln(F,'(setq cenx2 (list (+ (car cen) (* R1 1.5)) 0 0))'); writeln(F,'(command "line" cenx1 cenx2 "")'); writeln(F,'(setq ceny1 (list 0 (+ (cadr cen) (* R1 1.5)) 0))'); writeln(F,'(setq ceny2 (list 0 (- (cadr cen) (* R1 1.5)) 0))'); writeln(F,'(command "line" ceny1 ceny2 "")'); “cen” HAS BEEN DECLARED DURING THE INITIALIZATION “R1” AND “R2” ARE THE OUTER AND INNER RADII OF THE PIN

9 DRAW THE PIN SECTIONS AND EXTRUDE THEM YOU MAY DRAW 2 CONCENTRIC CIRCLES AND THE EXTRUDE THEM YOU MAY DRAW 2 CONCENTRIC CIRCLES AND THE EXTRUDE THEM OR YOU MAY DRAW THE SIDE PROFILE OF THE PIN AND THEN REVOLVE THE PROFILE ABOUT THE HORIZONTAL AXIS OR YOU MAY DRAW THE SIDE PROFILE OF THE PIN AND THEN REVOLVE THE PROFILE ABOUT THE HORIZONTAL AXIS

10 Writeln(F,'(command "Layer" "Thaw" "Layer1" "")'); Writeln(F,'(command "Layer" "Set" "Layer1" "")'); Writeln(F,';Draw two concentric circles'); Writeln(F,'(command "circle" p0 R1)'); Writeln(F,'(command "zoom" "Extent")'); Writeln(F,'(command "_extrude" (ssget "L") "" LP "")'); Writeln(F,'(setq cyl1 (ssget "L"))'); Writeln(F,'(command "circle" p0 R2)'); Writeln(F,'(command "_extrude" (ssget "L") "" LP "")'); Writeln(F,'(setq cyl2 (ssget "L"))'); Writeln(F,'(command "zoom" "Extent")'); MAKE THE LAYER VISIBLE AND SET THE LAYER DECLARE AND SET THE OUTER CYLINDER AS “cyl1” AND THE INNER CYLINDER AS “cyl2”

11 THE CIRCLES ARE EXTRUDED IN THE Z DIRECTION

12 ADJUST THE VIEW SUBTARCT THE INNER CYLINDER FROM THE OUTER CYCLINDER SUBTARCT THE INNER CYLINDER FROM THE OUTER CYCLINDER ROTATE THE HOLLOW CYLINDER SO THAT A SIDE VIEW IS OBTAINED ROTATE THE HOLLOW CYLINDER SO THAT A SIDE VIEW IS OBTAINED

13 Writeln(F,'(command "_subtract" cyl1 "" cyl2 "")'); Writeln(F,'(command "zoom" "Extent")'); Writeln(F,'(setq pin (ssget "L"))'); Writeln(F,'(command "ucs" "origin" pcross)'); Writeln(F,'(setq pcross (list 0 0 0))'); Writeln(F,'(command "ucs" "X" 90)'); Writeln(F,'(command "_rotate" pin "" pcross -90)'); Writeln(F,'(command "zoom" "Extent")'); SUBTRACT THE CYLINDERS DECLARE THE HOLLOW CYLINDER AS “pin” AND THE ROTATE “pin” 90 DEGRESS ABOUT THE POINT “pcross” SET THE ORIGIN TO POINT “pcross” AND THEN RESET THE VALUE TO ZERO

14 THEPOINT “pcross” IS AT THE ORIGIN

15 CHAMFER THE ENDS SET POINT X1Y1 TO THE LEFT AND ABOVE OF THE ORIGIN SET POINT X1Y1 TO THE LEFT AND ABOVE OF THE ORIGIN SET A POINT X2Y2 TO THE RIGHT AND BELOW OF THE ORIGIN SET A POINT X2Y2 TO THE RIGHT AND BELOW OF THE ORIGIN THE RECTANGLE BETWEEN THESE POINTS SHOULD CROSS THE LEFT EDGE OF THE PIN THE RECTANGLE BETWEEN THESE POINTS SHOULD CROSS THE LEFT EDGE OF THE PIN DO THE SAME FOR THE RIGHT EDGE DO THE SAME FOR THE RIGHT EDGE CHAMFER SELECTS wrt WINDOWS 1&2 CHAMFER SELECTS wrt WINDOWS 1&2

16 Writeln(F,';Chamfer the edges of the pin'); Writeln(F,'(setq x1y1 (list (- (car pcross) 1) (+ (cadr pcross) 1)))'); Writeln(F,'(setq x2y2 (list (+ (car pcross) 1) (- (cadr pcross) 1)))'); Writeln(F,'(command "chamfer" (ssget "C" x1y1 x2y2) "" 2 1 (ssget "C" x1y1 x2y2) "")'); Writeln(F,'(setq x3y3 (list (+ (car x1y1) LP) (cadr x1y1)))'); Writeln(F,'(setq x4y4 (list (+ (car x2y2) LP) (cadr x2y2)))'); Writeln(F,'(command "chamfer" (ssget "C" x3y3 x4y4) "" 2 1 (ssget "C" x3y3 x4y4) "")'); 2 & 1 ARE THE LENGTHS OF THE CHAMFER

17

18 SHOW SECTION OF PIN ROTATE THE UCS TO ITS ORIGINAL POSITION ROTATE THE UCS TO ITS ORIGINAL POSITION NOW THE XY PLANE GOES THROUGH THE MIDDLE OF THE PIN NOW THE XY PLANE GOES THROUGH THE MIDDLE OF THE PIN MAKE A SECTION wrt XY PLANE AND “pcross” MAKE A SECTION wrt XY PLANE AND “pcross” DECLARE THE NEW OBJECT AS “pinXY” DECLARE THE NEW OBJECT AS “pinXY” HATCH “pinXY” AND DECLARE THE HATCHED OBJECT AS “pinXYH” HATCH “pinXY” AND DECLARE THE HATCHED OBJECT AS “pinXYH”

19

20 PUT THE DIMENSIONS SET THE END POINTS SET THE END POINTS SET THE EXTENSION DISTANCE OF THE DIMENSION LABEL SET THE EXTENSION DISTANCE OF THE DIMENSION LABEL ROTATE DIMENSION LABEL AS REQUIRED ROTATE DIMENSION LABEL AS REQUIRED

21 Writeln(F,'(setq d1 (list (car pcross) (+ (cadr pcross) R1)))'); Writeln(F,'(setq d2 (list (car pcross) (- (cadr pcross) R1)))'); Writeln(F,'(setq d3 (list (- (car d1) 10) (cadr d1)))'); Writeln(F,'(command "dim" "aligned" d1 d2 "A" "" d3 "" "exit")'); Writeln(F,'(setq d1 (list (+ (car pcross) LP) (+ (cadr pcross) R2)))'); Writeln(F,'(setq d2 (list (+ (car pcross) LP) (- (cadr pcross) R2)))'); Writeln(F,'(setq d3 (list (+ (car d1) 10) (cadr d1)))'); Writeln(F,'(command "dim" "aligned" d1 d2 "A" "" d3 "" "exit")'); Writeln(F,'(setq d1 (list (car pcross) (+ (cadr pcross) R1)))'); Writeln(F,'(setq d2 (list (+ (car pcross) LP) (+ (cadr pcross) R1)))'); Writeln(F,'(setq d3 (list (car d1) (+ (cadr d1) 10)))'); Writeln(F,'(command "dim" "aligned" d1 d2 "A" "" d3 "" "exit")'); Writeln(F,'(command "zoom" "Extent")');

22

23 FILE THE OUTPUT SET THE NAMES OF THE FILES SET THE NAMES OF THE FILES OUTPUT THE RESULTS OUTPUT THE RESULTS ROTATE THE MODEL ROTATE THE MODEL OUTPUT THE RESULT OUTPUT THE RESULT ROTATE THE MODEL “NTURN” TIMES AND OUTPUT EACH ROTATION ROTATE THE MODEL “NTURN” TIMES AND OUTPUT EACH ROTATION

24 wmfpath := acadpath + 'sample.wmf'; Normalbmp := acadpath + 'sampleN.bmp'; Plainbmp := acadpath + 'sampleP.bmp'; Isobmp := acadpath + 'sampleI.bmp'; PinPr := acadpath + 'property.mpr'; s1 := '"' + acadpath + 'sample"'; s2 := '".bmp"'; Writeln(F,'(setq prot (list (+ (car pcross) (/ LP 2)) (cadr pcross) (caddr pcross)))'); Writeln(F,'(setq w1 '+s1+')'); Writeln(F,'(setq w3 '+s2+')'); Writeln(F,'(command "wmfout" "'+wmfpath+'" (ssget "X") "")'); Writeln(F,'(command "bmpout" "'+Normalbmp+'" (ssget "X") "")'); Writeln(F,'(c:render "'+Plainbmp+'")');

25 Writeln(F,'(command "ucs" "X" 45)'); Writeln(F,'(command "_rotate" (ssget "X") "" prot 45)'); Writeln(F,'(command "zoom" "Extent")'); Writeln(F,'(c:render "'+Isobmp+'")'); Writeln(F,'(command "_rotate" (ssget "X") "" prot -45)'); Writeln(F,'(command "zoom" "Extent")'); Writeln(F,'(command "ucs" "X" -45)'); Writeln(F,'(setq count 0)'); Writeln(F,'(command "limits" "off")'); FIRST ROTATE THE CS AROUND X BY 45 DEGREES AND THEN ROTATE THE OBJECT 45 DEGREES AROUND POINT ”prot” AND THEN RENDER THE 3D OBJECT AND STORE IT TO THE FILE DESIGNATED BY “Isobmp”

26 str(SN:2,Turn); Writeln(F,'(setq Rot '+Turn+')'); Writeln(F,'(repeat Rot'); Writeln(F,'(command "ucs" "X" 5)'); Writeln(F,'(setq count (+ count 1))'); Writeln(F,'(setq w2 (rtos count 2 0))'); Writeln(F,'(setq fname (strcat w1 w2 w3))'); Writeln(F,'(c:render fname)'); Writeln(F,'(command "_rotate" (ssget "X") "" prot 5)'); Writeln(F,'(command "zoom" "Extent"))'); SN IS CARRIED INTO THE PROGRAM AS “Rot” (number of turns) (repeat Rot (...”Extetnt”)) LOOP IS REPEATED Rot TIMES

27 Writeln(F,'(repeat Rot'); Writeln(F,'(command "ucs" "Y" 5)'); Writeln(F,'(setq count (+ count 1))'); Writeln(F,'(setq w2 (rtos count 2 0))'); Writeln(F,'(setq fname (strcat w1 w2 w3))'); Writeln(F,'(c:render fname)'); Writeln(F,'(command "_rotate" (ssget "X") "" prot 5)'); Writeln(F,'(command "zoom" "Extent"))'); Writeln(F,'(command "_massprop" pin "" "Y" '+PinPr+'")'); AT THE END THE MASS PROPERTIES OF “pin” IS WRITTEN TO THE FILE DESIGNATED BY “PinPr”


Download ppt "DRAWING THE PIN ME 426 INTERNAL COMBUSTION ENGINE DESIGN."

Similar presentations


Ads by Google