home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************/
- #include "std.h"
- #include "megatyp.h"
- #include "megacad.h"
- #define MAXPIDS 500
- /**********************************************************************/
- char edta[32000];// Puffer für variable Daten
- ulong pids[MAXPIDS]; // Platz für 500 Element ID's
- ushort pidnum; // Zähler für die Anzahl der Elemet ID's
- /**********************************************************************/
- short SelPid(
- void *argptr )
- {
- t_entity *ent;
-
- ent = argptr;
- pids[pidnum] = ent->id;
- pidnum++;
- if(pidnum == MAXPIDS)
- return(BREAK_LOOP);
- else
- return(CONTINUE_LOOP);
- }
- /**********************************************************************/
- short DoDraw(
- void *ptr )
- {
- DrawEntities(pids,pidnum);
- }
- /**********************************************************************/
- short main(
- char *filename,
- char *args )
- {
- t_entity ent;
-
- // Anzahl auf 0 vorinitialisieren
- pidnum = 0;
- SetFuncText("Farbe invertieren");
- MouseHelp("Element wählen","zurück",HLP_INV(0,0,0));
- // Selektionskriterium -> alle Elemente erlaubt
- // ( (1<<E_LINE) || (1<<E_POINT) ) selektiert nur Linien und Punkte
- SelectInit(0xffffffff);
- // Selektionsschleife bei jedem gefundenen Element wird SelPid aufgerufen
- // aber nicht die gesperrten Elemente
- SelectLoop(SelPid,&ent,edta,sizeof(edta),FALSE);
- // alle Elemente, deren ID jetzt in pids steht, invertieren
- Blink(DoDraw,NULL);
- return(0);
- }
- /**********************************************************************/
-