Actions to run when selecting any code in a code table
I personally don't like black boxes, and Digi3D.NET hid one that it has inherited for backward compatibility with the early days of Digi on MS-DOS. Today it's time to change that. Did you know that the command COD not only changes code but also performs the following actions when you select a code:
- Change the value of the variable C to false.
- Change the value of the variable S to false.
- Changes the value of the variable GOTO_START to false.
- Change the value of the variable Orto to false;
- Change the value of the variable Orto_aa to false.
- Changes the value of the variable FIJA_Z to false.
- Change the value of the variable MAXPOINTS to 0.
- Changes the value of the variable AUTONUM_FORMAT to %d.
- Change the value of the variable TYPE_OF_Z to 2.
- Unlocks the Z of the photogrammetric window.
This is done by the command COD for hard code and there is no way to change it. If you wanted to change code but did not want to change any of these variables listed above, you either had to clone an existing entity or program yourself a command COD as explained in my programming course of Digi3D.NET On the other hand, some time ago we added to Digi3D.NET the possibility that it executes a series of commands by the mere fact of selecting a code. You can indicate the commands to be executed in the property Commands (select code) in the section Code properties of the tab Codes of the program Code Table Editor. This is great, it serves us for example to indicate that if the contour line code is selected, the search mode 12 is automatically selected, or that by the mere fact of selecting the point tree code, the command R_POINT is executed. What we did not have was the ability to indicate that a command is executed when selecting any code, so if we wanted to execute the command MODELO_SEMANTICO=1 when selecting any code, we could not, and we had no choice but to add that command to all the codes in our code table. To solve the two problems (remove from the command COD the logic that changes if or if the value of the variables C, S, GOTO_START, etc...) and make it possible to indicate a series of commands that will be executed when the user selects any code, we have added a new tab to the program Code table editor named Actions that will allow us to indicate a series of commands to execute when selecting a code, and by default all code tables will have filled this field with the following commands:
C=0
S=0
IR_PRINCIPIO=0
ORTO=0
ORTO_AA=0
FIJAZ=0
MAXPUNTOS=0
FORMATO_AUTONUM=%d
TIPO_DE_Z=2
BLOQUEA_Z=0
and we have removed from the command COD those actions that were executed if or if, so if you do not want to change the type of AUTONUM_FORMAT when changing code, just delete that line, or if you want to execute the command MODELO_SEMANTICO=1, just add that line. You can see this new feature in action in the video below: