0% found this document useful (0 votes)
397 views40 pages

Mega Project Report

The document describes a project report on designing machine elements using AutoLISP programming in AutoCAD. It includes an introduction, literature survey, methodology, component design of a flange coupling and sunk key, generation of AutoLISP programs to design these elements, description of the programs, steps to run the programs in AutoCAD, results of running the programs, and conclusions. It was submitted by three students for their diploma project under the guidance of their lecturer.

Uploaded by

Chaitanya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
397 views40 pages

Mega Project Report

The document describes a project report on designing machine elements using AutoLISP programming in AutoCAD. It includes an introduction, literature survey, methodology, component design of a flange coupling and sunk key, generation of AutoLISP programs to design these elements, description of the programs, steps to run the programs in AutoCAD, results of running the programs, and conclusions. It was submitted by three students for their diploma project under the guidance of their lecturer.

Uploaded by

Chaitanya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Design of machine element by using Autolisp programming in AutoCAD

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.

1. [Link] Dhondiram Yadure 132162


2. [Link] Sandesh Shah 132157
3. [Link] Sambhaji Pawar 132146

UNDER THE GUIDANCE OF

[Link]
Lecturer in Mechanical Engineering.

Department of Mechanical Engineering


[Link], Yadrav (Ichalkaranji)
[2018-19]
SIT Polytechnic,Yadrav,Ichalkaranji. Page 1
Design of machine element by using Autolisp programming in AutoCAD

Shri Shamrao Patil (Yadravkar) Educational & Charitable Trust’s


SHARAD INSTITUTE OF TECHNOLOGY
POLYTECHNIC,
Yadrav(Ichalkaranji)

C
CEER
RTTIIFFIIC
CAAT
TEE

This is to certify that,

Name of Student Roll No.

1. [Link] Dhondiram Yadure 132162


2. [Link] Sandesh Shah 132157
3. [Link] Sambhaji Pawar 132146

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.

[Link] Mr. S.S. MALI Mr. [Link]

Project Guide Head of Mech. Engg. Dept. Principal

SIT Polytechnic,Yadrav,Ichalkaranji. Page 2


Design of machine element by using Autolisp programming in AutoCAD

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.

This work is humbly submitted to M.S.B.T.E,MUMBAI. as per report under the


curriculum.

Date:
Place:Yadrav.
Name of the Candidate Roll No Sign

1) [Link] Dhondiram Yadure 132162

2) [Link] Sandesh Shah 132157

3) [Link] Sambhaji Pawar 132146

SIT Polytechnic,Yadrav,Ichalkaranji. Page 3


Design of machine element by using Autolisp programming in AutoCAD

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.

Name of the candidate Roll No

1) [Link] Dhondiram Yadure 132162

2) [Link] Sandesh Shah 132157

3) [Link] Sambhaji Pawar 132146

SIT Polytechnic,Yadrav,Ichalkaranji. Page 4


Design of machine element by using Autolisp programming in AutoCAD

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

SIT Polytechnic,Yadrav,Ichalkaranji. Page 5


Design of machine element by using Autolisp programming in AutoCAD

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

SIT Polytechnic,Yadrav,Ichalkaranji. Page 6


Design of machine element by using Autolisp programming in AutoCAD

List of Figures

Name of Figure Page No


Fig. No.
Load / Unload application 28
1
Opening window of CAD 31
2
software
Typed command n command 32
3
bar
Visual lisp console window 33
4
.lsp console window 34
5
CAD drawing of Key 35
6
CAD drawing of Flange 36
7
Coupling

SIT Polytechnic,Yadrav,Ichalkaranji. Page 7


Design of machine element by using Autolisp programming in AutoCAD

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.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 8


Design of machine element by using Autolisp programming in AutoCAD

2. Introduction

After the development of AutoCAD conscripting of engineering drawing becomes easier.


