Friday, October 10, 2014

AutoCAD Database


AutoCAD has got a database. In it all entities are stored and the properties of all entities. With AutoLISP you can change the properties.


Later youi will see how that is done. For now let's talk about the AutoCAD database. The AutoCAD database consists of five parts:


- Header
- Tables
- Blocks
- Entities
- End of file


Header


Contains general information about the drawing such as the values of all the system variables.


Tables


This part contains information about:


- Line types
- Layers
- Text styles
- Views
- User Coordinate System
- Viewport configuration
- Drawing manager


Blocks


Here you find all information of the blocks that can be found in the drawing.


Entities


Here are all the information about the entities in the drawign, block references included.


End of file


Indication the the end of the file has been reached.


Entities


Examples of entities are:


- Line
- Circle
- Arc
- Polyline
- Text
- Solid
- Point


Let's be more specific. This is the information about a line that can be found in the AutoCAD database.


- Entity type: line
- Layer
- Color
- Start point of line
- End point of line
- Linetype


From other entities different information can be found. But that is important. You can change the information with AutoLISP.


AutoCAD Database Structure


When an entity is created in AutoCAD, it get a number. And example of such a number is:


<Entity name: 3774828>


The name doesn't say what type of entity it is. The entity could be a line, a circle, an arc, a polyline, or a text.


If you want tto learn more about the entity, then get the entity list. You get the entity list by using the ENTGET fucntion.


This is how the entity list may look:


((-1 . <Entity name: 3774828>) (0 . "LINE") (5 . "1C4") (67 . 0) (8 . "0") (62 . 256) (6 . "ByLayer") (370 . -1) (347 . <Entity name: 0>) (284 . 0) (48 . 1.00000) (60 . 0) (39 . 0.000000) (10 -25.1534 -3.89644 0.000000) (11 44.0428 28.5361 0.000000) (210 0.000000 0.000000 1.00000))


The entity list consists of part list. In each part list there is an index number. The index number tells what information there is.


This is the meaning of some of the index numbers:


Index
number
Description


-1
Entity name
0
Entity type
8
Layer
10
Start point
11
End point


You have access to the information with the entity functions and the selection set functions. You can delete entities with AutoLISP.


We were talking about AutoCAD. But IntelliCAD has got the same structure.


















No comments:

Post a Comment