tpm_anaoverlay

AutoCAD Map 3D AutoLISP

Up a level
tpm_anaoverlay
 
 

Overlays two topologies.

(tpm_anaoverlay overlay_id overlay_data source_id source_data oper var_id [obj_table] [obj_tabledesc] [result_name] [result_desc])

Returns T or nil.

overlay_id Overlay topology ID (real) of topology 1. Must be a polygon topology.
overlay_data Overlay data expression composed of AutoCAD Map expressions and output object data columns or nil. See the Overlay Data Expressions section below.
source_id Source topology ID (real) of topology 2. Must be a polygon topology.
source_data Overlay data expression composed of AutoCAD Map expressions and output object data columns or nil. See the Overlay Data Expressions section below.
oper Overlay operation (integer). See the Overlay Operations table below.
var_id ID of topology variables for building the result topology (real).
obj_table Name of the new object data table that will contain the final data (created by the function). Cannot be an existing table.
obj_tabledesc Object data table description.
result_name Result topology name (string). Omit if function results produces AutoCAD objects instead of a topology.
result_desc Result topology description (string).

The source topology must be of polygon type for union and paste operations. For all other operations, it can be of any topology type, such as node, network, and polygon.

The topology variables ID references a set of topology variables.

Overlay Data Expressions

The overlay_data and source_data arguments are overlay data expressions. They have the following format:

(list (list expr1 colname1 coldesc1 coltype1)
(list expr2 . . .)
. . .)

Overlay Data Expression Arguments

expr1 AutoCAD Map expression (string).
col_name1 Object data column name (string).
col_desc1 Object data column description (string).
col_type1 Object data column type (integer): 1 through 4, where 1 = integer, 2 = real, 3 = character, and 4 = point.
Overlay Operations
1 Intersect
2 Union
3 Identity
4 Erase
5 Clip
6 Paste

Result Topology

If the result_name argument is omitted or nil, the result is a collection of AutoCAD objects. Otherwise, it is a new topology that is loaded but not open.

You must specify the list of data values to come from each input topology and the specific data for each.

Additionally, you must specify the name of the result object data table in the objTable parameter to contain the final data. If you do not specify a result table, no data is attached to the resulting topology elements. The function creates this table. If the result table you specify already exists, the function returns an error and cancels the overlay process.

Data derived by the overlay process is also attached to the result object data table. This data is written for each topology element in the resulting topology. It is written for each polygon if the source is a polygon topology, for each link if it is a network topology, or for each node if it is a node topology. The table always includes the following fields:

Field Names in Result Object Data Table
TOPO_ID Element ID of the new element in the result topology
T1_ID Element ID of the parent polygon in the overlay topology
T1_PERCENTAREA Area of the new polygon in the result topology compared to the area of the parent polygon in the overlay topology. Written only if both overlay and result are polygon topologies
T2_ID Element ID of parent element in the source topology. The parent element can be a node, link, or polygon.
T2_PERCENTAREA Area of the new polygon in the resulting topology compared to the area of the parent polygon in the source topology. Written only if both source and result are polygon topologies

The result table includes these fields along with the fields that you specify in the arguments you supply for the overlay_data and source_data parameters. Each field name is prefixed with T1_ or T2_ to indicate which topology its data comes from.

For example, if you specify FIELD1, FIELD2 and FIELD3 from table SOIL for the first topology and FIELD1, FIELD4 and FIELD5 from table WATER for the second, the result table has the following fields:

T1_SOIL_FIELD1
T1_SOIL_FIELD2
T1_SOIL_FIELD3
T1_WATER_FIELD1
T1_WATER_FIELD4
T1_WATER_FIELD5

The following code overlays two topologies. The names t1 and list1 refer to the overlay topology.

(setq t1 (tpm_acopen "top1"))  ; a polygon topology
(setq t2 (tpm_acopen "top2"))
(setq v (tpm_varalloc))
(setq list1
   (list (list ".LAYER" "OVERLAY_LAYER" "" 3))) 
(setq list2
   (list (list ".LAYER" "SOURCE_LAYER" "" 3))) 
(tpm_anaoverlay t1
   list1 
   t2 
   list2 
   1 
   v 
   "OVERLAY_TABLE" 
   nil 
   "OVERLAY_TOPO") 
   ; Result_desc argument omitted