Maptek Vulcan bcf Scripts, Printfiles and Headers | Mining University

Maptek Vulcan bcf Scripts, Printfiles and Headers

I learned some very interesting things about bcf scripts in Maptek Vulcan today. It isn't the first time something like this has happened to me but I always find it amusing when I learn something important in the process of telling someone that Vulcan can't do something.

Block calculation file (bcf) scripts in Vulcan perform a series of logic calculations on specified blocks in a block model. In general these scripts are used to populate variables like net value or populate variables that meet certain criteria like ore/waste blocks. The bcf scripts are used after the block estimation file (bef) has been used to populate grade variables.

In this instance, we wanted to flag blocks that met certain criteria and then populate the block above with new values. My first thought was to create a list of the blocks meeting the criteria, add the block height to the centroid z value and use this as the new criteria in a second script. In order to accomplish this I needed the script to output a list of blocks. I was in the middle of saying that 'No, bcf scripts don't have the ability to export data,' when I noticed Appendix E - Script File Format.

To locate Appendix E open the Vulcan help and go to the 'Contents' tab. Expand the branches 'Envisage 3D Editor' and 'Core Appendixes' (because a branch titled just 'Appendices' would be just stupid. I mean, why would someone look through the list of alphabetized topics and want appendices to be listed with the A's?). Appendix E tells us several interesting things about the bcf scripts including the fact that it can export data to an external file (or the screen) and that there is the ability to write a header to the script that is only run once (instead of each time a block is examined).

The following lines of code are the test I wrote to determine if I could write the centroid coordinates of specific blocks to an external file. By opening the text file in write mode in the header I effectively delete the previous text file so that I am not appending to it each time I run the script. The header also writes a title line to the output text file so that my resulting data has a header.

begin_inittest = "test.txt"open(test,"new")fileprint(test,"x_coordinate y_coordinate z_coordinate \n")end_init

new_x = xworldnew_y = yworldnew_z = zworld

if (new_z eq 2225) thenfileprint(test,"%f %f %f \n",new_x, new_y, new_z)endif

I had to set the x/y/zworld variables to new variables in order for the script to work. I don't know why this is. I would have expected to just be able to use x/y/zworld as the print variables but that was not my experience.

For more information on writing bcf scripts please see Appendix E in your Maptek Vulcan help as well as Appendix B - Operators/Functions.

No comments:

Post a Comment