VISUALIZATION OF AUTOMATED PLATE CUTTING OPERATION USING DXF FILE NORAZURA BINTI ABD. RAHIM A project report submitted in partial fulfillment of the requirements for the award of the degree of Master of Science (Information Technology – Manufacturing) Faculty of Computer Science and Information System Universiti Teknologi Malaysia APRIL 2008 iii To all the love I received, my beloved mom and family…. 23 years surrounded by love……… and the love of knowledge. Would like to thank you for being here with me. iv ACKNOWLEDGEMENT My greatest gratitude goes to my supervisor, Dr. Habibollah bin Harun, for the brilliant ideas, suggestions, helpful guidance and for tolerating with the mischievous behavior I showed. Sincere gratitude also goes to my last Manager at Kinn Engineering Works, Melaka, Mr. Goh Toh Hau, my colleagues at the organization for the idea of this project and thousands of helps and suggestion towards this project. Not forgetting to all my friends for their supports and Nuremi Aqmal for his understanding and helps during implementing this project. Finally, to my beloved family especially my mom for her supports during my study here. Thanks a lot. v ABSTRACT This project is going to visualize the automated plate cutting application using plasma cutter. The problem behind this project is taken from problem aroused at Kinn Engineering Works, Malacca. But it will not act as the study case, this project is more to education based. The problems here are how to automate those application and what are the processes needed in order to automate it. The objective of this project is to automate the plate cutting operation and to develop a framework on how the automation could be performed. Due to cost constraint, the scope of this project was narrow down to just visualize it instead of perform it in real time application. All the drawing used is in 2 dimension drawing format. The product design for this project is in the .dwg format (Solidworks) and it will use the dxf file format as the interchange format file. This project has two main modules which are dxf reader and the animation of plate cutting process. This project is performed using project-based methodology. The drawing read by the dxf reader will be compared to the real drawing for validation purpose, and the animation process will be justified by the precision of the cutting route path. This system was developed in the C# and .NET framework environment. There are two results expected which are the system and the framework for the automated plate cutting application. vi ABSTRAK Projek ini akan menganimasikan proses pemotongan kepingan secara automatik menggunakan pemotong plasma. Masalah di sebalik pengenalan projek ini adalah diambil dari masalah yang berlaku di Kinn Enggineering Works, Melaka. Tetapi, organisasi ini tidak akan bertindak sebagai kajian kes, kerana projek ini akan dibangunkan lebih berdasarkan pembelajaran. Masalah bagi projek ini adalah bagaimana aplikasi pemotongan kepingan ini dapat dilaksanakan secara automatik dan apakah proses – proses yang terlibat bagi mengautomasikan aplikasi ini. Projek ini dibangunkan bertujuan untuk mengautomasikan proses pemotongan kepingan dan membangunkan suatu rangka kerja bagaimana pengautomasian ini dapat dilaksanakan. Berikutan masalah kewangan yang dihadapi, skop projek ini telah dikecilkan dengan hanya menganimasikan proses pemotongan kepingan secara automatik tersebut. Projek ini hanya akan meliputi penggunaan lukisan dalam format 2 dimensi sahaja. Rekabentuk produk bagi projek ini adalah dalam format .dwg (lukisan Solidworks) dan menggunakan fail dxf sebagai fail perantaraan. Projek ini akan menganimasikan aplikasi sebenar berdasarkan lukisan yang diberi. Sistem ini mempunyai dua modul utama iaitu pembaca dxf dan penganimasian proses pemotongan. Projek ini dilaksanakan menggunakan metodologi berdasarkan projek. Lukisan yang dihasilkan oleh pembaca dxf akan dibandingkan dengan lukisan sebenar untuk tujuan validasi, dan animasi proses pemotongan akan dijustifikasi berdasarkan ketepatan laluan pemotongan kepingan yang dilalui. Sistem ini dibangunkan dalam persekitaran C# dan juga .NET framework. Terdapat dua hasil jangkaan bagi projek ini iaitu sistem dan juga rangka kerja bagi mengautomasikan proses pemotongan kepingan tersebut. vii TABLE OF CONTENT CHAPTER 1 2 TITLE PAGE DECLARATION ii DEDICATION iii ACKNOWLEDGEMENT iv ABSTRACK v ABSTRAK vi TABLE OF CONTENT vii LIST OF TABLES x LIST OF FIGURES xi LIST OF APPENDICES xii INTRODUCTION 1.1 Introduction 1 1.2 Background of problem 2 1.3 Statement of the Problem 3 1.4 Project Objectives 3 1.5 Project Scope 4 LITERATURE REVIEW 2.1 Introduction 5 2.2 Background of Solidworks 6 2.3 About Plasma Cutting 7 2.4 Automated Plate Cutting Operation 9 (Real Time Application) 2.5 About DXF 10 viii 3 2.5.1 Dxf file format Information 11 2.5.2 Dxf Group Codes 11 2.5.2.1 Header 11 2.5.2.2 Classes 12 2.5.2.3 Tables 15 2.5.2.4 Blocks 16 2.5.2.5 Entities 18 2.5.2.6 Objects 20 METHODOLOGY 3.1 Introduction 22 3.2 Methodology for Developing the Automated 22 Plate Cutting Systems 3.3 4 3.2.1 Problem Definition 23 3.2.2 Data Collection 23 3.2.3 System Developing and Visualization 24 3.2.4 Validation and Testing 24 Methodology of Plate Cutting Framework Development 25 3.3.1 Problem Definition 25 3.3.2 Data Collection 26 3.3.3 Process Verification 26 3.3.4 26 Framework Development 3.3.5 Framework Validation 27 3.4 Hardware Requirement 27 3.5 Software Requirement 27 3.6 Methodology Conclusion 28 ANALYSIS AND SYSTEM DESIGN 4.1 Introduction 29 4.2 Real Time Application Analysis 29 4.3 System Design 30 4.3.1 31 Input Design ix 4.3.2 5 6 Output Design 32 4.5 Framework Analysis 34 4.6 Conclusion 35 IMPLEMENTATION AND TESTING 5.1 Introduction 36 5.2 System Development 36 5.2.1 Interfaces Development 37 5.2.2 System Programming 39 5.3 System Testing 42 5.4 Framework Development and Testing 44 5.5 Conclusion 45 DISCUSSION AND CONCLUSION 6.1 Introduction 46 6.2 Discussion 46 6.3 Project Advantages 47 6.4 Project Improvement 47 6.5 Suggestion 48 6.6 Conclusion 48 REFERENCE Bibliography Appendix A - C 49 50-97 x LIST OF TABLES TABLE NO. TITLE PAGE 2.1 Variable in the HEADER Section 11 2.2 CLASSES Section in DXF file 12 2.3 CLASSES Section Group Codes 13 2.4 Default Class Values 14 2.5 TABLES Section of DXF file 15 2.6 BLOCKS Section in DXF file 17 2.7 Group Codes by Entities 18 2.8 ACAD_REACTORS Records 19 2.9 ACAD_XDICTIONARY Records 19 2.10 Group Flag bit-coded Values 20 2.11 OBJECTS Section in DXF file 20 xi LIST OF FIGURES FIGURE NO. TITLE PAGE 2.1 Solidworks Screenshot 6 2.2 Reusable of Parts 7 2.3 Example of tooling setup 9 2.4 Example of Plasma Cutter 9 2.5 Dross Free Plasma Cut Edge 10 2.6 Plasma Cut Edge with Heavy Dross Formation 10 3.1 Methodology for Automation of Plate Cutting Operation 23 3.2 Methodology of Plate Cutting Framework Development 25 4.1 Example of Plasma Cutter 30 4.2 System Design 30 4.3 Example of .dwg Drawing 31 4.4 Example of dxf File 32 4.5 Output Drawing Interface 33 4.6 Output Animation Interface 33 4.7 Framework of Automated Plate Cutting Operation 34 5.1 Main Menu 38 5.2 Drawing Displayed 38 5.3 Visualization of the Cutting Process 39 5.4 Dxf Reader Module 40 5.5 Animation Module 41 5.6 Solidworks Drawing 42 5.7 System’s Drawing 43 5.8 Cutting Process Testing 44 5.9 Framework of Automated Plate Cutting Operation 45 xii LIST OF APPENDICES APPENDIX TITLE PAGE A Introduction to Solidworks 50 B About DXF 73 C Project I and II Gantt Chart 95-97 CHAPTER 1 INTRODUCTION 1.1 Introduction After the Second World War ended around the 1945, manufacturing technology had achieved their third stage of evolution which is automation technology era. This technology was proposed in order to replace manual labor and human operator control with automated operations and control. The objective of this emerged technology is to have a faster, more reliable, more accurate, more flexible and less expensive manufacturing processes. The production automation technology is divided into two interrelated categories which are manufacturing operation and automation. Manufacturing operation is concerning with the conversion of raw material into finished product where the final product will have a few subassemblies combined. Basic equipment for the manufacturing process is called Machine Tools. Machine Tools are the machine that capable of producing itself with the help of operator. These Machine Tools is performing two basic operations which are metal cutting and metal forming. Metal cutting involves removals of material to create the final shape but metal forming involves little or no loss of material in creating the final shape. Kinn Engineering Works is one of the factories that produce machine located at Taman Perindustrian Merdeka, Melaka. The main product of this company is produce machine according to their customer needs and customization. So, it is very important for them to really understand their customer want. Once they received an 2 order, they will draw the machine according to the customer needs and setup the raw material needed. After that, their mechanical engineer will draft it using the Solidworks Drawing. From the drawing, their workers will perform the operation needed. The main thing that they need to do first is cutting the raw material according to the drawing. Usually, the plate that they used is mild steel or stainless steel plate. With the manual process, each worker has to understand and know how to read the drawing by their own to do the cutting process. This cutting process includes turning (using lathe), milling, grinding, drilling and also shaping. This project will emphasize on the plate cutting by convert the Solidworks drawing into the interchange format file (.dxf) and read by the system that will be developed before being understand by the motor that will be used to control the cutter. 1.2 Background of the Problem Business is really emphasized on financing. By the manual system that the company has, every worker had to really understand on how to read the Solidworks drawing that have been produced by their mechanical engineer. The problem will arise if there are new worker in the factory. Their management has to put on training on him how to read the drawing. This really needs time and money. This is because of the ability to understand is based on everybody intellectual. The later they understand, the more money and time needed. Other problem arise if there is new worker is, waste of product defect. What happen if the new worker is actually not really understand how to read the drawing? Of course, they will make mistake on their work. Since there is a mistake, means there is money and time wasted. Other alternative that the company can use is using the automation technology where the programming language is the Programmable Logic Control (PLC) to cut the plate. But, the limitation of PLC as already known is, it will limit 3 the cutting. It cannot cut all type of shape wanted. Yet, using PLC the flexibility of production is reduced where if there are changes in the product design, they need to reprogram the code which has been coded before. Therefore, they made a decision to use computer as the alternative whereby, they can use the automation technology to cut the plate instead of human labor and the flexibility of product can be maintained by using the Soildworks. In reflect of this, this project is proposed to help the organization solve their problem. The idea is on converting the Solidworks drawing into the neutral file DXF and read by the system. Then, using the motion control card, the cutter will communicate with the computer to cut the plate as the drawing. This is based on the motor used to control the cutter. 1.3 Statement of the Problem Result from the current framework of cutting operation that they have shows that the organization does not have a proper framework for its cutting operation and value added for the organization. Therefore, a framework for the operation is needed to help them monitor their performance and a system to help them organize the process better. Developing a framework and a system for the operation will help the production to answer these several question: 1.4 i. How to automate the cutting operation? ii. What are the processes needed to execute the cutting operation? Project Objectives Development of this project is purposely to achieve some solutions of the current problem. The purposes of the project are: i. To develop a system that will automate the plate cutting operation ii. To develop a framework of automated plate cutting operation 4 1.5 Project Scope The project is guided with some constraints and boundaries. The scopes of the project are as follows: i. The Solidworks drawing used is in 2D format drawing ii. This project will use DXF file which have converted from the Solidworks drawing as their input to the system iii. Because of cost limitation, this project is not being tested on real time application, but it wills just visualizing the automated cutting operation. CHAPTER 2 LITERATURE REVIEW 2.1 Introduction Automation technology is proposed to replace manual labor and human operator control with automated operations and control. This will make manufacturing processes faster, more reliable, more accurate, more flexible and less expensive. This project will visualize the automated plate cutting operation performed by plasma cutter. In the real time application, they will cut the plate using the plasma cutter that being controlled by motor. This motor used is based on the precision of the product that wants to produce. Data and information visualization is becoming an increasingly important tool in scientific research. This is being driven by the increasing use of computational simulations and digital data acquisition in research, and by the broadening spectrum of media available for the presentation of research results. Visualization is a method of computing. It transforms the symbolic into the geometric, enabling researchers to observe their simulations and computations. Visualization offers a method for seeing the unseen. It enriches the process of scientific discovery and fosters profound and unexpected insights. In many fields it is already revolutionizing the way scientists do science. Visualization embraces both image understanding and image synthesis. That is, visualization is a tool both for interpreting image data fed into a computer, and for generating images from complex multi-dimensional datasets. It studies those mechanisms in humans and computers 6 which allow them in concert to perceive use and communicate visual allow them in concert to perceive use and communicate visual information. The goal of visualization is to leverage existing scientific methods by providing new scientific insight through visual methods. An estimated 50 percent of the brain's neurons are associated with vision. Visualization in scientific computing aims to put that neurological machinery to work. 2.2 Background of Solidworks Soldworks is a very powerful Computer Aided Design (CAD) program which allows for rapid and accurate development 3-Dimensional mechanical models. Coupled with powerful 2-Dimensional blueprinting tools, this combination provides for reproducible and efficient CAD/CAM solutions for today's Engineering industry. After producing a model using Solidworks, designers can test the design (using Cosmos) by Finite Element Analysis (FEA) before anything is physically built. Once a design is finalized, the Solidwork's model could be easily converted into a Parasolid file for machining or molding. Solidworks files also work seamlessly with AutoCAD, Catia, and Pro/E files / documents as well. Below is the example of Solidworks screenshot. Figure 2.1 Solidworks Screenshot SolidWorks is a powerful 3D modeling program. The models it produces can be used in a number of ways to simulate the behavior of a real part or assembly as 7 well as checking the basic geometry. One of the advantages of using Solidworks is the ability to reuse objects. Solidworks let the user to draw an object using the assembly format. Then, whenever they need to draw another object that may need any part that already have, so it can be reused again. This helps the user to minimize their time spending a lot. Figure 2.2 shows an example of this advantage. Steps on how to create a 2D drawing using Solidworks will be shown in Appendix A. Figure 2.2 2.3 Reusable of Parts About Plasma Cutting In simplest terms, plasma cutting is a process that uses a high velocity jet of ionized gas that is delivered from a constricting orifice. The high velocity ionized gas, that is, the plasma, conducts electricity from the torch of the plasma cutter to the work piece. The plasma heats the work piece, melting the material. The high velocity stream of ionized gas mechanically blows the molten metal away, severing the material. Plasma cutting can be performed on any type of conductive metal - mild steel, aluminum and stainless are some examples. With mild steel, operators will experience faster, thicker cuts than with alloys. 8 Oxyfuel cuts by burning, or oxidizing, the metal it is severing. It is therefore limited to steel and other ferrous metals which support the oxidizing process. Metals like aluminum and stainless steel form an oxide that inhibits further oxidization, making conventional oxyfuel cutting impossible. Plasma cutting, however, does not rely on oxidation to work, and thus it can cut aluminum, stainless and any other conductive material. While different gasses can be used for plasma cutting, most people today use compressed air for the plasma gas. In most shops, compressed air is readily available, and thus plasma does not require fuel gas and compressed oxygen for operation. Plasma cutting is typically easier for the novice to master, and on thinner materials, plasma cutting is much faster than oxyfuel cutting. However, for heavy sections of steel (1 inch and greater), oxyfuel is still preferred since oxyfuel is typically faster and, for heavier plate applications, very high capacity power supplies are required for plasma cutting applications. Plasma cutting is ideal for cutting steel and non-ferrous material less than 1 inch thick. Oxyfuel cutting requires that the operator carefully control the cutting speed so as to maintain the oxidizing process. Plasma is more forgiving in this regard. Plasma cutting really shines in some niche applications, such as cutting expanded metal, something that is nearly impossible with oxyfuel. And, compared to mechanical mean of cutting, plasma cutting is typically much faster, and can easily make non-linear cuts. But yet, there is limitation for plasma cutting compared to oxyfuel. The plasma cutting machines are typically more expensive than oxyacetylene, and also, oxyacetylene does not require access to electrical power or compressed air which may make it a more convenient method for some users. Oxyfuel can cut thicker sections (>1 inch) of steel more quickly than plasma. 9 Figure 2.3 Example of tooling setup Figure 2.4 Example of Plasma Cutter 2.4 Automated Plate Cutting Operation (Real Time Application) In the real time application, after the Solidworks drawing is converted into DXF file and read by the system, it will being sent to the cutter to perform the application. It uses motor as the controller of the cutter. In this case, the cutter that being used is plasma cutter. The selection of cutter used is defined by the thickness of the product produced. If the range of the plate is 1mm – 10mm then the best cutter is plasma cutter. But if the range is between 10mm – 15 mm the best cutter is oxyplasma. The selection of the controller uses is defined by the precision of the product produced. There are several types of motor that can be used for this application such as servo motor, stepper motor, speed control motor, DC motor and the most 10 economic and least precise is the induction motor (AC). It is needed to install the I/O card and high speed counter card into the computer used to let the computer send the impulse to the motor as an input to start cutting the plate. Following is the example of high precise of edge cutting and less precise of edge cutting, tools setup and plasma cutter: Figure 2.5 Dross Free Plasma Cut Edge Figure 2.6 Plasma Cut Edge with Heavy Dross Formation 2.5 About DXF Neutral file is one of the format that being used by most of CAD system. There are many types of neutral files such as IGES, STEP, DXF and others. In this project, DXF file was chosen, this because of its compatibility to drawing field. DXF is representing as Data Exchange Format. It is a format for storing vector data in ASCII or binary files. It is used by AutoCAD and other CAD software for data interchange. DXF files are convertible to ARC/INFO coverage. It is needed to convert the Solidworks drawing to DXF file to let the C# read the drawing which had been drawn using Solidworks. 11 2.5.1 DXF File Format Information This chapter is describing about the DXF file format further. It has the technical information needed to let the system developed could read the DXF file format produced. DXF file is including 6 main sections which are Header, Classes, Tables, Blocks, entities and objects. Each of this section has their own role to make sure the system could read the DXF file. 2.5.2 DXF Group Codes This chapter describes the DXF group codes found in DXF files and encountered by AutoLISP and ARX applications. The first section provides general information about DXF group codes. It lists the group codes in numerical order and organizes them by object type. 2.5.2.1 Header The HEADER section of the DXF file contains settings of variables associated with the drawing. Each variable is specified in the header section by a 9 group giving the variable's name, followed by groups that supply the variable's value. Applications can retrieve the values of these variables with the getvar function. The following is an example of the HEADER section of a DXF file: Table 2.1 0 Variable in the HEADER Section Beginning of HEADER section SECTION 2 HEADER 9 Repeats for each header variable 12 $<variable> <group code> <value> 0 End of HEADER section ENDSEC 2.5.2.2 Classes The CLASSES section holds the information for application-defined classes whose instances appear in the BLOCKS, ENTITIES, and OBJECTS sections of the database. It is assumed that a class definition is permanently fixed in the class hierarchy and all fields are required. More information regarding this issue could be fine in the appendix B. The following is an example of the CLASSES section of a DXF file: 0 Table 2.2 CLASSES Section in DXF file Beginning of CLASSES section SECTION 2 CLASSES 0 CLASS 1 <class dxf record> 2 <class name> 3 <app name> 90 Repeats for each entry 13 <flag> 280 <flag> 281 <flag> 0 End of CLASSES section ENDSEC Each entry in the CLASSES section contains the groups described in the following table. Group Code Table 2.3 Description 0 Record type (CLASS). Identifies beginning of a CLASS record. 1 Class DXF record name. These should always be unique. 2 C++ class name. Used to bind with software that defines object CLASSES Section Group Codes class behavior. These are always unique. 3 Application name. Posted in Alert box when a class definition listed in this section is not currently loaded. 90 Proxy capabilities flag. Bit coded value that indicates the capabilities of this object as a proxy. 0 = No operations allowed (0) 1 = Erase allowed (0x1) 2 = Transform allowed (0x2) 4 = Color change allowed (0x4) 8 = Layer change allowed (0x8) 16 = Linetype change allowed (0x10) 32 = Linetype scale change allowed (0x20) 64 = Visibility change allowed (0x40) 127 = All operations except cloning allowed (0x7F) 128 = Cloning allowed (0x80) 255 = All operations allowed (0xFF) 32768 = R13 format proxy (0x8000) 280 Was-a-proxy flag. Set to 1 if class was not loaded when this DXF 14 file was created, and 0 otherwise. 281 Is-an-entity flag. Set to 1 if class was derived from the AcDbEntity class and can reside in the BLOCKS or ENTITIES section. If 0, instances may appear only in the OBJECTS section. AutoCAD registers the classes listed in the following table (note that this may not be a complete list of the classes found in a DXF file depending on the applications currently in use on your system). DXF Record Name Default Class Values Table 2.4 C++ Class Name Code 2 Code Code Code 1 Code 90 280 281 DICTIONARYVAR AcDbDictionaryVar 0 0 0 HATCH AcDbHatch 0 0 1 IDBUFFER AcDbIdBuffer 0 0 0 IMAGE AcDbRasterImage 127 0 1 IMAGEDEF AcDbRasterImageDef 0 0 0 IMAGEDEF_REACT AcDbRasterImageDefRe 1 0 0 OR actor LAYER_INDEX AcDbLayerIndex 0 0 0 LWPOLYLINE AcDbPolyline 0 0 1 OBJECT_PTR CAseDLPNTableRecord 1 0 0 OLE2FRAME AcDbOle2Frame 0 0 1 RASTERVARIABLE AcDbRasterVariables 0 0 0 SORTENTSTABLE AcDbSortentsTable 0 0 0 SPATIAL_INDEX AcDbSpatialIndex 0 0 0 SPATIAL_FILTER AcDbSpatialFilter 0 0 0 S 15 2.5.2.3 Tables The order of the tables may change, but the LTYPE table always precedes the LAYER table. Each table is introduced with a 0 group with the label TABLE. This is followed by a 2 group identifying the particular table (APPID, DIMSTYLE, LAYER, LTYPE, STYLE, UCS, VIEW, VPORT, or BLOCK_RECORD), a 5 group (a handle), a group 100 (AcDb Symbol Table subclass marker), and a 70 group that specifies the maximum number of table entries that may follow. Table names are output in uppercase characters. The DIMSTYLE handle is a 105 group not a 5 group. The tables in a drawing can contain deleted items, but these are not written to the DXF file. As a result, fewer table entries may follow the table header than are indicated by the 70 group, so do not use the count in the 70 group as an index to read in the table. This group is provided so that a program that reads DXF files can allocate an array large enough to hold all the table entries that follow. Following this header for each table are the table entries. Each table item consists of a 0 group identifying the item type (same as table name, such as LTYPE or LAYER), a 2 group giving the name of the table entry, a 70 group specifying flags relevant to the table entry (defined for each following table), and additional groups that give the value of the table entry. The end of each table is indicated by a 0 group with the value ENDTAB. The following is an example of the TABLES section of a DXF file. Table 2.5 0 TABLES Section of DXF file Beginning of TABLES section SECTION 2 TABLES 0 TABLE 2 <table type> 5 Common table group codes, repeats for each entry 16 <handle> 100 AcDbSymbolTable 70 <max. entries> 0 Table entry data, repeats, <table type> for each table record 5 <handle> 100 AcDbSymbolTableRecord . . <data> . 0 End of table ENDTAB End of TABLES section 0 ENDSEC Both symbol table records and symbol tables are database objects. At a very minimum, with all prevailing usage within AutoCAD, this implies that a handle is present, positioned after the 2 group codes for both the symbol table record objects and the symbol table objects. 2.5.2.4 Blocks The BLOCKS section of the DXF file contains all the block definitions. It contains the entities that make up the blocks used in the drawing, including anonymous blocks generated by the HATCH command and by associative dimensioning. The format of the entities in this section is identical to those in the 17 ENTITIES section. All entities in the BLOCKS section appear between block and endblk entities. Block and endblk entities appear only in the BLOCKS section. Block definitions are never nested (that is, no block or endblk entity ever appears within another block-endblk pair), although a block definition can contain an insert entity. External references are written in the DXF file as block definitions, except that they also include a string (group code 1) that specifies the path and file name of the external reference. The block table handle, along with any xdata and persistent reactors, appears in each block definition immediately following the BLOCK record, which contains all of the specific information that a block table record stores. Therefore, each block definition has the following sequence of records: The following is an example of the BLOCKS section of a DXF file: 0 Table 2.6 BLOCKS Section in DXF file Beginning of BLOCKS section SECTION 2 BLOCKS 0 BLOCK 5 <handle> 100 AcDbEntity 8 <layer> 100 AcDbBlockBegin 2 <block name> 70 <flag> 10 Begins each block entry (a block entity definition) 18 <X value> 20 <Y value> 30 <Z value> 3 <block name> 1 <xref path> 0 One entry for each entity definition within the block <entity type> . . <data> 0 ENDBLK End of each block entry (an endblk entity definition) 5 <handle> 100 AcDbBlockEnd 0 End of BLOCKS section ENDSEC 2.5.2.5 Entities The following table shows group codes that apply to all symbol table entries. Optional codes are shown in gray. When you refer to the table of group codes by entity type, which lists the codes associated with specific entities, keep in mind that the codes shown here can also be present. Group code -1 Table 2.7 Group Codes by Entities Description APP: entity name (changes each time a drawing is opened) 19 0 Entity type (table name) 5 Handle (all except DIMSTYLE) 105 Handle (DIMSTYLE table only) 102 Start of application defined group "{application_name". For example, "{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group application-defined Codes and values within the 102 groups are application- codes defined. 102 End of group, "}" 100 Subclass marker (AcDbSymbolTableRecord) The following table shows the group codes that are output if persistent reactors have been attached to an object. Group Table 2.8 Description ACAD_REACTORS Records code 102 "{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group 330 Soft pointer ID/handle to owner dictionary 102 End of group, "}" The following table shows the group codes that are output if an extension dictionary has been attached to an object. Group Table 2.9 Description ACAD_XDICTIONARY Records code 102 "{ACAD_XDICTIONARY" indicates the start of an extension dictionary group. 360 Hard-owner ID/handle to owner dictionary. 102 End of group, "}". 20 Common 70 group flag bit-coded values are described in the following tables. Additional 70 group values that apply to LAYER, STYLE, and VIEW table entries are described in those tables. Table 2.10 Bit- Group Flag bit-coded Values Description coded value 16 If set, table entry is externally dependent on an xref. 32 If this bit and bit 16 are both set, the externally dependent xref has been successfully resolved. 64 If set, the table entry was referenced by at least one entity in the drawing the last time the drawing was edited. (This flag is for the benefit of AutoCAD commands. It can be ignored by most programs that read DXF files and need not be set by programs that write DXF files.) 2.5.2.6 Objects Objects are similar to entities, except that they have no graphical or geometric meaning. All objects that are not entities or symbol table records or symbol tables are stored in this section. This section represents a homogeneous heap of objects with topological ordering of objects by ownership, such that the owners always appear before the objects they own. The following is an example of the OBJECTS section of a DXF file: Table 2.11 0 OBJECTS Section in DXF file Beginning of OBJECTS section SECTION 2 OBJECTS 0 Beginning of named object 21 DICTIONARY 5 dictionary (root dictionary object) <handle> 100 AcDbDictionary 3 Repeats for each entry <dictionary name> 350 <handle of child> 0 Groups of object data <object type> . . <data> 0 ENDSEC End of OBJECTS section CHAPTER 3 METHODOLOGY 3.1 Introduction Project is performed based on the planning that was planned before. This planning is important to make sure the project flow is going smooth and can be finished on time. There are two methodology involved in this project which are for developing the automated plate cutting system and for developing the framework of the automated plate cutting operation. Since the research for this topic is not really widened, the methodology used for this project is a project-based. 3.2 Methodology for Developing the Automated Plate Cutting System Following is the methodology used to develop the automated plate cutting system as shown in Figure 3.1 Methodology for Automation of Plate Cutting Operation . 23 Problem Definition and Formulation Data Collection System Developing & Visualization Validation & Testing Figure 3.1 3.2.1 Methodology for Automation of Plate Cutting Operation Problem Definition To formulate the problem occurred in the organization, the method used is discussion and interview with the System Manager, Mr. Goh Toh Hau. At this phase, the entire problem regarding this application will be defined then formulated. Besides, the objective, scope, technology used, hardware and software are defined in this stage also. Problem definition is important whereby it shows how important this project is to make as a research. At this time also, a list of title is proposed in order to choose the best topic to make as a project. 3.2.2 Data Collection Once the topic is chosen, then all the problem background is formulate. After the idea to overcome the problem occurred was defined, all the data needed to 24 perform the project is collect during the industrial visit. Since the organization is not implemented the machine yet, all the machine illusion is proposed during the industrial visit by their engineer. The mechanical part used like the cutter, motor and others is based on the specification set by the organization. All these ideas is just to use as education purpose only, not going to implemented at the organization. 3.2.3 System Developing and Visualization This is the phase where the interfaces and programming is coded to automate the operation. The programming language used for this developing process is C#. This is because of its compatibility and ease in the manufacturing application. This project also visualizes the cutting process using C# language. At this stage, all the information is collected as a reference to do the programming. 3.2.4 Validation and Testing The validation process for the first module (dxf reader) is performed by comparing the real drawing (in the format .dwg) with the drawing read by the dxf reader (the system). Since there is limitation in costing for this project, the testing phase will be done by visualization. It will visualize the automated plate cutting operation from it starts getting the input from the system until it finish cutting the plate either it’s performed as the drawing or not. The validation of the visualization process will be comparing with the real application video. But, comparing step cannot be done thoroughly because of field constraint. This phase will be repeated with the previous phase, whereby if there is still any mistake has in the system, developing process will be repeated. 25 3.3 Methodology of Plate Cutting Framework Development The methodology used for developing the framework is similar as the system at certain point. Following is the methodology defined to develop the framework of plate cutting operation: Problem Definition and Formulation Data Collection Process Verification Framework Development Framework Validation Figure 3.2 3.3.1 Methodology of Plate Cutting Framework Development Problem Definition As mentioned above, this first stage is similar like the methodology used to get the real problem happened in the organization which by interviewing and discussion. But, for the framework the problem formulation is actually forced by the problem to develop the automated system. Because, whenever to automate the application, there is no guidance to let others know how actually the process is could 26 be done. So, by developing a framework it will help others to refer to the step taken in order to perform application like this project. 3.3.2 Data Collection To develop the framework, all the processes involved in the automated cutting operation are collected during this phase whereby also during the industrial visit. All those processes is including the processes to perform the plasma cutting as manually and automated operation. For the automated operation it is as proposed by the Kinn Engineering Works’s system manager Mr. Goh Toh Hau. 3.3.3 Process Verification From all the processes collected, it will be verified the only needed process to perform this operation. This is the most important stage to develop the framework of the operation, because if the process chosen is wrong, then the framework is going wrong. This verification step is done theoretically not tested on real application. 3.3.4 Framework Development Since the needed process is defined, this is the stage where all the processes are being put in the right order to create a framework. This framework is developed based on project performed. It does not based on any testing performed before. This step is performed together with the previous step (processes verification) to let the framework developed in well organized. 27 3.3.5 Framework Validation Since this project is performed based on education purposed, the framework validation is just done by validate with the supervisor. There is no practically validation performed to ensure the precision of the framework. This is based on the logic of the framework. 3.4 Hardware Requirement The following is the minimum specification set to run this system: 3.5 i. Personal computer with the Pentium III processor ii. Random Access Memory (RAM) – 256 MB RAM. iii. 40 GB of hard disk. iv. Mouse v. Keyboard vi. Monitor screen vii. Graphic Card Software Requirement To run this system, the software specification needed is including programming language C# to develop the system, this including the animation of the cutter movement. Solidworks 2007 is using to draw the drawing to be the input for the system and will be convert to dxf to be the interchange format file. All the interfaces of the system is developed using .NET framework while .paint is used to hold the cutter image that being used in the animation. 28 3.6 Methodology Conclusion Overall project development is based on project-based. There are two main things that going to develop which are the system to automate the cutting process and the flow of the automation proposed. Since the project is developed for education purposed, all the methodology used is also simply driven from this project idea. CHAPTER 4 ANALYSIS AND SYSTEM DESIGN 4.1 Introduction This chapter will analyze all the elements involved in this project due to its implementation after this, these including the analysis about the organization, the real application and the process that will involve in the system that going to develop. 4.2 Real Time Application Analysis In the real time application, the plate cutting is performed manually (human labor to cut the plate), so there are several hardware involve in this project. This including electrical motor, cutter, plate, encoder and motion control card. The motor is used as a controller to the cutter. The type of motor used is based on the product precision and cost provided. For the animation of this project, the motor used is the induction motor which is the cheapest motor. This type of motor needs the encoder to communicate with the computer. Beside, it is needed to install the I/O card and the high speed counter card to the computer used in order to let them communicate. This project uses the plasma cutter as the cutter to cut the plate. This plasma cutter is using the combination of gas and oxygen before it’s burned. The high pressure of this combustion will used to cut the plate. Usually, the plate used is from the Mild Steel or Stainless Steel material. Figure 4.1 shows the example of plasma cutter. 30 Figure 4.1 4.3 Example of Plasma Cutter System Design Basically, this system involved two main modules which are dxf reader and animation. For the first modules, this system will read file in the dxf format where it has been saved in the hard disk. Once the system read the file, it will upload the drawing onto the canvas prepared. The next module will be performed in order to represent the real application (plate cutting). The user needs to press start button to start the application. Here, the system will animate the route path of the drawing as it is cutting the plate according to the drawing path (in the real application). This application design is as shown in the Figure 4.2 below. User Open Drawing File Figure 4.2 System Design Start Cutting 31 4.3.1 Input Design Input specification is about the data key in or imported by the user into the system using keyboard and mouse. For this system, the input key in by the user is the drawing that has been converted into dxf file. The first modul (dxf reader) will read the drawing and open it in the canvas provided. Below is the example of drawing in .dwg that has been converted into dxf file (which has been saved in text format). Figure 4.3 Example of .dwg drawing 32 0 SECTION 2 HEADER 9 $ACADVER 1 AC1015 9 $ACADMAINTVER 70 6 9 $DWGCODEPAGE 3 ANSI_1252 9 $INSBASE 10 0.0 20 0.0 30 0.0 9 $EXTMIN 10 0.0 20 0.0 30 0.0 9 $EXTMAX 10 Figure 4.4 Example of dxf file 4.3.2 Output Design Output design is the result produced after running some process using the input given by user. There are outputs that will be produced by this system which are the drawing produced by the dxf reader and also the animation route path produced by the animation module. Below is the example of output interfaces. 33 Figure 4.5 Figure 4.6 Output Drawing Interface Output Animation Interface 34 4.5 Framework Analysis The analysis for the framework is done after all the processes involved were collected and analyzed during the real time application analysis. At this stage, only the important processes are selected to put in the framework. This process is important to make sure the framework built is correct and efficient. But, for this project it will not implement the entire steps in the framework developed due to its constraint as told in the chapter 1 before. The framework is developed by doing a discussion with the system manager and also the employee involved. Below is the framework developed after the analysis process completed. Convert Solidworks Drawing into DXF Format file Definition of DXF file Send Impulse to motor Start Cutting Figure 4.7 Framework of Automated Plate Cutting Operation To automate the cutting process, it starts with converting the Solidworks drawing into DXF file format (this is done using the Solidworks converter have by the Solidworks software). After converting, it will be sent to the system to let the engine read and understands the DXF file (done by the dxf reader module in the system). Once it understood the format, it will send the impulse to the motor to tell the motor about the motion should be done by the cutter (this step is using the high 35 speed counter card installed in the computer to let it communicate with the motor). The final step is cutter starts the cutting process as being told by the motor. 4.6 Conclusion As a conclusion, this chapter is describing about system design like the interfaces, input and output specification and etc. Overall, the system design was developed interactively whereby if there is still any mistake or changes according to the user need. This chapter is important because it could give the idea on how certain system is developed. CHAPTER 5 IMPLEMENTATION AND TESTING 5.1 Introduction This chapter involved the system developing (coding activity) and testing. Every module in this project was being developed during this phase. After the system was developed, the testing stage is performed to ensure that the system running as planned before. Every single function is being tested with the given input. During project I phase, the input expected is in the format .dwg which is Solidworks drawing format. But, it was changed in the implementation phase whereby the input will be in the format of .dxf. It was converted using Solidworks before it is being sent to the system. Since there are 2 objectives of this project, there also have two developing and testing process conducted whereby another one is the framework of plate cutting operation implementation and testing. 5.2 System Development The implementation of this project is being done in C# and .NET framework environment. There are 2 modules defined in this project which are dxf reader and visualization module. For the dxf reader, this project covers line, rectangle, polyline, circle, and arc. It is not cover the freehand drawing. Next, for the visualization module, it is just representing the real application. In the real application, after the 37 system read the dxf, it will send all the coordinate of the drawing to the motor to perform the cutting process (transfer into bit that can be understands by the motor). But, by just visualizing the cutting process, it is performed based on the mathematical algorithm to read each type of shape of the input. There are 2 algorithms involved in this module which are Bersenhem algorithm and arc algorithm where the Bersenhem algorithm is used to read line and the arc algorithm is used to read arc and circle. 5.2.1 Interfaces Development This system use menus editor to control the system running. There are 2 main menu involved which are File and Help. For the File menu, it has 2 sub menu which is Open and Exit. Once the Open menu is clicked, it will pop up the directory to choose the file desired. This menu allows the system to read the dxf file format and display it on the canvas provided in the system. Once the dxf file format have been read and displayed on the canvas, there are another 4 generated menu in type of button displayed together on top of the drawing. It is play, pause, stop and show animated route. The play, pause and stop button is used to control the animation process and the show animated route is used to show or hide the route of the animation performed. Another sub menu under the file menu is Exit, where if the user clicks onto it, it will exit the system (close). The other side main menu is just form about the project. Below is the example of system interface developed. 38 Figure 5.1 Figure 5.2 Main Menu Drawing Displayed 39 Figure 5.3 5.2.2 Visualization of the Cutting Process System Programming C# is one of the most powerful language and very desirable to performed application that involved drawing like this project. It is object-oriented based where it helps the developer in saving their developing time. Besides, using C# it has the built in function to read shape. So, it makes the programming became easier. Below is the part of function used for the dxf reader module. 40 using using using using System; System.Collections; System.Drawing; System.Drawing.Drawing2D; namespace DXFImporter { #region Shape class - abstract public abstract class Shape { protected Color contourColor; protected Color fillColor; protected int lineWidth; public int shapeIdentifier; public int rotation; public bool highlighted; public abstract Color AccessContourColor { get; set; } public abstract Color AccessFillColor { get; set; } public abstract int AccessLineWidth { get; set; } public abstract int AccessRotation { get; Figure 5.4 Dxf Reader Module As similar as dxf reader module, the animation module is also developed using C#. The cutter (supposed to be plasma cutter) is saved in the format .png and the animation of cutting process is done on the canvas. All the interfaces including cutter, canvas, menus and etc is design using the .NET framework and being called using C#. Below is the example code to perform the animation module. 41 using using using using using using System; System.Collections; System.Collections.Generic; System.Drawing; System.Drawing.Drawing2D; DXFImporter.Properties; namespace DXFImporter { #region Amry: CutterAnimationToolkit class /// <summary> /// Helper class containing methods related to the cutter image animation process. /// </summary> static class CutterAnimationToolkit { static Image cutterImage; public static IEnumerable<Point> EnumeratePointsInBresenhamLine(Point p1, { int deltax = Math.Abs(p2.X between the x's int deltay = Math.Abs(p2.Y between the y's int x = p1.X; // Start x off int y = p1.Y; // Start y off Point p2) p1.X); // The difference p1.Y); // The difference at the first pixel at the first pixel int xinc1; int xinc2; if (p2.X >= p1.X) // The x-values are increasing { xinc1 = 1; xinc2 = 1; } else // The x-values are decreasing { xinc1 = -1; xinc2 = -1; } int yinc1; int yinc2; if (p2.Y >= p1.Y) // The y-values are increasing { yinc1 = 1; yinc2 = 1; } else // The y-values are decreasing { yinc1 = -1; yinc2 = -1; Figure 5.5 Animation Module 42 5.3 System Testing System testing for this project is performed through both module, which are dxf reader module and animation module. For the dxf reader module, the validation is being looked on the ability of the system to read the input (.dxf file) and display the image as it was (in the .dwg drawing). This stage is really important because the correct input read will ensure the correct coordinate given to the cutter (in the real application). Below is the example of the input from its real drawing (.dwg Solidworks drawing) and after it was converted to .dxf and being read by the dxf reader in this system. Figure 5.6 Solidworks Drawing 43 Figure 5.7 System’s Drawing After the drawing go through the first testing phase successfully, it will being tested on the next testing stage which is the animation or visualization testing. Since the real application is still not being implemented, the testing phase is conducted by comparing the animation done either it is according to the drawing coordinate or not (the precision of the cutting process animation). This can be shown by the animated route path on the canvas. Since the second module is representing on the plate cutting process, so it is important to make sure every single coordinate is being sent correctly. For this part, the most critical section on implementation the system is develop the algorithm to read all types of shape given by the input. Besides, the validation also will be justified by the mechanical engineer at Kinn Engineering Works either it is similar to the real application or not, but of course it will have the field constraint. Figure 5.8 below will shows the animation performed by the system from the input given. 44 Figure 5.8 5.4 Cutting Process Testing Framework Development and Testing After all the processes needed were analyzed in the third stage, it will be put in the right order following to the step performed. Once the framework was ready, the validation will be performed by the project supervisor. Below is the framework developed and have been satisfied for this project (it is regarding to the real application). 45 Convert Solidworks Drawing into DXF Format file Definition of DXF file Send Impulse to motor Start Cutting Figure 5.9 5.5 Framework of Automated Plate Cutting Operation Conclusion Overall, this section is describing the implementing of the idea of this project. It starts with developing the interfaces, the programming and until the testing phase to ensure the idea of this project is delivered in a correct manner. CHAPTER 6 DISCUSSION AND CONCLUSION 6.1 Introduction This chapter is the last part of doing project, whereby it is going to discuss everything that going through during the project implementation time. It starts with setting the objective, scope, collecting data, set the methodology, developing system and the last one is testing. This chapter also covers the result of this project, their enhancement, maybe the weaknesses, suggestion and concludes all the chapters have. 6.2 Discussion At the first proposal, this project was proposed to develop a system using the Visual Basic 6 (VB6) based on the ease of using it. But, when it comes to the developing stage, the idea was changed to use C#, this regarding to the sources that could be referred to. Besides, C# also provides much more new tools and features that can be used for this project. During the project I also, the system is expected to have converter tools that can convert the Solidworks drawing to the dxf file (as in the initial finding chapter). But, when it comes to the developing stage again it had been changed. This is because, it is much better and easier to convert the .dwg drawing to the .dxf file using 47 the converter have by the Solidworks aoftware and make the dxf converted as the input to the system. Since there are few changes made in the developing stage, the output also a bit difference from the expectation. The output for this project is going to be, the framework of the automated plate cutting process, the interface of the system, the dxf that being read by the system, instead of dxf file that being generated (from the first proposal), and also the animation or visualization of the cutting process. Yet, since there is no converter function for this system, the validation process is also change, where the dxf file (which is the input) is no need to be validated by the MasterCAM software. 6.3 Project Advantages The advantages of this project are it could help to reduce the labor and product defect cost, this regarding to its objective to automate the cutting application. Besides, it also produced a framework that can be guidance to others who want to make the automated application like this. 6.4 Project Improvement The weakness of this project is due to the algorithm to read the coordinate (to animate). From the animation performed, it is lack of precise when it goes to the arc, and circle shape. This project also not covered the freehand drawing for both of their modules, dxf reader and the animation. 48 6.5 Suggestion In order to improve the system, it can improve the algorithm to read the freehand drawing for the dxf reader module. And for the animation module, the improvement can be done on the algorithm to get the precise coordinate on arc, circle and much better for the freehand drawing. From the education view, it is useful if the animation of the plate cutting process can be saved in the format of video or etc. So, other people could review or use it for any educational purpose later. 6.6 Conclusion As a conclusion, to do a project is it important to have a well prepared plan. From there we are going to know what exactly that we should find and work on. And it is good to have an expectation about the achievement (initial findings), because from there we will know either our expectation is really relevant or not to our project. But, the expectation is not supposed to be the same as the result that we going to get at the end. For this project the result is seems to achieve the objective even it have a bit changes made from its original idea and during the real implementation. 49 BIBLIOGRAPHY Anderson T. (2006). Visual Basic in Easy Steps (1st ed). Warwickshire U.K.: Microsoft Corporation. Bemis B. L. and Settles G. S. (1998). Visualization of Liquid Metal, Arc, and Jet Interactions in Plasma Cutting of Steel Sheet. 8th International Symposium on Flow Visualization. Mohd Azahary bin Abdul Aziz (2001). Terjemahan Imej TIFF kepadaFormat Fail DXF. Degree. Universiti Teknologi Malaysia, Skudai. Mohd Haziman bin Mohd Shah (2002). Terjemahan Imej TIFF kepadaFormat Fail DXF (Volume II). Degree. Universiti Teknologi Malaysia, Skudai. Richard P. and Fitzgerald J. (2006). Introduction to AutoCAD®:2006 A Modern Perspective.(1st ed). United States of America : Prentice Hall. Getting to know (and love) Solidworks Data : 20 April 2008 http://catalogimages.wiley.com/images/db/pdf/0764595555.excerpt.pdf How Plasma Cutter Works Data : 20 April 2008 http://science.howstuffworks.com/plasma-cutter.htm Introduction to Solidworks Data : 20 April 2008 http://www2.warwick.ac.uk/fac/sci/eng/euo/modules/year1/es174/studentreso urce/cae/swtut04a Plasma Cutting : Determining if it's Right for You and What to Look for in a Machine Data : 20 April 2008 http://www.lincolnelectric.com/knowledge/articles/content/plasma.asp What is Solidworks Data ( 20 April 2008) http://cadbright.com/Solidworks_Explained.htm APPENDIX A (Introduction to Solidworks) 51 Start SolidWorks Start SolidWorks by clicking on the SolidWorks icon in the opening window. Our network doesn’t let the program write files to the normal location the program expects, so when warning messages appear, cancel them or browse to your H: drive if asked for a file loation. Eventually, you’ll see the screen shown here, or something like it. If you get the ‘Novice User’ box just cancel it. There may be a ‘tips’ window too, it’s worth reading these as you get to know the software. Shut down the tips window for now. In SolidWorks we can build Parts, Assembies and Drawings. We’re going to start by creating a new part. Later we’ll build that into an assembly and then create an engineering drawing of the whole thing. 1. Click on File, move the cursor over New. 2. A dialog box appears, listing the types of document you can create. 3. Move the cursor and click on Part. Your screen should look something like that shown here now. The toolbars at the top of the screen may also be in slightly different positions to those shown but you can move these around if you wish. The screen colour may also be different but this too can be changed to your preference. I’ve labeled some of the important things on the screen but it’s important to realize that some of these will change depending on what you’re doing with the software. 52 Have a look at the Feature Manager that I’ve labeled. Notice that there are three tilted squares marked Front, Top and Right. You always get these Sketch Planes free at the start of each part. If you let your cursor move over them you’ll see red lines or a rectangle appear in the Graphics Area. Making the Crankshaft We’re going to start by creating the crankshaft shown here. This will be done by using the Extrude method to create cylinders for the shafts and the wedge shape for the web. Creating solids always starts with one or more Sketches which are a major part of SolidWorks. They’re usually 2 dimensional and are used in various ways to generate the 3 dimensional forms that make up a solid object. We’ll start with a sketch to create the wedge shaped ‘web’ that connects the shafts. 1. Click on Front in the Feature Manager window to select the Front Sketch Plane. A red rectangle in the graphics area should turn green with square dots. The Front sketch plane is now active – notice it’s highlighted in blue in the feature manager too. 2. Click on the Sketch icon , just above the feature manager. Notice that the modeling tool icons are now drawing tools like lines, arcs and rectangles etc. Press the Create Circle button . Move the cursor (now a pen shape) to the intersection of the two red arrows in the middle of the screen. You’ve got there when a red dot appears and the cursor gets an orange square beneath it. 3. Click the left mouse button and move the cursor upwards. A circle should now be ‘rubber-banding ‘, centered where you first pressed with radius to the cursor position. Notice the radius reading changing as you move. Make the circle about 3mm radius for now, you’ll adjust this to the precise size later. 53 4. Click the left mouse button to finish creating the circle which should go green. Double left click and it will go blue. Roll back the scroll wheel on the mouse to enlarge the view of the circle until the size of a 10 pence piece. Try moving the view around on screen by holding down the ctrl key while dragging with the scroll wheel pressed. If the circle goes elliptical you’ve probably let go of the ctrl key too early – recover the view using the Standard Views button then clicking Normal To . 5. Press the Centerline button . Hover the cursor over the centre of your circle and click when you get the red blob. Notice the symbol under the cursor change to an orange square; orange symbols mean that you’re at some kind of snap point. Move the cursor rightwards and a dashed line will stretch from the centre. The line should snap to horizontal (or vertical), as it gets close. Click when the line looks like the picture. 6. Now for another circle, this time about 14mm radius and with its centre on the centerline just drawn. You should be able to do this without much help, remember to watch for the spikey orange symbol when placing the centre on the centerline. Click when your circle looks something like the next picture. Remember that we can easily re-size things later on when we add the precise dimensions. 7. Next we’re going to create the straight edges to form the wedge shaped profile. Press the Create Line button . Move the cursor to somewhere near the upper left of the small circle, watch for the spikey orange symbol and left click. Move the cursor 54 beyond the top right of the large circle and click. Repeat this procedure to get an angled line at the bottom too, giving you something like the next picture. 8. Now we need to tidy up the outline ready for the extrusion process. ‘Hygienic’ geometry, joining precisely at the corners, without extra fragments of lines is the key to easy solid modeling. A little practice and you’ll soon get it right first time but be prepared for a bit of frustration at first. 9. The Trim tool is very useful for clipping off extra bits of lines or arcs. You’ll probably need to hunt for it as it’s off the default screen. Look for the ‘More Icons’ button, near the top right of the graphics area. This will show you what you’ve been missing. Click the trim tool and snip away the extra bits and pieces until you get something like the next drawing. 10. 11. You might notice that my sketch is a bit lumpy around the left hand circle. This is because I wasn’t very thorough with the trimming job. Zooming in ( click and stretch a box around the bit you want to enlarge), gave me the next view, showing the extra geometry. Trim one of these bits away so there’s no overlap. As you’ll see 55 in a moment, it doesn’t matter which bit we trim. Your geometry may be neater than mine and you may not need to do this. Zoom all, will show everything if you tried a close-up view. 12. Next we’ll add some geometric Relations to the sketch. We want the straight lines to be tangential to the small, left hand circle. Click on the Pointer Icon and click on the small left circle (what’s left of it), then hold the ctrl key while selecting one of the straight edges. These two clicks should turn the geometry green. At the left of the screen you should see the Property Manager window look something like the next picture. Notice the two Selected Entities, and look for the Tangent button near the bottom. Click this and the selected line and arc will jump to make them tangential. Repeat this with the other pair. 13. The final step is to set a few dimensions so the sketch precisely defines the shape wanted. Find and click the Smart Dimension button ; It’s toward the left of the horizontal toolbar above the graphics area. Let’s set the radius of the two arcs first. Hover the cursor over the left hand arc. When it goes red click the left button. Move the curser to the left and you should see an arrow with a text-box follow you. When this is in a sensible place, left click again and the dimension is added. Now double click on the number itself and you’ll get an edit box to change it to the right value 3mm radius for the left one. Repeat this with the right hand arc but make this 12.5mm radius. 56 14. Now for the distance between the two arc centres. With the dimension tool still selected, hover over the centre of the left hand arc and left click when a red blob appears. It should go green. Hover over the right hand arc’s centre and when the red blob appears here, press the left mouse button and drag upwards to see a linear dimension stretch from the centres. Release and click again when it’s in a sensible spot. Double click on the number to change it to the 12.5mm we want. 15. Angles next! Still using the dimension tool, click on the centre-line we drew near the beginning. It should go green. You’ll also have a blue dimension line following you that looks like the wrong thing. Simply click on one of the straight sloping lines and it’ll change to an angular measure. Drag the text box to a sensible spot and click again to fix it. Double click and edit both angles to 30 degrees. Hopefully you now have something like me. 16. At long last we’re ready to extrude this shape into a solid object. It doesn’t always take this long but I’ve introduced dimensioning and relations as well as a selection of sketching tools too. Find and click the Exit Sketch icon at the top right of the graphics area. Looking in the Feature Manager window you should now see Sketch1 at the bottom of the tree. Click on this to highlight it. Now click on the Features 57 on the left of the lower horizontal toolbar. That toolbar will now get the button solid modeling tools instead of sketch tools. Click on the Extruded Base/Boss button and your sketch should swing round to an Isometric orientation and acquire some thickness and a pale yellow tint. 17. The Feature Manager window shows the various parameters controlling the way the extrusion happened. In particular, look for the distance control , and the extrusion method. A Blind extrude means that it has a set thickness, starting from the sketch plane. Experiment with the Mid-Plane option if you like, but the others need other geometry defined before they’ll work. Click on the tick when you’ve set the distance to 3mm. and the yellow preview should turn grey – a solid part at last! 18. Try holding down the middle mouse button while moving the mouse and you’ll see the part rotate about three axes. Rolling the mouse wheel will zoom in and out. Holding the middle mouse button down with the ctrl key pressed will pan the view. A bit of practice and you’ll be able to get any view you wish. Adding the Shafts 1. This is going to be easy. All we need to do is draw a circle on the face of the bit we’ve just made and extrude it for the right distance. First make sure your cursor is the basic pointer – click on if not. Now click on one of the large flat faces of the crank web. It should go green like mine… 2. We could sketch a circle and then extrude it but I’ll describe a short- cut. Click on the Features icon and then on the Extruded Base/Boss button . You should now be in sketcher mode and the program knows you want to extrude with the sketch when finished. 3. We need to draw a circle at the centre of the large arc which is a bit tricky with the isometric view we have here. Luckily we can get a view normal to the face selected. 58 Find and press the Standard Views icon and then press the Normal To button from the drop down list. 4. Click on the Circle button and draw a circle about 4mm diameter, centered on the large arc. Click the tick to finish it. To make sure the circle really is concentric with the large arc we’re going to add another relation. Click on the pointer icon if the cursor is something different and then click on the large arc (which should go green), hold the ctrl key and click on the new circle which should also go green. The Property Manager should appear in the left hand pane with an entry for the green arc and circle. Click on the Concentric button in the property manager, click the tick and the circle becomes tied to the centre of the arc. 5. Use the dimension button to set the diameter of the circle to 4mm if you’ve not done this already. 6. Close the sketch with the Exit Sketch button , and you should see a pale yellow preview of the extrusion of the circle shown here. Remember we asked for an extrusion before starting sketching. Edit the distance value to be 63mm. and click on the green tick to finish off the main shaft. 7. Now for the crank pin. Create this by following steps 1 to 6 above but this time start the process on the opposite side of the web so the crank pin ‘grows’ in the opposite direction to the main shaft you just finished. Make the crank pin circle concentric with the small arc on the web and set its diameter to 3mm. Extrude it 10mm. from the face of the web. Look back at the finished part I showed at the start to see what you’re aiming at. Don’t forget to save your work. 8. Hopefully you’ve finished the crankshaft now. Congratulations! You’ve met quite a lot of SolidWorks techniques in just that one component so progress should get faster from now on. 59 Creating the Piston and Con-Rod The engine you’re building is called an Oscillating engine because the cylinder and piston oscillate as the crank goes round. As the cylinder swings back and forth it opens and closes ports letting steam into and out of the chamber. This makes the engine very simple which the next part shows well – the piston and connecting rod are just one piece unlike in most car engines where the connecting rod pivots at the piston connection. We’re going to make this part by revolving a profile around a centreline. 1. Start a new part using File>New>Part or clicking on the New Document button and clicking on Part. 2. Click on the Front sketch plane in the Feature Manager pane. 3. Click on the Revolved Base/Boss button and you should be taken into sketcher mode looking flat onto the front sketch plane. 4. Click the Centreline button and draw a horizontal centreline from the origin to about 50mm. rightwards. 5. 6. Click the Create Line button and draw the approximate shape shown here. We’ll set precise dimensions later but try to make the lines either vertical or horizontal or you’ll need to correct them later. (which is not a difficult task – simply drag the offending corner point.) Make sure that you draw a closed shape i.e. keep drawing back to where you started without any gaps in the chain. 7. Use the dimension tool to define the geometry as shown in the next diagram. 60 8. That’s finished all the sketching for the revolve so click on Exit Sketch and you should see the pale yellow preview which by default has a full 360 degree revolution. Click the green tick to get something like the next picture. 9. Next we’re going to cut a hole through the little end of the piston / con-rod for attachment to the crankshaft. Select the Front sketch plane which should go red and slice the piston through the middle. Click the Extruded Cut button Standard Views icon and then press the Normal To button and press the in the drop list. 10. Draw a centerline from the sketch origin, horizontally through the whole part. Now draw a circle, centered on this centerline, roughly in the middle of the smaller ‘end’ of the part. Dimension the sketch to look like the next picture. 11. 12. Exit the sketcher in the usual way and you should see the usual pale yellow preview of the hole. Unfortunately the default setting only takes the hole one way from the sketch plane. To fix this click the drop down arrow next to Blind in the property manager and then select Mid-Plane. The total distance of 10mm for this two sided 61 cut will be enough to go right through the part. Your preview should look like this one. If so, click the tick and the hole will be drilled. 13. Before you finish the piston, now’s a good time to play with filleting and chamfering. These are very simple operations that do exactly what they suggest to an edge. First manipulate your view of the piston / rod so you can see the bottom edge near the hole just drilled. Then hover the cursor over the bottom edge until it goes red. Notice that other things go red as the pointer hovers over them and try to tell the difference between the bottom face and the bottom edge. The pointer has to be exactly on the edge for it to be pre-highlighted in red and when it is, the red line appears stronger. Click when you’ve found the edge and it should go green. If the whole face turns dark green you’ve picked the face and need to try again. 14. Now press the Chamfer button on the features toolbar. Edit the values in the Property Manager as shown here and click on the green tick. You should now have a nice chamfer to blunt the bottom corner. 15. Use the same basic approach to create a fillet where the piston joins the slender connecting rod. Select the edge where they join, click the fillet button , edit the fillet radius value to 1mm in the property manager and click the green tick. This is how mine turned out…don’t forget to save yours. Create the Flywheel The flywheel will be created as another solid of revolution with holes punched through it to form gaps between the ‘spokes’. First let’s work on the basic Revolve. 1. Begin a new Part by clicking File>New>Part. Or using the New Document button and choosing part. 62 2. Click on the Front sketch plane in the Feature Manager pane. 3. Click on the Revolved Base/Boss button and you should be taken into sketcher mode looking flat onto the front sketch plane. 4. Now draw the shape shown here. As before, you can sketch roughly to start with and add precise dimensions later. Notice that the bottom of the shape is a little above the x – axis. We’ll also need a horizontal centreline through the origin but it doesn’t show up very clearly here. 5. It takes a while to get efficient with the sketch tools, with a little experimentation you should improve. They don’t show in the picture, but I’ve added Colinear relations between the pairs of broken horizontal lines in the sketch and between the two vertical segments on the left hand side. This saved me dimensioning each line separately but more importantly, the sketch now captures my design intent more clearly. 63 6. When you’re happy with the sketch, press the exit sketch button as before and you should see the pale yellow preview of the wheel. If yours looks like this, click the green tick. 7. Now for the holes between the ‘spokes’. First we’re going to drill one hole, then we’ll copy it in a circular pattern around the wheel. So far, the sketches we’ve used have been drawn on one of the basic sketch planes set up as the program starts. This time we’ll sketch a circle on one of the flat faces of the part itself. This is really easy, simply hover the pointer over a face and click. The face you need is shown in the next picture. 8. Now click the Extruded Cut button on the feature toolbar and you should be put into sketcher mode. You can probably arrange to view the sketch normal to the plane and sketch a circle without any more help now. I’ve drawn a vertical centreline through the origin to help place the hole precisely but it doesn’t show up very clearly here. Feel free to experiment with different size and position of hole if you wish. 64 9. Exit sketcher mode and change the distance setting on the property manager to Up To Next as shown here. Click the green tick and a neat hole should appear in the wheel’s disc. 10. All that’s left to do is copy this hole in a circular pattern around the rest of the wheel. To do this we’ll need an axis to tell the program how to position copies. For this you’ll need to explore the Insert menu. Notice the wide range of things we can create in addition to those on the toolbar. Select Insert>Reference Geometry>Axis and click. Now hover the cursor over one of the circular faces of the original wheel and click. The Property Manager pane will show that surface by name and you should see a yellow chain dotted line through the central axis of the wheel. Click the tick when you see this and you’ll see Axis1 appear at the bottom of the feature manager tree. All’s set for a circular pattern. 11. Hover the cursor over the inside, curved face of the hole you cut and click when you get the face itself rather than just the edge. This should have selected the hole feature – have a look in the feature manager and you should see Cut-Extrude1 highlighted. You could have selected it by simply clicking in the feature manager tree but I wanted to emphasise these two ways of selecting features. 12. Now find and click the Circular Pattern button on the features toolbar. The Property Manager pane should appear on the left with Cut-Extrude1 in the features to pattern box. The poorly named Parameters box should be highlighted in pink showing it’s ready to receive some info. This is where we need to enter the name of the rotation axis. Simply click on the axis and its name should appear. 65 13. You should now see a pale yellow copy of the hole outline displaced by 15 degrees from the original. Edit the numbers in the property manager boxes so that it looks like this…(my axis is axis3 not axis1) 14. You should now have a yellow preview showing the four extra holes equally spaced around the full 360 degrees. Experiment with other arrangements if you wish. Click the green tick when you’re finished. Mine looked like this…Make sure you save it carefully! Create the Cylinder The cylinder should be no trouble now. We’re going to build it entirely out of extrusions. 1. Start as usual with File>New>Part or use the new document button and select Part. 2. Click on the Front sketch plane in the feature manager and then click the Extrude Base/Boss button. This should take you into sketcher mode as usual. 66 3. 4. You may be getting confident enough with the sketch tools now to create the shape without more help. If so, carry on with your own approach. I created this sketch with a circle, centred at the origin with an overlapping rectangle plus two straight lines. I’m going to trim the spare bits later. Although I’m going to add precise dimensions later, it makes life easier if you start with the size about right – draw the circle with a radius of about 6mm. Oh, I also added horizontal and vertical centrelines from the origin to make construction and dimensioning easier. 5. The next picture shows the precise details after I’ve trimmed and dimensioned the rough starting sketch. Notice that I changed the redundant vertical line of the rectangle into construction geometry to help keep thing aligned. Click the green tick and set the properties up for a blind extrude of 45mm. 6. 67 7. Hopefully you have a solid now, ready to bore the internal hole. Select one of the end faces of the part, which should go green. Click the Extruded Cut button and sketch a circle with a diameter of 8mm. If you drew the previous sketch centred at the origin, you should find it easy to centre this circle there too. Either way, it’s a wise idea to set up a concentric relation between this new circle and the circular edge. When you’ve got this far exit the sketcher and set up a blind extrude of 40mm. When you click on the tick you should see that the hole doesn’t go all the way through! 8. We’re nearly finished, just need to add the pivot pin with another simple extrude. Select the large flat face and when it goes green click the Extruded Boss/Base button. All you need is a 3mm circle sketched as shown next. I first drew a centreline along the length of the face by snapping to the yellow mid-point markers which appear when you hover a drawing tool over a straight edge. This saved me adding an extra dimension and nicely captures my intention that the pin will always be on the centreline. Click the tick when you’ve got it looking right and save the finished part. Making the Frame Making the frame will demonstrate the use of the thin extrude feature where the program adds thickness to a line to create parts made from thin sheet material. 1. Start as usual with File>New>Part or use the new document button Part. and select 68 2. Click on the Front sketch plane in the feature manager and then click the Extrude Base/Boss button. This should take you into sketcher mode as usual. 3. Although this isn’t a very complex shape I’ll describe one way of forming it as we havn’t made much use of arc segments yet. Click the Line tool and draw one of the vertical legs starting at the top. Its size and position only need to be roughly right. Now click the Tangent Arc button and drag an arc from the bottom end of the vertical line until it looks about right. With the same Tangent Arc tool still active, click on the arc just drawn and drag the bigger, central arc to approximate size. Repeat with the second small arc and finish off with another straight vertical line. 4. You might need to add a tangency relation between the last vertical line and the arc it springs from if you don’t manage to finish that arc vertically. 5. I drew horizontal and vertical centrelines through the origin and dragged the large arc’s centre to the origin too. Then I added the various dimensions. Something else new here is the use of construction geometry, notice the horizontal line between the tops of the vertical lines. I drew this as a normal straight line to get the two verticals the same height but don’t want the line to form part of the solid. I used the Construction Geometry button ‘more buttons’ icon which you’ll probably have to look for with the at the top right of the toolbar. 69 6. Another way to create the shape would be to use the rectangle and circle tools and then trim the redundant bits of geometry. The small arcs could be formed with the fillet tool working on the sharp points where rectangle cuts circle (or what’s left of them). The top of the rectangle can be changed to construction geometry as described above. 7. When you have the finished geometry exit the sketch as usual and you should automatically get a thin extrusion in the preview. You’ll need to change the values in the property manager to those shown here and you’ll need to click to put the material’s thickness on the ‘inside’ of the shape. 8. Click the green tick when yours looks about the same. Now to finish off with some simple holes for the crankshaft and cylinder pivot to pass through. 9. Click on one of the flat outside faces of the extrusion so that it goes green. Click the Extruded Cut button and sketch a single circle dimensioned as in the next picture. 70 10. Exit the sketch and change the extrusion control in the property manager to Through All. The preview should show the cut forming a hole through both of the vertical walls of the frame. Click the tick to accept this. 11. For the next hole, the cylinder pivot hole, repeat step 9 above but this time sketch and dimension the hole as in the next picture. When the preview shows, adjust the extrusion control to give Up To Next which will drill through just the first wall. 12. Exit the sketch and click on the green tick and the frame’s done. Don’t forget to save it carefully. Assemble the bits Now for the fun of sticking our virtual components together to form a virtual assembly. 1. Start by selecting File>New>Assembly (note the difference) or use the new document button and select Assembly. A blank work area should appear and the Property Manager should be set up to insert a component. 2. Notice the Browse button in the Property Manager pane. Click this and browse to the file where you saved the Frame you’ve just finished. I hope you can remember what you called all the parts and where you saved them too! As you select the file, 71 you should see that part appear on screen. You can move it around if you wish but for this first part just click on the tick to confirm. We started with the frame as SolidWorks makes the first part in an assembly fixed in space. Although we can change this it makes sense for the frame to be fixed. 3. Next add a Crankshaft using the Insert Component button . When it appears on screen move it around a bit before confirming – I’ve noticed that unless you move them, added components can get fixed by mistake when using some advanced SolidWorks features. Hopefully you’ve now got a crankshaft on screen too, although it’s unlikely to be in the right spot. We’ll set up the Mate conditions to put that right next. 4. 5. Click on the flat face of the frame with two holes; it should go green. Hold ctrl and click on the flat face of the crankshaft web with the longer shaft; this too should go green. With these two faces selected and both green like mine in the picture, click on the Mate button and you should see the crankshaft swing around so the two selected faces are co-planar. So far, so good. But we really need a little clearance between the crankshaft and the frame if it’s going to run freely. Edit the Property Manager pane so there is an offset distance of 0.5mm between the two selected faces. Click the green tick twice to confirm this mate condition. 6. Click on the long shaft of the crankshaft; it should go green. Hold ctrl and click on the inside face of one of the holes for the crankshaft which too should go green (you may need to zoom in a bit ). With these two faces selected and both green, click on the Mate button again. Notice that SolidWorks makes a most-likely guess about how to mate the selected surfaces together. 72 7. If yours looks like the picture everything’s going well. Try dragging the crank-pin of the crankshaft (the small shaft) with the cursor and you should see it rotate. Save your work so far… 8. Adding the other parts is just as simple as the last step so you probably don’t need much more description of how to do it. Sometimes a part gets placed the opposite way round to your intention. If this happens you need to delete the faulty mate in the Feature Manager Tree and perhaps try adding another mate first that gets things in the correct orientation. You could also try moving the part with the Move or Rotate Component buttons , which gives the program a better chance to guess your intentions. 9. Add the remaining component parts to give the assembly shown next. You’ll see that I’ve set each part to have a different colour. To do this, select the part in the Feature Manager pane and then select its colour from the pallet . We’re over half way to completing the engine shown at the start, that will be in the next tutorial as well as a look at creating 2D engineering drawings. APPENDIX B (About DXF) 74 Dxf File Format The following table lists the variables that are saved in a DXF file. Variable $ACADMAINTVER Table 2.2 DFX System Variable Group code Description 70 Maintenance version number (should be ignored) $ACADVER 1 The AutoCAD drawing database version number: AC1006 = R10, AC1009 = R11 and R12, AC1012 = R13, AC1014 = R14 $ANGBASE 50 Angle 0 direction $ANGDIR 70 1 = clockwise angles, 0 = counterclockwise $ATTDIA 70 Attribute entry dialogs: 1 = on, 0 = off $ATTMODE 70 Attribute visibility: 0 = none, 1 = normal, 2 = all $ATTREQ 70 Attribute prompting during INSERT: 1 = on, 0 = off $AUNITS 70 Units format for angles $AUPREC 70 Units precision for angles $BLIPMODE 70 Blip mode on if nonzero $CECOLOR 62 Current entity color number: 0 = BYBLOCK, 256 = BYLAYER $CELTSCALE 40 Current entity linetype scale $CELTYPE 6 Entity linetype name, or BYBLOCK or BYLAYER $CHAMFERA 40 First chamfer distance $CHAMFERB 40 Second chamfer distance $CHAMFERC 40 Chamfer length 75 $CHAMFERD 40 Chamfer angle $CLAYER 8 Current layer name $CMLJUST 70 Current multiline justification: 0=Top,1=Middle, 2=Bottom $CMLSCALE 40 Current multiline scale $CMLSTYLE 2 Current multiline style name $COORDS 70 Coordinate display: 0 = static, 1 = continuous update, 2 = "d<a" format $DELOBJ 70 Controls object deletion: 0=deleted, 1=retained $DIMALT 70 Alternate unit dimensioning performed if nonzero $DIMALTD 70 Alternate unit decimal places $DIMALTF 40 Alternate unit scale factor $DIMALTTD 70 Number of decimal places for tolerance values of an alternate units dimension $DIMALTTZ 70 Controls suppression of zeros for alternate tolerance values: 0 = Suppresses zero feet and precisely zero inches 1 = Includes zero feet and precisely zero inches 2 = Includes zero feet and suppresses zero inches 3 = Includes zero inches and suppresses zero feet $DIMALTU 70 Units format for alternate units of all dimension style family members except angular: 1 = Scientific; 2 = Decimal; 3 = Engineering; 76 4 = Architectural (stacked); 5 = Fractional (stacked); 6 = Architectural; 7 = Fractional $DIMALTZ 70 Controls suppression of zeros for alternate unit dimension values: 0 = Suppresses zero feet and precisely zero inches 1 = Includes zero feet and precisely zero inches 2 = Includes zero feet and suppresses zero inches 3 = Includes zero inches and suppresses zero feet $DIMAPOST 1 Alternate dimensioning suffix $DIMASO 70 1 = create associative dimensioning, 0 = draw individual entities $DIMASZ 40 Dimensioning arrow size $DIMAUNIT 70 Angle format for angular dimensions: 0=Decimal degrees, 1=Degrees/minutes/seconds, 2=Gradians, 3=Radians, 4=Surveyor's units $DIMBLK 1 Arrow block name $DIMBLK1 1 First arrow block name $DIMBLK2 1 Second arrow block name $DIMCEN 40 Size of center mark/lines $DIMCLRD 70 Dimension line color: range is 0 = BYBLOCK, 256 = BYLAYER $DIMCLRE 70 Dimension extension line color: range is 0 = BYBLOCK, 256 = BYLAYER $DIMCLRT 70 Dimension text color: range is 0 = 77 BYBLOCK, 256 = BYLAYER $DIMDEC 70 Number of decimal places for the tolerance values of a primary units dimension $DIMDLE 40 Dimension line extension $DIMDLI 40 Dimension line increment $DIMEXE 40 Extension line extension $DIMEXO 40 Extension line offset $DIMFIT 70 Placement of text and arrowheads; Possible values: 0 through 3 $DIMGAP 40 Dimension line gap $DIMJUST 70 Horizontal dimension text position: 0=above dimension line and centerjustified between extension lines, 1=above dimension line and next to first extension line, 2=above dimension line and next to second extension line, 3=above and centerjustified to first extension line, 4=above and center-justified to second extension line $DIMLFAC 40 Linear measurements scale factor $DIMLIM 70 Dimension limits generated if nonzero $DIMPOST 1 General dimensioning suffix $DIMRND 40 Rounding value for dimension distances $DIMSAH 70 Use separate arrow blocks if nonzero $DIMSCALE 40 Overall dimensioning scale factor $DIMSD1 70 Suppression of first extension line: 0=not suppressed, 1=suppressed $DIMSD2 70 Suppression of second extension 78 line: 0=not suppressed, 1=suppressed $DIMSE1 70 First extension line suppressed if nonzero $DIMSE2 70 Second extension line suppressed if nonzero $DIMSHO 70 1 = Recompute dimensions while dragging, 0 = drag original image $DIMSOXD 70 Suppress outside-extensions dimension lines if nonzero $DIMSTYLE 2 Dimension style name $DIMTAD 70 Text above dimension line if nonzero $DIMTDEC 70 Number of decimal places to display the tolerance values $DIMTFAC 40 Dimension tolerance display scale factor $DIMTIH 70 Text inside horizontal if nonzero $DIMTIX 70 Force text inside extensions if nonzero $DIMTM 40 Minus tolerance $DIMTOFL 70 If text outside extensions, force line extensions between extensions if nonzero $DIMTOH 70 Text outside horizontal if nonzero $DIMTOL 70 Dimension tolerances generated if nonzero $DIMTOLJ 70 Vertical justification for tolerance values: 0=Top, 1=Middle, 2=Bottom $DIMTP 40 Plus tolerance 79 $DIMTSZ 40 Dimensioning tick size: 0 = no ticks $DIMTVP 40 Text vertical position $DIMTXSTY 7 Dimension text style $DIMTXT 40 Dimensioning text height $DIMTZIN 70 Controls suppression of zeros for tolerance values: 0 = Suppresses zero feet and precisely zero inches 1 = Includes zero feet and precisely zero inches 2 = Includes zero feet and suppresses zero inches 3 = Includes zero inches and suppresses zero feet $DIMUNIT 70 Units format for all dimension style family members except angular: 1 = Scientific; 2 = Decimal; 3 = Engineering; 4 = Architectural (stacked); 5 = Fractional (stacked); 6 = Architectural; 7 = Fractional $DIMUPT 70 Cursor functionality for user positioned text: 0=controls only the dimension line location, 1=controls the text position as well as the dimension line location $DIMZIN 70 Controls suppression of zeros for primary unit values: 0 = Suppresses zero feet and precisely zero inches 1 = Includes zero feet and precisely zero inches 2 = Includes zero feet and 80 suppresses zero inches 3 = Includes zero inches and suppresses zero feet $DISPSILH 70 Controls the display of silhouette curves of body objects in wire-frame mode: 0=Off, 1=On $DRAGMODE 70 0 = off, 1 = on, 2 = auto $DWGCODEPAGE 3 Drawing code page; Set to the system code page when a new drawing is created, but not otherwise maintained by AutoCAD $ELEVATION 40 Current elevation set by ELEV command $EXTMAX 10, 20, 30 X, Y, and Z drawing extents upperright corner (in WCS) $EXTMIN 10, 20, 30 X, Y, and Z drawing extents lowerleft corner (in WCS) $FILLETRAD 40 Fillet radius $FILLMODE 70 Fill mode on if nonzero $HANDLING 70 Next available handle $HANDSEED 5 Next available handle $INSBASE 10, 20, 30 Insertion base set by BASE command (in WCS) $LIMCHECK 70 Nonzero if limits checking is on $LIMMAX 10, 20 XY drawing limits upper-right corner (in WCS) $LIMMIN 10, 20 XY drawing limits lower-left corner (in WCS) $LTSCALE 40 Global linetype scale $LUNITS 70 Units format for coordinates and 81 distances $LUPREC 70 Units precision for coordinates and distances $MAXACTVP 70 Sets maximum number of viewports to be regenerated $MEASUREMENT 70 Sets drawing units. 0=English; 1=Metric $MENU 1 Name of menu file $MIRRTEXT 70 Mirror text if nonzero $ORTHOMODE 70 Ortho mode on if nonzero $OSMODE 70 Running object snap modes $PDMODE 70 Point display mode $PDSIZE 40 Point display size $PELEVATION 40 Current paper space elevation $PEXTMAX 10, 20, 30 Maximum X, Y, and Z extents for paper space $PEXTMIN 10, 20, 30 Minimum X, Y, and Z extents for paper space $PICKSTYLE 70 Controls group selection and associative hatch selection: 0=No group selection or associative hatch selection, 1=Group selection, 2 =Associative hatch selection, 3 =Group selection and associative hatch selection $PINSBASE 10, 20, 30 Paper space insertion base point $PLIMCHECK 70 Limits checking in paper space when nonzero $PLIMMAX 10, 20 Maximum X and Y limits in paper space $PLIMMIN 10, 20 Minimum X and Y limits in paper space 82 $PLINEGEN 70 Governs the generation of linetype patterns around the vertices of a 2D polyline: 1 = linetype is generated in a continuous pattern around vertices of the polyline, 0 = each segment of the polyline starts and ends with a dash $PLINEWID 40 Default polyline width $PROXYGRAPHICS 70 Controls the saving of proxy object images $PSLTSCALE 70 Controls paper space linetype scaling: 1 = no special linetype scaling 0 = viewport scaling governs linetype scaling $PUCSNAME 2 Current paper space UCS name $PUCSORG 10, 20, 30 Current paper space UCS origin $PUCSXDIR 10, 20, 30 Current paper space UCS X axis $PUCSYDIR 10, 20, 30 Current paper space UCS Y axis $QTEXTMODE 70 Quick text mode on if nonzero $REGENMODE 70 REGENAUTO mode on if nonzero $SHADEDGE 70 0 = faces shaded, edges not highlighted 1 = faces shaded, edges highlighted in black 2 = faces not filled, edges in entity color 3 = faces in entity color, edges in black $SHADEDIF 70 Percent ambient/diffuse light, range 1-100, default 70 $SKETCHINC 40 Sketch record increment 83 $SKPOLY 70 0 = sketch lines, 1 = sketch polylines $SPLFRAME 70 Spline control polygon display: 1 = on, 0 = of $SPLINESEGS 70 Number of line segments per spline patch $SPLINETYPE 70 Spline curve type for PEDIT Spline $SURFTAB1 70 Number of mesh tabulations in first direction $SURFTAB2 70 Number of mesh tabulations in second direction $SURFTYPE 70 Surface type for PEDIT Smooth $SURFU 70 Surface density (for PEDIT Smooth) in M direction $SURFV 70 Surface density (for PEDIT Smooth) in N direction $TDCREATE 40 Date/time of drawing creation $TDINDWG 40 Cumulative editing time for this drawing $TDUPDATE 40 Date/time of last drawing update $TDUSRTIMER 40 User elapsed timer $TEXTSIZE 40 Default text height $TEXTSTYLE 7 Current text style name $THICKNESS 40 Current thickness set by ELEV command $TILEMODE 70 1 for previous release compatibility mode, 0 otherwise $TRACEWID 40 Default trace width $TREEDEPTH 70 Specifies the maximum depth of the spatial index. $UCSNAME 2 Name of current UCS $UCSORG 10, 20, 30 Origin of current UCS (in WCS) $UCSXDIR 10, 20, 30 Direction of current UCS's X axis (in WCS) 84 $UCSYDIR 10, 20, 30 Direction of current UCS's Y axis (in WCS) $UNITMODE 70 Low bit set = display fractions, feetand-inches, and surveyor's angles in input format $USERI1 - 5 70 Five integer variables intended for use by third-party developers $USERR1 - 5 40 Five real variables intended for use by third-party developers $USRTIMER 70 0 = timer off, 1 = timer on $VISRETAIN 70 0 = don't retain xref-dependent visibility settings, 1 = retain xref-dependent visibility settings $WORLDVIEW 70 1 = set UCS to WCS during DVIEW/VPOINT, 0 = don't change UCS The following header variables existed prior to AutoCAD Release 11 but now have independent settings for each active viewport. DXFIN honors these variables when read from DXF files, but if a VPORT symbol table with *ACTIVE entries is present (as is true for any DXF file produced by Release 11 or higher), the values in the VPORT table entries override the values of these header variables. Variable Table2.3 Revised VPORT Header Variables Group code Description $FASTZOOM 70 Fast zoom enabled if nonzero $GRIDMODE 70 Grid mode on if nonzero $GRIDUNIT 10, 20 Grid X and Y spacing $SNAPANG 50 Snap grid rotation angle $SNAPBASE 10, 20 Snap/grid base point (in UCS) $SNAPISOPAIR 70 Isometric plane: 0 = left, 1 = top, 2 = right $SNAPMODE 70 Snap mode on if nonzero $SNAPSTYLE 70 Snap style: 0 = standard, 1 = isometric $SNAPUNIT 10, 20 Snap grid X and Y spacing 85 $VIEWCTR 10, 20 XY center of current view on screen $VIEWDIR 10, 20, 30 Viewing direction (direction from target in WCS) $VIEWSIZE 40 Height of view The date/time variables ($TDCREATE and $TDUPDATE) are output as real numbers in the following format: <Julian date>.<Fraction> The elapsed time variables ($TDINDWG and $TDUSRTIMER) have a similar format: <number of days>.<Fraction> The date and time variables are described in the Command Reference Tables The order of the tables may change, but the LTYPE table always precedes the LAYER table. Each table is introduced with a 0 group with the label TABLE. This is followed by a 2 group identifying the particular table (APPID, DIMSTYLE, LAYER, LTYPE, STYLE, UCS, VIEW, VPORT, or BLOCK_RECORD), a 5 group (a handle), a group 100 (AcDb Symbol Table subclass marker), and a 70 group that specifies the maximum number of table entries that may follow. Table names are output in uppercase characters. The DIMSTYLE handle is a 105 group not a 5 group. The tables in a drawing can contain deleted items, but these are not written to the DXF file. As a result, fewer table entries may follow the table header than are indicated by the 70 group, so do not use the count in the 70 group as an index to read in the table. This group is provided so that a program that reads DXF files can allocate an array large enough to hold all the table entries that follow. Following this header for each table are the table entries. Each table item consists of a 0 group identifying the item type (same as table name, such as LTYPE or LAYER), a 2 group giving the name of the table entry, a 70 group specifying flags relevant to the table entry (defined for each following table), and additional groups 86 that give the value of the table entry. The end of each table is indicated by a 0 group with the value ENDTAB. The following is an example of the TABLES section of a DXF file. Table 2.7 0 TABLES Section of DXF file Beginning of TABLES section SECTION 2 TABLES 0 TABLE Common table group codes, repeats for each entry 2 <table type> 5 <handle> 100 AcDbSymbolTable 70 <max. entries> 0 <table type> Table entry data, repeats, for each table record 5 <handle> 100 AcDbSymbolTableRecord . . <data> . 0 ENDTAB End of table 87 0 End of TABLES section ENDSEC Both symbol table records and symbol tables are database objects. At a very minimum, with all prevailing usage within AutoCAD, this implies that a handle is present, positioned after the 2 group codes for both the symbol table record objects and the symbol table objects. The DIMSTYLE table is the only record type in the system with a handle code of 105 because of its earlier usage of group code 5. As a rule, programmers should not be concerned about this exception unless it is in the context of the DIMSTYLE table section. This is the only context in which this exception should occur. The following group codes apply to DIMSTYLE symbol table entries. Group Codes Table 2.8 Description 100 Subclass marker (AcDbDimStyleTableRecord) 2 Dimension style name 70 Standard flag values (See "Common Group Codes for Symbol Table Entries.") 3 DIMPOST 4 DIMAPOST 5 DIMBLK 6 DIMBLK1 7 DIMBLK2 40 DIMSCALE 41 DIMASZ 42 DIMEXO 43 DIMDLI 44 DIMEXE 45 DIMRND 46 DIMDLE 47 DIMTP 48 DIMTM DIMSTYLE Group Codes 88 140 DIMTXT 141 DIMCEN 142 DIMTSZ 143 DIMALTF 144 DIMLFAC 145 DIMTVP 146 DIMTFAC 147 DIMGAP 71 DIMTOL 72 DIMLIM 73 DIMTIH 74 DIMTOH 75 DIMSE1 76 DIMSE2 77 DIMTAD 78 DIMZIN 170 DIMALT 171 DIMALTD 172 DIMTOFL 173 DIMSAH 174 DIMTIX 175 DIMSOXD 176 DIMDLRD 177 DIMCLRE 178 DIMCLRT 270 DIMUNIT 271 DIMDEC 272 DIMTDEC 273 DIMALTU 274 DIMALTTD 340 Handle of referenced STYLE object (used instead of storing DIMTXSTY value) 275 DIMAUNIT 89 280 DIMJUST 281 DIMSD1 282 DIMSD2 283 DIMTOLJ 284 DIMTZIN 285 DIMALTZ 286 DIMALTTZ 287 DIMFIT 288 DIMUPT The following group codes apply to LAYER symbol table entries. Table 2.9 Group Codes Apply to LAYER Symbol Table Entries Group codes Description 100 Subclass marker (AcDbSymbolTableRecord) 2 Layer name 70 Standard flags. (See "Common Group Codes for Symbol Table Entries.") In addition to the standard flags, the following values apply to layers (bit-coded values) 1 = Layer is frozen, otherwise layer is thawed 2 = Layer is frozen by default in new viewports 4 = Layer is locked 62 Color number (if negative, layer is Off) 6 Linetype name Xref-dependent layers are output during DXFOUT. For these layers, the associated linetype name in the DXF file is always CONTINUOUS. The following group codes apply to LTYPE symbol table entries. Table 2.10 Group codes Description LTYPE Symbol Table Entries 100 Subclass marker (AcDbLinetypeTableRecord) 2 Linetype name. 70 Standard flags. (See "Common Group Codes for Symbol Table 90 Entries.") 3 Descriptive text for linetype. 72 Alignment code; value is always 65, the ASCII code for A. 73 The number of linetype elements. 40 Total pattern length. 49 Dash, dot or space length (one entry per element). 74 Complex linetype element type (one per element). Default is 0 (no embedded shape/text). The following codes are bit values: 1 = if set, code 50 specifies an absolute rotation, if not set, code 50 specifies a relative rotation; 2 = embedded element is a text string; 4 = embedded element is a shape 75 Shape number (one per element) if code 74 specifies an embeded shape. If code 74 specifies an embeded text string, this value is set to 0. If code 74 is set to 0, code 75 is omitted. 340 Pointer to STYLE object (one per element if code 74 > 0) 46 S= scale value (optional). Multiple entries can exist. 50 R= (relative) or A= (absolute) rotation value in radians of embedded shape or text. One per element if code 74 specifies an embeded shape or text string. 44 X= x offset value (optional). Multiple entries can exist. 45 Y= y offset value (optional). Multiple entries can exist. 9 Text string (one per element if code 74 = 2) The group codes 74, 75, 340, 46, 50, 44, 45, and 9 are not returned by the tblsearch or tblnext functions. It must use tblobjname to retrieve these values within an application. The following group codes apply to STYLE symbol table entries. Table 2.11 Group codes Description STYLE Symbol Table Entries 100 Subclass marker (AcDbTextStyleTableRecord) 2 Style name 91 70 Standard flag values (bit-coded values) (See "Common Group Codes for Symbol Table Entries.") 1=if set, this entry describes a shape 4=Vertical text 40 Fixed text height; 0 if not fixed 41 Width factor 50 Oblique angle 71 Text generation flags 2=Text is backward (mirrored in X) 4=Text is upside down (mirrored in Y) 42 Last height used 3 Primary font file name 4 Bigfont file name; blank if none A STYLE table item is also used to record shape file LOAD command requests. In this case the first bit (1) is set in the 70 group flags and only the 3 group (shape file name) is meaningful (all the other groups are output, however). The following group codes apply to UCS symbol table entries. Table 2.12 Group codes Description UCS Symbol Table Entries 100 Subclass marker (AcDbUCSTableRecord) 2 UCS name 70 Standard flag values (See "Common Group Codes for Symbol Table Entries.") 10 Origin (in WCS). DXF: X value; APP: 3D point 20, 30 DXF: Y and Z values of origin (in WCS) 11 X-axis direction (in WCS). DXF: X value; APP: 3D vector 21, 31 DXF: Y and Z values of X-axis direction (in WCS) 12 Y-axis direction (in WCS). DXF: X value; APP: 3D vector 22, 32 DXF: Y and Z values of Y-axis direction (in WCS) The following group codes apply to VIEW symbol table entries. 92 Table 2.13 Group codes Description VIEW Symbol Table Entries 100 Subclass marker (AcDbViewTableRecord) 2 Name of view 70 Standard flag values (bit-coded values) (See "Common Group Codes for Symbol Table Entries.") 1 = if set, this is a paper space view 40 View height (in DCS) 10 View center point (in DCS). DXF: X value; APP: 2D point 20 DXF: Y value of view center point (in DCS) 41 View width (in DCS) 11 View direction from target (in WCS) DXF: X value; APP: 3D vector 21, 31 DXF: Y and Z values of view direction from target (in WCS) 12 Target point (in WCS). DXF: X value; APP: 3D point 22, 32 DXF: Y and Z values of target point (in WCS) 42 Lens length 43 Front clipping plane (offset from target point) 44 Back clipping plane (offset from target point) 50 Twist angle 71 View mode (see VIEWMODE system variable) The following group codes apply to VPORT symbol table entries. Group Codes Table 2.14 Description VPORT Symbol Table Entries 100 Subclass marker (AcDbViewportTableRecord) 2 Viewport name 70 Standard flag values (See "Common Group Codes for Symbol Table Entries.") 10 Lower-left corner of viewport. DXF: X value; APP: 2D point 20 DXF: Y value of lower-left corner of viewport 93 11 Upper-right corner of viewport DXF: X value; APP: 2D point 21 DXF: Y value of upper-right corner of viewport 12 View center point (in DCS). DXF: X value; APP: 2D point 22 DXF: Y value of view center point (in DCS) 13 Snap base point. DXF: X value; APP: 2D point 23 DXF: Y value of snap base point 14 Snap spacing X and Y. DXF: X value; APP: 2D point 24 DXF: Y value of snap spacing X and Y 15 Grid spacing X and Y. DXF: X value; APP: 2D point 25 DXF: Y value of grid spacing X and Y 16 View direction from target point (in WCS) DXF: X value; APP: 3D point 26, 36 DXF: Y and Z values of view direction from target point (in WCS) 17 View target point (in WCS). DXF: X value; APP: 3D point 27, 37 DXF: Y and Z values of view target point (in WCS) 40 View height 41 Viewport aspect ratio 42 Lens length 43 Front clipping plane (offset from target point) 44 Back clipping plane (offset from target point) 50 Snap rotation angle 51 View twist angle 68 APP: Status field (never saved in DXF) 69 APP: ID (never saved in DXF) 71 View mode (see VIEWMODE system variable) 72 Circle zoom percent 73 Fast zoom setting 74 UCSICON setting 75 Snap on/off 94 76 Grid on/off 77 Snap style 78 Snap isopair The VPORT table is unique: it may contain several entries with the same name (indicating a multiple-viewport configuration). The entries corresponding to the active viewport configuration all have the name *ACTIVE. The first such entry describes the current viewport. APPENDIX C (Gantt Chart Project I and II)