Sunday, November 16, 2014

Symbol Tables

Symbol Tables


There are symbol tables in AutoCAD. Through AutoLISP you have access to the symbol tables. You can get information from them.


But that is not possible. There are no functions for changing the information of the symbol tables. You can only get information from them.


Types Of Symbol Tables


The following types of information tables are available:


- Line types
- Layers
- Text styles
- Views
- User Coordinate System
- Viewport Configuration
- Blocks


Two functions are available for getting information from the symbol tables:


Functions
Use




TBLNEXT
Scanning the symbol tables
TBLSEARCH
Searching in the symbol tables


TBLNEXT


(tblnext <table name> <start>)


The first argument gives the name of the symbol table. These names are valid:


- LTYPE
- LAYER
- STYLE
- VIEW
- UCS
- VPORT
- BLOCK


When the TBLNEXT function is used all the time, then the next symbol is displayed. The function works with its own pointer.


When the START argument is present and it is true or T, then the function all the time starts at the beginning of the table.


If the START argument is not present or it has got a value of nil, then all symbols are displayed. At the end the function gives back nil.


The result of the TBLNEXT function is a dotted pair list, very much like the entity list from an entity.


Example:


(tblnext "layer" T)


may give:


(
(0 . "layer") - symbol type
(2 . "0") - symbol name
(70 . 0) - flags
(62 . 7) - color number
(6 . "continuous") - name line type
)


(tblnext "block")


(
(0 . "block") - symbol type
(2 . "cadre") - symbol name
(70 . 0) - flags
(12 . 100.0 100.0 0.0) - insertion point
(-2 . <Entity name: 40000136) - first entity block
)


When dealing with a block, then you find the -2 group in the definition. In the example we have the block with the name CADRE.


TBLSEARCH


(tblsearch <table name> <symbol> <follow>)


The function searches in the table name for the symbol with the name. If the symbol is found, then a dotted pair is given back.


Example:


There is searched for a text style with the name STANDARD. This is how it is done and this is what can be given back.


(tblsearch "style" "standard")


This can be given back:


(
(0 . "STYLE") - symbol type
(2 . "STANDARD") - symbol name
(70 . 0) - flags
(40 . O.O) - text height
(41 . 1.0) - width factor
(60 . 0.0) - angle
(71 . 0) - gewwnerate flags
(3 . "TXT") - font file
(4 . "") - big font file
)


Here is another example. Now there is searched for the the block with the name VALVE in the BLOCK symbol table.


(tblsearch "block" "valve")


This is given back:


(
(0 . "BLOCK")
(330 . <Entity name: 36dafb0>)
(67 . 0)
(8 . "0")
(62 . 256)
(6 . "ByLayer")
(370 . -1)
(347 . <Entity name: 0>)
(284 . 0)
(48 . 1.00000)
(60 . 0)
(70 . 0)
(10 0.000000 0.000000 0.000000)
(-2 . <Entity name: 372c048>)
(2 . "valve")
(1 . "")
(4 . "")
(280 . 1)
(281 . 0)
)


The TBLSEARCH function also works with a pointer. But the pointer is not of influence of the pointer from the TBLNEXT function. Unless it it T.




















Saturday, November 1, 2014

Symbol Tables

Symbol Tables


There are symbol tables in AutoCAD. Through AutoLISP you have access to the symbol tables. You can get information from them.


But that is not possible. There are no functions for changing the information of the symbol tables. You can only get information from them.


Types Of Symbol Tables


The following types of information tables are available:


- Line types
- Layers
- Text styles
- Views
- User Coordinate System
- Viewport Configuration
- Blocks


Two functions are available for getting information from the symbol tables:


Functions
Use




TBLNEXT
Scanning the symbol tables
TBLSEARCH
Searching in the symbol tables


TBLNEXT


(tblnext <table name> <start>)


The first argument gives the name of the symbol table. These names are valid:


- LTYPE
- LAYER
- STYLE
- VIEW
- UCS
- VPORT
- BLOCK


When the TBLNEXT function is used all the time, then the next symbol is displayed. The function works with its own pointer.


When the START argument is present and it is true or T, then the function all the time starts at the beginning of the table.


If the START argument is not present or it has got a value of nil, then all symbols are displayed. At the end the function gives back nil.


The result of the TBLNEXT function is a dotted pair list, very much like the entity list from an entity.


Example:


(tblnext "layer" T)


may give:


(
(0 . "layer") - symbol type
(2 . "0") - symbol name
(70 . 0) - flags
(62 . 7) - color number
(6 . "continuous") - name line type
)


(tblnext "block")


(
(0 . "block") - symbol type
(2 . "cadre") - symbol name
(70 . 0) - flags
(12 . 100.0 100.0 0.0) - insertion point
(-2 . <Entity name: 40000136) - first entity block
)


When dealing with a block, then you find the -2 group in the definition. In the example we have the block with the name CADRE.


TBLSEARCH


(tblsearch <table name> <symbol> <follow>)


The function searches in the table name for the symbol with the name. If the symbol is found, then a dotted pair is given back.


Example:


There is searched for a text style with the name STANDARD. This is how it is done and this is what can be given back.


(tblsearch "style" "standard")


This can be given back:


(
(0 . "STYLE") - symbol type
(2 . "STANDARD") - symbol name
(70 . 0) - flags
(40 . O.O) - text height
(41 . 1.0) - width factor
(60 . 0.0) - angle
(71 . 0) - gewwnerate flags
(3 . "TXT") - font file
(4 . "") - big font file
)


Here is another example. Now there is searched for the the block with the name VALVE in the BLOCK symbol table.


(tblsearch "block" "valve")


This is given back:


(
(0 . "BLOCK")
(330 . <Entity name: 36dafb0>)
(67 . 0)
(8 . "0")
(62 . 256)
(6 . "ByLayer")
(370 . -1)
(347 . <Entity name: 0>)
(284 . 0)
(48 . 1.00000)
(60 . 0)
(70 . 0)
(10 0.000000 0.000000 0.000000)
(-2 . <Entity name: 372c048>)
(2 . "valve")
(1 . "")
(4 . "")
(280 . 1)
(281 . 0)
)


The TBLSEARCH function also works with a pointer. But the pointer is not of influence of the pointer from the TBLNEXT function. Unless it it T.