VARKON Version 1.15 1997-10-24


gethdr - Procedure

Get header from GM


Description

Reads the header of a specific entity in GM. This routine is common to all entity types and is typically used to find out what type (point, line, curve, surface...) an entity with specific identity has or what level it belongs to etc.

Syntax

gethdr(id, type, version, blank, level, pen, groups)

REF id;
INT type;
INT version;
INT blank;
INT level;
INT pen;
REF groups(3);


Principal parameters

id - Global identity
type - Entity type code, see below or -1 if the entity does not exist
version - Version number
blank - 0 = Visible, 1 = Unvisible
level - Level number 0 <= level < 2000
pen - Pen or colour number
groups - An indexed variable to recieve 3 group membership identities.


Optional parameters

None.



Comments

Version numbers are implemented to make it possible for an application to recognize any future changes to the internal representation of an entity.

The following table lists all entity types and their type codes:

Entity type Code
Transformation 0
Point 1
Line 2
Arc 4
Curve 8
Surface 16
Text 32
Xhatch 64
Linear dimension 128
Circular dimension 256
Radius dimension 512
Angular dimension 1024
Mesh
2048
Group 4096
Coordinate system 8192
Part 16384
Bplane 32768


Any entity can be a member of 0, 1, 2 or maximum 3 different groups. The groups variable should be declared as an indexed REF with at least 3 elements. gethdr returns the first group id in element 1, the second group id in element 2 and the third group id in element 3 of the indexed variable. A group id = #0 in any of the elements returned indicates no membership. If all 3 elements returned are = #0 the entity is not member of any group at all.


VARKON Homepage Index