In case of Mechanical Engineering drawing, drafting of machine element with small
describing at any scale is made possible. Also main benefit of AutoCAD is to increase
competence and reduce in time. But to achieve this benefits user must have thorough
information of AutoCAD. Though one may have good command on CAD, he becomes
bore in detailing in drawing elements and errors may be happens. To eradicate this
problem, we can customize the AutoCAD. AutoLISP is the powerful old tool to automate
the drawing. In AutoLISP, programmer assigns mathematical equations to get specific
drawings by getting inputs from the user. After obtaining inputs or data from the user the
application produces the image.

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.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 9


Design of machine element by using Autolisp programming in AutoCAD

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.

In the design complex engineering products it is essential to handle cross-couplings and


synergies between subsystems. [3]

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]

SIT Polytechnic,Yadrav,Ichalkaranji. Page 10


Design of machine element by using Autolisp programming in AutoCAD

4. Methodology
4.1 Flange Coupling :-
START

INPUTS:

1. POWER [Link] [Link]


STRESS

OUTPUTS:

1. Diameter of shaft [Link] diameter of hub


[Link] of the hub 4. Thickness of Flange [Link]
of circle diameter [Link] Diameter of flange

COMMANDS USED:

Line, Rectangle, Polygon, Circle, Hatch, Trim

Check for
Design Safety

STOP

SIT Polytechnic,Yadrav,Ichalkaranji. Page 11


Design of machine element by using Autolisp programming in AutoCAD

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

SIT Polytechnic,Yadrav,Ichalkaranji. Page 12


Design of machine element by using Autolisp programming in AutoCAD

5. Component Design
5.1 Design of Flange Coupling

Let

d = Diameter of shaft

D = Outer diameter of shaft

dc = Core diameter of shaft

D1 = Pitch circle diameter of bolt

n = No. of bolts

tf = Thickness of flange

↊s,↊b&↊k = Permissible shear stress for shaft, bolt & key material

↊f = Permissible shear stress for flange material

σcb & σck = Permissible crushing stress for bolt & key material

5.1.1 Design of shaft

Considering the shaft under torsion, we have

T= 16 x ↊s x

From above equation we can determine‘d’.

5.1.2 Design of Hub

The hub is designed by considering it as a hollow shaft transmitting the same torque as
that of solid shaft. We have

T = π/16 x ↊hub x (1- )

Where,

SIT Polytechnic,Yadrav,Ichalkaranji. Page 13


Design of machine element by using Autolisp programming in AutoCAD

k=

5.1.3 Design of key

The is designed with usual proportions as follows & then checked for shearing and
crushing stress.

i.e. w = ,t= & l=L

by considering shear failure torque transmitted

T = l x w x ↊k x d/2 ------by shear failure

By considering crushing failure torque transmitted

T = l x t/2 x σck x d/2 ------by crushing failure

5.1.4 Design of Flange

The flange at junction of the hub is under shear while transmitting torque hence torque
transmitted by flange is given as

T = Force x Radius of hub

↊ = Shear stress in flange x Resisting area x Radius of hub

Where,

tf = d/2

5.1.5 Design of Bolts

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

SIT Polytechnic,Yadrav,Ichalkaranji. Page 14


Design of machine element by using Autolisp programming in AutoCAD

Force acting on each bolt = Shear stress x Area

A = ↊b x π/4 x

Hence total load on bolt

F = n x ↊b x π/4 x

Hence torque transmitted by bolts is given as

T = Total load on bolt x P.C.D./2

T = n x ↊b x π/4 x x D1/2

Where,

D1 = 3d

D2 = 4d

5.2 Design of Sunk key

The key is designed with usual proportions as follows & then checked for shearing and
crushing stress.

i.e. w = ,t= & l=L

By considering shear failure torque transmitted

T = l x w x ↊k x d/2 ------by shear failure

By considering crushing failure torque transmitted

T = l x t/2 x σck x d/2 ------by crushing failure

SIT Polytechnic,Yadrav,Ichalkaranji. Page 15


