AUTOLISP Prof.Dr. Demir Bayka. AUTOLISP 1.Declare and set values to variables 2.Pick the elements of lists 3.Implement AutoCad commands 4.Select Entities.

Slides:



Advertisements
Similar presentations
FRACTIONS.
Advertisements

First Steps using AutoDESK Inventor
AUTOLISP DRAWING (continued)
DRAWING THE PIN ME 426 INTERNAL COMBUSTION ENGINE DESIGN.
LESSON 5 PREPARING THE AUTOLISP CODE It is assumed that you have completed. Therefore the following lesson will show you what happens when you press the.
By Paul Richard and Jim Fitzgerald Chapter 9 - Drawing and Editing Complex Objects.
ENGT122 - CADI Chapter 15 - Hatching. What is Hatching? Hatching refers to filling an enclosed boundary with a repetitive pattern of formatted line segments.
1 Helpful Notes 2005 Tutorial 1 : Game Pad.
DRAWING USING SURFACES 115. To start your SURFACES drawing, go to new drawing, choose PART. Once the Part screen appears, click on START, choose MECHANICAL.
ME 3861 CAD Review A solid modeling example January 24, 2001.
Scripts and Meshes 1 Scripts and Meshes Meshes –Only way to draw very complex surfaces –Each point on the mesh is defined individually (ie you type in.
2008-Fall Technical Drawing – Week 4. 2  Dimensioning –Command Promt –Dimension Menu –Dimension Toolbox.
CVEV 118/698 AutoCAD 2000 Lecture 1 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar.
________CIVL114 LAB 4. Outline Exercise 1 – solving an intersection problem  Point Style  Rotate  Modify Dimension Style Exercise 2 – stirrups  Fillet.
PRESENTATION on AutoCAD 2013 Submitted By :- Dev RANA MECHANICAL BRANCH.
Architecture CAD Architectural CAD Geometry Copyright © Texas Education Agency, All rights reserved. 1.
AE4131 ABAQUS Lecture Part IV
1 Exercise Two The Digital Camera Helpful Notes 2004.
1-- Setup AutoCAD today a-Create documents – Wizard Quick Set Up – Area – units Advanced Set Up – Area – Units – Angles.
A Mid-Term study guide of covered commands. SAVING  Using the Save command allows the drafter to save an already developed drawing.  The Save As command.
§ 4.2 Compound Inequalities. Blitzer, Intermediate Algebra, 4e – Slide #22 Intersections & Unions Intersection & Union Intersection: The intersection.
© 2012 Autodesk AC2724 – 2D Parametrics in AutoCAD® and Why You Need to Use Them Rick Ellis President, Cadapult Software Solutions
Google Sketchup Lab Mr. Garner Tech Ed Lime Kiln MS.
EDT Chapter 41 Review - Linetypes Sacramento City College EDT 310.
Extrusion Rev: , AJP Extrude.
© 2006 Autodesk AutoCAD: Secrets Every User Should Know Chapter 8 - AutoLISP by Example: Getting Started.
Concepts of Engineering and Technology Introduction To Basic Auto CAD Problem #1 Copyright © Texas Education Agency, All rights reserved. 1.
Engineering H191 - Drafting / CAD Gateway Engineering Education Coalition Lect 4P. 1Autumn Quarter Design Review, Isometric Drawings and Introduction.
AutoCAD 2002 CAD stands for Computer-Aided Design. An AutoCAD drawing is made up of objects. These can be either simple graphic objects (such as lines,
What is AutoCAD? A software drafting tool Particularly useful for Mechanical drawings Architectural drawings.
Getting Started With AutoCAD ENGR 2 Week #1 Laboratory.
Mid-Term Pretest Review
§ 4.2 Compound Inequalities. Blitzer, Intermediate Algebra, 5e – Slide #2 Section 4.2 Compound Inequalities A compound inequality is formed by joining.
G&T Basic CAD Concepts and Printing from CAD Files Co-ordinate System CAD 1.2 x,y x1,y1 All lines in drawing as x,y co-ordinates in a digital database.
© The McGraw-Hill Companies, 2006 Chapter 2 Selection.
This is what we want to draw Extrude Mirror Round Edges.
Chapter 11: Block References and Attributes. After completing this Chapter, you will be able to use the following features: Create and insert block references.
1.To begin click: File, New, then select Design 2.Draw a circle, then use the dimension tool to set it’s size to 84 diameter or 42 radius. 3. Next draw.
I NTRODUCTION TO A UTO CAD P ART 2 Lab 8. CHAPTER OBJECTIVES Creating New Layers Assigning Colors to Layers Assigning Linetypes Assigning Lineweight Changing.
Chapter 5: Fundamentals IV. Advanced Drawing commands Advanced Object Selection Object Selection Methods Advanced Modify commands After completing this.
EDT Chapter 13 - Obtaining Drawing Information1 Obtaining Information About The Drawing Sacramento City College EDT 310.
Computer Aided Engineering Drawing
1© 2006 Autodesk AutoCAD: Secrets Every User Should Know Chapter 9 – AutoLISP by Example: Getting Better.
CIVL114 _________ LAB 3: Gauge Block. Outline Page Set-up Creating Layers, setting color & linetype Commands  Draw Lines  Round Corners Drawing the.
PLEASE USE THE ENTER KEY OR RIGHT CLICK ON THE MOUSE TO ADVANCE.
Chapter 5: Fundamentals IV. After completing this Chapter, you will be able to use the following features: Advanced Drawing commands Advanced Object Selection.
Train Body The next series of slides will guide you through the construction of the train body. Start a new drawing and save it as Train Body.
- draw a diameter - make a radius - join diameter and radius -join other end of diameter and radius - put in any angle for one of the angles formed - fill.
UNIT 4: AutoCAD Drawing Commands Objectives: Be able to identify, describe and/or apply… AutoCAD tools (Line, polyline, arcs, circles, rectangles, hatch.
From AutoCAD to ArcView. From AutoCAD to Arcview Purpose Display a site plan drawn in AutoCad on a view drawn in ArcView Given Campus site plan drawing.
Autodesk Inventor Design Exercise 2: F1 Team Challenge Car Developed by Tim Varner – Synergis Technologies © Tim Varner
UNIT 2: Starting An AutoCAD Drawing Objectives: Be able to identify, describe and/or apply… The key components of the Application Menu and Quick Access.
Submitted To: Submitted By: Seminar On AutoCAD.
Editing Polylines1 Sacramento City College Engineering Design Tecnology.
 AutoCAD Ellipse Command AutoCAD Ellipse Command  AutoCAD Arc Command AutoCAD Arc Command  AutoCAD Polygon Command AutoCAD Polygon Command  AutoCAD.
Week 6 Drafting 1309: Basic CAD Andrew Amini Professor Drafting and Design Engineering Technology, HCC.
Concepts of Engineering and Technology
Solving systems of equations
SketchUp Chocolate Level of Difficulty Time
Linear, Aligned, diameter, radius, Angular and
Drawing and Editing Polylines and Splines Chapter 16
Computer Application AutoCAD Program
AutoCAD Dimensioning Commands
Perpendicular Bisector of a Line
Lisp Tutorial Click on Xlisp icon – you enter the interpreter
Obtaining Information About The Drawing
Combining Like Terms and Distributive Property
Learning Objectives • Input methods for drawing
Week 10 Drafting 1309: Basic CAD
Sacramento City College Engineering Design Technology
Presentation transcript:

AUTOLISP Prof.Dr. Demir Bayka

AUTOLISP 1.Declare and set values to variables 2.Pick the elements of lists 3.Implement AutoCad commands 4.Select Entities IT IS POSSIBLE TO CREATE CAD DRAWINGS IN AUTOCAD THROUGH AUTOLISP TEXT FILES FROM WITHIN A DELPHI 4.0 EXECUTABLE PROGRAM NECESSARY TOPICS

All autolisp commands are written in parenthesis > Comment lines begin with > Autolisp files have > extensions Autolisp files can be loaded into Autocad by command line or > in the menu. AUTOLISP

Declare and set values to variables The Autolisp command is > (setq x 10) x = 10 (setq y x) y = 10 (setq y (* x 2)) y = 20 (setq y (+ x 15)) y = 25 (set y (list “Black” x 12)) y is set to the array the 4th element of the y-array is 67 the 5th element of the y-array is “Black” the 6th element is 10 (assuming x=10)

In autolisp the arithmetic operations are performed as ; (setq ( )) This can be interpreted as ; Variable = value1 (operator) value2 Examples: (setq x (+ 10 5))x = 15 (setq x (- 10 5))x = 5 (setq x (* 10 5))x = 50 (setq x (/ 10 5))x = 2 (setq a 10) (setq b 5) (setq x (* a b))x = 50

In autolisp arrays can also be assigned to variables. Then ofcourse that variable will have a first, second,third... and so on values. Arrays may be expressed by preceeding with e.g. An array (1,5,67,99.5,3) may be represented as ; (list ) If this array is asigned to a variable (say x) then; (setq x (list )) QUESTION : How do we pick out the first or third element of x ?

There are two functions that can be used for this purpose: 1.car(picks the first element of the list) 2.cdr(picks all elements EXCEPT the first) If you want to pick out the third element then you can call once (now you have a list starting with the second element) call again (now you have a list starting with the third element) call and pick out the first element which is the third element of the original list. EXAMPLES (setq x (car (list )))x=1 (setq x (car (cdr (cdr (list )))))x=67 (list ) (list ) 67

The way you interpret a nested combination is FROM RIGHT TO LEFT. Example caddr means (car (cdr (cdr First operation Second operation Third operation Therefore : (setq p3D (list )) (setq x (car p3D))x = 50 (setq x (cadr p3D))x= 4 (setq x (caddr p3D))x = 205 JUST REMEMBER car cadr caddr (x)(y)(z)

Implement AutoCad commands AUTOCAD COMMANDS ARE IMPLEMENTED BY THE > FUNCTION OF AUTOLISP EXAMPLE (command “line” p1 p2 “”) Draws a line from point p1 to point p2 (command “zoom” “extent”) Zooms to the extent of whatever entities are on the screen (command "pedit" L1 "Y" "join" L2 L3 "" "") Joins L1 L2 L3 lines into a polyline

We have learned; 1.How to declare and set values to variables 2.How to pick the elements of lists with (car, cadr, caddr) 3.How to implement AutoCad commands Now we will look at another feature ; SELECTION OF ENTITIES The “entities” could be “a point”, “a line”, “a set of lines”, “a polyline”,“a set of polylines”, “a profile”, “a circle”, “a rectangle”, “a solid”.....etc. There are various methods. We will look into 2 of these. Namely (ssget “L”) and (ssget “X”) functions.

(ssget “L”) method is used to select the LAST entity that was created. For example lets draw half of a circle. You may do this by drawing an ARC that has a center point, starting point and an angle (180). The points should be 2D (polylines and arcs are drawn on the XY plane) (setq p0 (list (+ (car cen) R2) (cadr cen) (caddr cen)))p0=(R2,0,0) (setq arccen (list (car cen) (cadr cen)))arccen=(0,0) (setq arc1 (list (car p0) (cadr p0)))arc1=(R2,0) (command "arc" "c" arccen arc1 "a" "180") You have to check from AutoCad Help about the use of the ARC command Now that the arc is drawn you can assign it (the whole list of properties of an arc) to a variable say. In order to do this you must first select it and then use the function. (setq PLarc1 (ssget "L"))

Draw a profile for extrusion. Assume this profile has 2 arcs (<PLarc1> and <PLarc2>) and two polylines (<PL1> and <PL2>). We can combine them all into a single polyline <Profile> by the <pedit> Autocad command. (command "pedit" (ssget "X") "Y" "join" (ssget "X") "" "exit") (setq Profile (ssget "L")) As you have noticed in the <pedit> command we have selected all the entities <PLarc1>, <PL1>, <PLarc2>, <PL2> by (ssget “X”). However after the single polyline was formed we selected only that polyline and assigned it to <Profile>. (ssget “X”) method is used to select the ALL SELECTABLE ENTITIES that were created. EXAMPLE