%QUERYDIGINFO - Example

Stepping through an array using %querydiginfo

 

%INITDIGINFO=gdh

%ASKDIGINFO=nret,Numdig=pick entities lines and arcs=[gdh],[#ENTITYDIG],1;2

*

%IF [nret]<>[#finish] %goto=list

 

* numdig returns the number of entities digitised plus a Finish

%calc=entities=[numdig]-1

%if [entities]=0

  * No entities where selected by the %ASHDIGINFO directive

  %messagebox=the user finished without selecting any entities

  %goto=List

%endif

 

 

* set default values

%CALC=COUNTER=0

%calc=$type=Not set

 

 

* Loop through the digitise buffer and display the entity system variables

%label=start

%QUERYDIGINFO=nret=[gdh],[counter]

%if [&etype]=1

  %calc=$type=LINE

  %MessageBox=Entity Information\\Array number [COUNTER] Entity [$TYPE]\Entity No. [&entno]\Xstart [&xstart] Xend [&xend]\Ystart [&ystart] Yend [&yend]\Zstart [&zstart] Zend [&zend]

%endif

%if [&etype]=2

  %calc=$type=ARC

  %MessageBox=Entity Information\\Array number [COUNTER] Entity [$TYPE]\Entity No. [&entno]\Xstart [&xstart] Xend [&xend]\Ystart [&ystart] Yend [&yend]\Zstart [&zstart] Zend [&zend]\Radius [&RADIUS]\Xcentre [&xcentre] Ycentre [&ycentre]

%endif

 

 
%calc=counter=[counter]+1

%if [counter]<[entities] %goto=start

 

 

%label=list

* nRet returns a value that can be tested to see if the user selected Finish, Abort or Escape

* to end the %ASKDIGINFO directive

%if [nret]=[#finish] %messagebox=the user finished the getdata with a finish

%if [nret]=[#abort] %messagebox=the user finished the getdata with an abort

%if [nret]=[#escape] %messagebox=the user finished the getdata with an escape

 

%FreeDigInfo=[gdh]