Design of machine element by using Autolisp programming in AutoCAD

6. Generation of Program

6.1 Program of FLANGE COUPLING:-

(defun c:flange()

(setq n (getreal " enter the speed:")

tou (getreal "enter the permissible shear stress in

N/mm2:")

P(getreal "enter the magnitude of load in N:")

pii(getreal "enter pi value")

TT(/(* 45000 p) (* 2 pii n))

d(expt(/(* 16 TT) (* pii tou))(/ 1 3))

(setq pt1 '(0 0)

pt2 (polar pt1 (/ pii 2) (* 0.16 d))

pt3 (polar pt2 0 (* 0.3 d))

pt4 (polar pt3 (/ pii 2) (* 0.99 d))

pt5 (polar pt4 pii d)

pt6 (polar pt5 (/ pii 2) (* 0.5 d))

pt23 (polar pt6 0(* 3 d))

pt24(polar pt23 (* 1.5 pii) (* 0.5 d))

pt25 (polar pt24 pii d)

pt26 (polar pt25 (* 1.5 pii) (* 0.99 d))

pt27 (polar pt26 0(* 0.3 d))

SIT Polytechnic,Yadrav,Ichalkaranji. Page 16


Design of machine element by using Autolisp programming in AutoCAD

pt28 (polar pt27 (* 1.5 pii) (* 0.16 d))

pt29 (polar pt3 (/ pii 2) (* 0.145 d))

pt30 (polar pt29 pii(* 0.25 d))

Pt31 (polar pt30 (/ pii 2) (* 0.7 d))

pt32 (polar pt31 0(* 0.25 d))

pt33 (polar pt32 (* 1.5 pii) (* 0.2 d))

pt35 (polar pt33 0 (* 1.5 d))

Pt36 (polar pt35 (* 1.5 pii) (* 0.3 d))

pt34 (polar pt36 pii (* 1.5 d))

pt37 (polar pt32 0 d)

pt38 (polar pt37 0 (* 0.25 d))

pt39 (polar pt38 (* 1.5 pii) (* 0.7 d))

pt40 (polar pt39 pii (* 0.25 d))

pt7 (polar pt6 pii(* 0.5 d))

pt8 (polar pt7(/ pii 2) d)

pt21 (polar pt8 0(* 4 d))

pt22 (polar pt21(* 1.5 pii) d)

pt81 (polar pt3 (/ pii 2) (* 0.495 d))

pt82 (polar pt81 pii (* 0.25 d))

pt83 (polar pt82 (/ pii 2) (* 0.19 d))

pt84 (polar pt83 0 (* 0.25 d))

pt85 (polar pt83(* 1.5 pii) (* 0.38 d))

pt86 (polar pt85 0 (* 0.25 d))

SIT Polytechnic,Yadrav,Ichalkaranji. Page 17


Design of machine element by using Autolisp programming in AutoCAD

pt9 (polar pt8 0 (* 0.5 d))

pt10 (polar pt9 (/ pii 2) (* 0.5 d ))

ptll (polar pt10 0 d)

pt61 (polar pt11 (/ pii 2)(* 0.345 d))

Pt62 (polar pt61 0 d)

pt18 (polar pt62 (* 1.5 pii) (* 0.345 d))

pt19 (polar pt18 0 d)

pt20 (polar pt19 (* 15 pii)(* 0.5 d))

pt63 (polar pt11 (/ pii 2)(* 0.145 d))

Pt64 (polar pt63 pii (* 0.25 d))

pt65 (polar pt64 (/ pii 2) (* 0.7 d))

Pt66 (polar pt65 0 (* 0.25 d))

pt67 (polar pt61 (/ pii 2)(* 0.3 d))

pt68 (polar pt67 0 (* 1.5 d))

pt69 (polar pt68 (* 1.5 pii)(* 0.3 d))

pt12 (polar pt67 (/ pii 2) (* 0.345 d))

pt13 (polar pt12 pii(* 0.3 d))

pt14 (polar pt13 (/ pii 2) (* 0.16 d))

pt15 (polar pt14 0(* 1.6 d))

pt16 (polar pt15 (* 1.5 pii) (* 0.16 d))

pt17 (polar pt16 pii (* 0.3 d))

pt70 (polar pt17 (* 1.5 pii) (* 0.345 d))

pt71 (polar pt66 0 d)

SIT Polytechnic,Yadrav,Ichalkaranji. Page 18


Design of machine element by using Autolisp programming in AutoCAD

pt72 (polar pt71 0 (* 0.25 d))

pt73 (polar pt72 (* 1.5 pii)(* 0.7 d))

pt74 (polar pt73 pii(* 0.25 d))

pt90 (polar pt21 (* 1.5 pii) (* 0.5 d))

pt91 (polar pt90 0 (* 3 d))

pt92 (polar pt91 (/ pii 2)(* 1.5 d))

pt93 (polar pt91 0 (* 1.5 d))

pt94 (polar pt91 (* 1.5 pii) (* 1.5 d))

pt95 (polar pt91 pii(* 1.5 d))

pt100 (polar pt1 0 (* 0.8 d))

pt10l (polar pt100(/ pii 2) d)

pt102 (polar pt101 0(* 0.1 d))

pt103 (polar pt102 ( / pii 2) (* 2.3 d))

pt104 (polar pt103 pii (* 0.1 d))

pt105 (polar pt104 (/ pii 2) d)

pt106 (polar pt102(/ pii 2) (* 1.57 d ))

pt107 (polar pt106 (/ pii 2) (* 0.17 d))

pt108 (polar pt107 0(* 1.7 d))

pt109 (polar pt108 (* 1.5 pii ) (* 0.17 d))

pt110 (polar pt91 (/ pii 2)(* 0.4376 d ))

pt111 (polar pt110 pii(* 0.07 d))

pt112 (polar pt111(/ pii 2) (* 0.15 d ))

pt113 (polar pt112 0 (* 0.14 d))

SIT Polytechnic,Yadrav,Ichalkaranji. Page 19


Design of machine element by using Autolisp programming in AutoCAD

pt114 (polar pt113 (* 1.5 pii)(* 0.15 d))

(command "pline" pt1 pt2 pt3 pt4 pt5 pt6 pt23 pt24 pt25 pt26 pt27 pt28 "c")

(command "pline" pt29 pt30 pt31 pt32 "c" )

(command "pline" pt33 pt35 pt36 pt34 "c")

(command "pline" pt37 pt38 pt39 pt40 "c")

(command "pline" pt7 pt8 pt21 pt22 "c" )

(command "line" pt81 pt82 "")

(command "line" pt83 pt84 "")

(command "line" pt85 pt86 "")

(command "pline" pt9 pt10 pt11 pt61 pt62 pt18 pt19 pt20"c")

(command "hatch" "solid" "last" "" )

(command "pline" pt63 pt64 pt65 pt66 "c" )

(command "pline" pt6l pt67 pt68 pt69 "c")

(command "pline" pt67 pt12 pt13 pt14 ptl5 pt16 pt17 pt70 "c")

(command "hatch""solid" "last" "")

(command "pline" pt71 pt72 pt73 pt74 "c")

(command "circle" pt91 (* 2.15 d )"")

(command "circle" pt91 (* 2 d)"")

(command "circle" pt91 (* 0.5 d )"")

(command "hatch" "solid" "last" "" )

(command "circle" pt91 d "")

(command "polygon" 6 pt92 "l" (* 0.35 d) "")

SIT Polytechnic,Yadrav,Ichalkaranji. Page 20


Design of machine element by using Autolisp programming in AutoCAD

(command "polygon" 6 pt93 "l" (* 0.35 d) "")

(command "polygon" 6 pt94 "l" (* 0.35 d) "")

(command "polygon" 6 pt95 "l" (* 0.35 d) "")

(command "pline" pt100 pt101 pt102 pt103 pt104 pt105 "")

(command "pline" pt106 pt107 pt108 pt109 "c")

(command "hatch" "solid" "last" "" )

(command "pline" pt111 pt112 pt113 pt114 "c")

(command "hatch" "solid" "last" "")

(command "ucsicon" "no" "")

(command "zoom" "extents")

(command "regen")

SIT Polytechnic,Yadrav,Ichalkaranji. Page 21


Design of machine element by using Autolisp programming in AutoCAD

6.2 Program of KEY:-

;TR=Torque transmitted by shaft

;F=Tangential force acting on circumference of shaft

;d=diameter of shaft

;l=lenth of key

;w=width of key

;th=thickness of key

;tou & cs = permissible shear & crushing stress of material

(defun c:cskey()

(setq

cs(getreal"\n Enter the permissible crushing stress in N/mm2=")

d(getreal"\n Enter the diameter of shaft in MM=")

w(/ d 4)

th(/ d 6)

TR(* (/ 3.14 16) cs (* d d d))

lc(/ (* TR 2 2)(* cs th d)))

(setq osm "osmode")

(setq pt1(getpoint "\nSpecify point you want to start")

pt2(polar pt1 0 w)

pt3(polar pt2(/ pi 2) th)

pt4(polar pt3 pi w)

SIT Polytechnic,Yadrav,Ichalkaranji. Page 22


Design of machine element by using Autolisp programming in AutoCAD

(command "pline" pt1 pt2 pt3 pt4 pt1"c")

(command "dimlinear" pt1 pt2)

(princ)

SIT Polytechnic,Yadrav,Ichalkaranji. Page 23


Design of machine element by using Autolisp programming in AutoCAD

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:

(defun [Define Function]


The defun if used to define your own function into program.

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.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 24


Design of machine element by using Autolisp programming in AutoCAD

7.2 Exponentiation:-

7.2.2 Expt
Returns a number raised to a specified power

7.3 Expressions :-

7.3.1 Getreal

A string on the command line Several functions enable an AutoLISP application to


prompt the user for input of data. Pauses for user input of a real number, and returns that
real number.

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.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 25


Design of machine element by using Autolisp programming in AutoCAD

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.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 26


Design of machine element by using Autolisp programming in AutoCAD

8. Software Running
8.1 Working Flow :-

1. Takes input values from user.


2. Calculation of design values.
3. Calculation of co-ordinates of points.
4. Plotting of points.
5. Joining of points.
6. Generation of 2d drawing.
7. Display Drawing.

8.2 Program creation method :-

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.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 27


Design of machine element by using Autolisp programming in AutoCAD

8.3 Steps to load program file into AutoCAD software:-

8.3.1 Method 1: Using AppLoad

At the AutoCAD command line, type AppLoad (alternatively go to Tools »


Load Application).
Select the program file as previously saved and click Load to load the program
into the current drawing session. Click Close to close the Appload Dialog.

Figure 1: Load / Unload Applications

The command line should display whether the program has indeed loaded
successfully, and any loading messages the author may have decided to include.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 28


Design of machine element by using Autolisp programming in AutoCAD

8.3.2 Method 2: Using the [Link]

Another way to load an AutoLISP program is to include a load call in the


[Link]. Everytime a new drawing is opened, AutoCAD will search the
Support Paths for any [Link] files, and will proceed to load the first one it
discovers. First we must check that an [Link] file exists - to do this type at
the AutoCAD command line:

(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:

(load “C:\\Myfolder\\[Link]” “MyLISP Failed to Load”)

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.

8.3.3 Method 3: Using the Visual LISP Integrated Development


Environment (VLIDE)

This method is aimed primarily at developers, as the VLIDE offers many


debugging utilities when writing & loading code.
To load a program using this method, type VLIDE at the AutoCAD command line.
In the window that subsequently appears, go to File » Open
File (alternatively, Ctrl+O), and select the previously saved file. Now go to Tools »
Load Text in Editor (alternatively, Ctrl+Alt+E).

SIT Polytechnic,Yadrav,Ichalkaranji. Page 29


Design of machine element by using Autolisp programming in AutoCAD

8.4 Running the Program

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 ( )…

In the above example, the command would be MyCommand.


If the c: does not appear after the defun function, this indicates that the function is a
subfunction and is designed to be called from another program. When the command
syntax is known, it may be typed at the AutoCAD command line to invoke the
program.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 30


Design of machine element by using Autolisp programming in AutoCAD

9. Results

Figure shows starting window of AutoCAD Software 2019.

Figure 2: Screenshot to Opening window of CAD software

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.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 31


Design of machine element by using Autolisp programming in AutoCAD

Figure shows the command to open Visual Lisp console window.

Figure 3: Screenshot of typed command in command bar

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.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 32


Design of machine element by using Autolisp programming in AutoCAD

Figure shows the Visual LISP console window.

Figure 4: Screenshot of Visual LISP 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.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 33


Design of machine element by using Autolisp programming in AutoCAD

Figure shows the .lsp window and visual lisp console window.

Figure 5: Screenshot of .lsp window & 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.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 34


Design of machine element by using Autolisp programming in AutoCAD

Figure shows the screenshot of 2d drawing in AutoCAD:

Figure 6: CAD drawing of Key

The window shows the 2d drawing of designed key on the basis of Shearing
Failure. The dimensions are automatically measured and displayed on screen.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 35


Design of machine element by using Autolisp programming in AutoCAD

Figure shows 2d drawing of flange coupling in AutoCAD

Figure 7: Screenshot of Flange coupling

In this figure flange coupling drafted automatically after giving inputs also
dimensions are measured automatically with the help of program.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 36


Design of machine element by using Autolisp programming in AutoCAD

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.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 37


Design of machine element by using Autolisp programming in AutoCAD

11. Future Scope


I. In manufacturing industry various parts will be produced by AutoLISP
programming for faster in design calculation & drafting of parts.
II. Almost all activities that you do manually can be performed automatically
using AutoLISP.
III. Creates two dimensional objects (2d) and also three dimensional objects (3d)
by programming for better view and calculates all dimensions of objects.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 38


Design of machine element by using Autolisp programming in AutoCAD

12. REFERENCES

[1] GuanZhi-chao and Fang Xiao-chu “A Generation Method of Mechanical Assembly


Drawing in CAD” in Wuhan University Journal of Natural Sciences Vol. 5 No.3 pp.,
298~300,2000.
[2] Muhammad Akilul and Hassan Ibrahim Ogiri "Autocad Programming For Reinforced
Concrete Structural Detailing" in International Journal of Scientific Engineering and
Technology
[3] Mohammed Amine, Dirhar, Essaid and El Kennassi “3D Autolisp Mesh Generation”
in Journal Of Advanced Research In Mechanical Engineering And Technology
Vol. 4 No. 1, 2017
[4] Edelsbrunner H. “Geometry and Topology for Mesh Generation” in Cambridge,
United Kingdom, Cambridge University Press, 2001
[5] The ABC's of AutoLISP by Omura George, 2001
[6] Gabriel, Richard P. “Performance and Evaluation of Lisp Systems” in MIT Press,
1985.
[7] George P.L, "Automatic mesh generation and finite element computation." In
Handbook of Numerical Analysis Elsevier Science B.V. Vol. IV, 1996.
[8] Baker T. J., “Automatic Mesh Generation for Complex Three-Dimensional Regions
Using Constrained Delaunay Triangulation.” In Engineering with Computers,
vol. 5, pp. 161-175, 1989.

SIT Polytechnic,Yadrav,Ichalkaranji. Page 39


Design of machine element by using Autolisp programming in AutoCAD

13. Photograph

SIT Polytechnic,Yadrav,Ichalkaranji. Page 40

You might also like