- Cursor: RDC_PICK
- Flags: RDF_C
- Type: RD_Pick1
A pEntRec type is a very important type in writing XP's. The pEntRec type is the generic entity pointer that can point to any type of drawing entity. So, if you selected a circle with your RDATA call, pEntRec will point to the the circle entry within the "Drawing Database"
The "Drawing Database" is the collection of all the visible elements in the map. When we select elements, Campaign Cartographer returns a pointer to the selected element in the "Drawing Database".
Once you get a pointer to an entity, you can edit, interrogate or delete it.
Every entity shares some common data - appropriately named: CSTUFF
CStuff is defined as:
Code Snippet - CSTUFF
- typedef struct
- {
- int ERLen; // entity record length
- unsigned char EType; // entity type code
- char EFlags; // erase/select bits
- char EFlags2; // extra flags
- char EColor; // entity color
- char EColor2; // fill (2nd) color
- char EThick; // pen thickness 0..25.4 mm
- short WPlane; // workplane (0 = XY plane)
- short ELayer; // layer
- short ELStyle; // line style (0=solid)
- short GroupID; // group id (0 = not grouped)
- short EFStyle; // fill style (0=hollow)
- float LWidth; // line width
- int Tag; // entity tag id
- } CSTUFF;
For example you have a pEntRec named pENTREC and you want to get the entities color:
pENTREC->CStuff.EColor
No comments:
Post a Comment