Mega Project Report
Mega Project Report
A
Project Report on
“Design of machine element by using Autolisp programming in AutoCAD.”
Submitted in Partial Fulfillment of the requirements for the
“DIPLOMA”
in
Mechanical Engineering.
to
M.S.B.T.E. MUMBAI.
By
Name of candidates Roll No.
[Link]
Lecturer in Mechanical Engineering.
C
CEER
RTTIIFFIIC
CAAT
TEE
have successfully completed the Project work entitled “Design of machine element by using
Autolisp programming in AutoCAD ” under my supervision, in the partial fulfilment of the
requirements for the Diploma in Mechanical Engineering, and the report submitted to
M.S.B.T.E. MUMBAI. For academic year 2018-2019.
Date :-
Place: [Link]. Yadrav.
DECLARATION
Respected sir,
I/We undersigned hereby declare that the project entitled “Design of machine element
by using Autolisp programming in AutoCAD” under the guidance and supervision of
[Link].
The project is based on the information collected by us. If my project work is found to be
copied, then I am liable to be punished by rule of M.S.B.T.E,MUMBAI.
Date:
Place:Yadrav.
Name of the Candidate Roll No Sign
ACKNOWLEDGMENT
It is my great pleasure to present the honour and sincere gratitude to my guide [Link],
Lecturer, Dept. of Mechanical Engg. Sharad Institute of Technology,Polytechnic,Yadrav helped
in joining the hands in developing each and every steps of this project and for valuable guidance
and constant encouragement during completion of project work. It was my privilege and pleasure
to work under his valuable guidance. I am indeed gratefully to him for providing me helpful
suggestions. Due to his constant encouragement and inspiration I could complete my project
work.
I am very thankful to Principal, Sharad Institute of Technology, Polytechnic,Yadrav.
My grateful thanks to Mr. S.S MALI. Head of mechanical Department, for their valuable
guidance, support and constant encouragement.
I express thanks to my family and friends for their support and encouragement at every
stage of successful completion of this project work.
My sincere thank to all those who have directly or indirectly helped me to carry out this
work.
Index
Title Page No
Sr. No.
Abstract 8
1
Introduction 9
2
Literature Survey 10
3
Methodology 11
4
4.1 Key 11
4.2 Flange Coupling 12
Component Design 13
5
5.1 Flange Coupling 13
5.1.1 Design of Shaft 13
5.1.2 Design of Hub 13
5.1.3 Design of Key 14
5.1.4 Design of Flange 14
5.1.5 Design of Bolts 14
5.2 Design of Sunk Key 15
Generation of Program 16
6
6.1 Program of Flange coupling 16-21
6.2 Program of Key 22-23
Program Description 24
7
7.1 Functions 24
7.1.1 Defun 24
7.1.2 Setq 25
7.1.3 Polar 25
7.1.4 Command 25
7.2 Exponentiation 25
7.2.1 Expt 25
7.3 Expressions 25
7.3.1 Getreal 25
7.4 Commands 25
7.4.1 Pline 26
7.4.2 Line 26
7.4.3 Circle 26
7.4.4 Hatch 26
7.4.5 Solid 26
7.4.6 Polygon 26
7.4.7 Zoom 26
Software Running 27
8
8.1 Working Flow 27
8.2 Program creation method 27
8.3 Steps to load program 28
8.3.1 Method1:Using AppLoad 28
8.3.2 Method2:Using [Link] 29
8.3.3 Method3:Using VLIDE 29
8.4 Running of program 30
Results 31-36
9
Conclusion 37
10
Future Scope 38
11
References 39
12
Photographs 40
13
List of Figures
1. Abstract
AutoLISP is a dialect of the LISP programming language built specially to use with
AutoCAD and its derivatives. It is a subset of the LISP (List Processor) programming
language, which is used in bids of artificial intelligence and expert systems. Many
functions have been added to the LISP program in order to interface AutoLISP directly to
AutoCAD, and you will see that same AutoCAD commands have been retained as
AutoLISP functions .Flange coupling is a simple type of coupling than others .Here it
consist of two flanges one keyed to driving shaft and other two the driven shaft. Two
flanges are connected with the help of four or six bolts arranged with in a concentric
circle. In this thesis a flange coupling model is designed with simple programming
language. Initially transmitting power depending on the application is taken as the input
for the generating various dimensions of the coupling.
2. Introduction
In this project the calculations is done by program from giving input values from user.
The dimensions of components are generated by programming in AutoLISP. The design
of machine component is done through program i.e. after giving input values from user
the calculations is done & according to calculating values the output dimensions are
generated & this dimensions used for creating component in AutoCAD by giving values
of co-ordinates of component. The language is simple for producing drawing & also for
mathematical calculations & analytical calculations.
3. Literature Survey
CAD software is used to increase designer productivity, improve design quality and
communications through documentation, and create databases for manufacturing. As the
CAD modelling techniques become more and more advanced, it is necessary to complete
product modelling and design changes faster than ever. [1]
AutoLISP is the original and most popular programming language for AutoCAD .The
reason for its polarity is that it is a neutral extension of the program No additional
software need to be run and AutoLISP can run commands that Autodesk and other
developers offers in the command window.[2]
The lisp code can be entered directly into command window or loaded using ‘lsp.’ Or
‘scr’ files. Once a LISP program has been loaded the built-in function can be executed
from the command window .These function can be executed similarly to CAD
commands, but it is the programmer who decides which messages to display .It is
possible to use LISP code with a command macro that is activated from the CAD user
interface or tool on palette.
Visual languages can be very useful for helping architecture student understood general
programming concepts, but scripting language is fundamental for implementing
generative design system. [4]
4. Methodology
4.1 Flange Coupling :-
START
INPUTS:
OUTPUTS:
COMMANDS USED:
Check for
Design Safety
STOP
4.2 Key :-
START
INPUTS:
1. SHAFT DIAMETER
2. CRUSHING STRESS
3. SHEAR STRESS
OUTPUTS:
1. WIDTH
2. THICKNESS
3. LENGTH
COMMANDS USED:
1. LINE
2. POLYGON
3. RECTANGLE
Check for
Design Safety
STOP
5. Component Design
5.1 Design of Flange Coupling
Let
d = Diameter of shaft
n = No. of bolts
tf = Thickness of flange
↊s,↊b&↊k = Permissible shear stress for shaft, bolt & key material
σcb & σck = Permissible crushing stress for bolt & key material
T= 16 x ↊s x
The hub is designed by considering it as a hollow shaft transmitting the same torque as
that of solid shaft. We have
Where,
k=
The is designed with usual proportions as follows & then checked for shearing and
crushing stress.
The flange at junction of the hub is under shear while transmitting torque hence torque
transmitted by flange is given as
Where,
tf = d/2
The bolts are subjected to shear stress due to torque transmitted the no. of bolts depends
upon the diameter of shaft and Pitch circle diameter of bolts.
We know
A = ↊b x π/4 x
F = n x ↊b x π/4 x
T = n x ↊b x π/4 x x D1/2
Where,
D1 = 3d
D2 = 4d
The key is designed with usual proportions as follows & then checked for shearing and
crushing stress.
6. Generation of Program
(defun c:flange()
N/mm2:")
(command "pline" pt1 pt2 pt3 pt4 pt5 pt6 pt23 pt24 pt25 pt26 pt27 pt28 "c")
(command "pline" pt9 pt10 pt11 pt61 pt62 pt18 pt19 pt20"c")
(command "pline" pt67 pt12 pt13 pt14 ptl5 pt16 pt17 pt70 "c")
(command "regen")
;d=diameter of shaft
;l=lenth of key
;w=width of key
;th=thickness of key
(defun c:cskey()
(setq
w(/ d 4)
th(/ d 6)
pt2(polar pt1 0 w)
pt4(polar pt3 pi w)
(princ)
7. Program Description
7.1 Functions:-
7.1.1 Defun
The name of a program, or function, must be defined in the first statement, which
is done by using the command:
7.1.2 Setq
In AutoLISP, the process of establishing a value for a symbol is called
assignment. The common way to do assignment is to use SETQ. An assignment causes
the value of its second argument to become the value of its first argument, which has to
be a symbol. A symbol is a lexical variable, declared implicitly. SET is somewhat like
SETQ except that SET does evaluate its first argument. Therefore the first argument must
evaluate to the name of a dynamic variable (one whose value is to be created
dynamically). The only other difference is that SET takes only two arguments.
7.1.3 Polar
Returns the UCS 3D point at a specified angle and distance from a point.
7.1.4 Command
Executes an AutoCAD command and executes an AutoCAD command and the
supplied input.
7.2 Exponentiation:-
7.2.2 Expt
Returns a number raised to a specified power
7.3 Expressions :-
7.3.1 Getreal
7.4 Commands :-
7.4.1 Pline
Creates a 2D polyline, a single object that is composed of line and arc segments. The
PLINE command differs from the LINE command in that the segments of the PLINE are
connected. When using the LINE command, each segment is its own object. When using
PLINE, all line segments are one object.
7.4.2 Line
Create a series of contiguous line segments. Each segment is a line object that can be
edited separately.
7.4.3 Circle
Creates a circle.
7.4.4 Hatch
Fills an enclosed area or selected objects with a hatch pattern, solid fill, or gradient
fill. When the ribbon is active, the Hatch Creation contextual tab is displayed. When the
ribbon is off, the Hatch and Gradient dialog box is displayed.
.
7.4.5 Solid
Creates solid-filled triangles and quadrilaterals. 2D solids are filled only when the
FILLMODE system variable is on (1) and the viewing direction is orthogonal to the 2D
solid.
7.4.6 Polygon
Creates an equilateral closed polyline. You specify the number of sides of the polygon
and whether it is inscribed or circumscribed.
7.4.7 Zoom
Increases or decreases the magnification of the view in the current viewport You can
change the magnification of a view by zooming in and out, which is similar to zooming in
and out with a camera. Using ZOOM does not change the absolute size of objects in the
drawing. It changes only the magnification of the view.
8. Software Running
8.1 Working Flow :-
1. Draw 2d sketch of component which you want to design & draft automatically
by giving input values.
2. Calculate total no. of points.
3. Find co-ordinate values (X,Y,Z) of each point by using shortcut commands
available in AutoCAD software.
4. Write design calculations of component in AutoLISP programming language
in proper format.
5. Define functions & variables in program.
6. Define co-ordinate values of each point according to design calculations.
7. Use commands like ‘LINE’, ‘CIRCLE’, ‘RECTANGLE’,’PLINE’ to joining
each point for completing drawing.
8. Give proper path for joining points in using geometrical functions in
programming.
9. End the program by princ function.
The command line should display whether the program has indeed loaded
successfully, and any loading messages the author may have decided to include.
(findfile “[Link]”)
If this returns a filepath, navigate to the existing [Link] file and in the
steps that follow, amend its contents. Else, you can create a new [Link]
file by opening a new Notepad document (or other plain text editor) and saving it as
[Link] in an AutoCAD Support Path (ensuring the Save As Type panel is
once again set to All Files). In the [Link], add a line similar to this:
If the LISP file does not reside in the AutoCAD Support Path, a full filepath is
needed so that the LISP file may be located; in this case, be sure to use double
backslashes when specifying the path. When finished, open a new drawing and the
LISP files should load.
Note: if using this method to load many LISP files on startup is causing drawings
to open slower, refer to my tutorial on the use of AutoLoad to demand load LISP
files.
If the program has loaded successfully, you can now proceed to run the program in
the current drawing session. The syntax (command name) to call the program may be
displayed in the author's loading messages, or perhaps noted in the program header. If
it cannot be found in either of these locations, you can inspect the source code itself to
determine the command to [Link] syntax will be located after the c: in
a defun function call, for example:
(defun c:MyCommand ( )…
9. Results
In this image we can draft any component or drawing. Upper right corner shows
FILE menu to open new file or save file. To open new file follow this steps: FILE >
OPEN > CHOOSE FOLDER > CLICK ON .DWG FILE.
In this figure ‘VLIDE’ this command is typed in command bar to open Visual
Lisp console window. Type VLIDE in command bar and press enter button to open
console window.
In this figure the upper left corner show the ‘FILE’ menu to open new file. Click
on FILE and open new file to type new program.
Figure shows the .lsp window and visual lisp console window.
In this figure the program is typed in .lsp window and after running of program new
window is opened i.e. console window and it shows the program is run successful.
The window shows the 2d drawing of designed key on the basis of Shearing
Failure. The dimensions are automatically measured and displayed on screen.
In this figure flange coupling drafted automatically after giving inputs also
dimensions are measured automatically with the help of program.
10. CONCLUSION
AutoCAD is one of the most versatile 2D and 3D CAD software available in the
market. In addition to that, the AUTOLISP Programming provides and Intuitive approach
towards generating automatic diagrams with minimal user input. The Program can also be
saved as a Macro or as an AutoCAD plug-in which can then be used in any type of
systems and can be made commercial. Even a first time Novice user can be able to
understand the level of programming in LISP as it uses a common representation of
equations and command history which is easy to understand. Thus the flange coupling has
been designed for transmitting the power and found the designed values within the
allowable limits and the modelling of Flange coupling has been successfully done by
using the AutoCAD LISP.
12. REFERENCES
13. Photograph