
0
Hatch Colors
Hi Group,
I am wondering if there is a way to upload colors from say a spreadsheet. I have some polyline geology that I can import with the attributes. There are a lot of geology units so if I can just upload a legend with the units and colors into MM that would be much better than making a legend from scratch.
Any help is appreciated.
Keith
I am wondering if there is a way to upload colors from say a spreadsheet. I have some polyline geology that I can import with the attributes. There are a lot of geology units so if I can just upload a legend with the units and colors into MM that would be much better than making a legend from scratch.
Any help is appreciated.
Keith
Customer support service by UserEcho
The easiest way to do this is by running the attached Python script. RGB-2-Hatch-Set.py
The script requires two files:
1. An input text file containing the following information in separate fields. (Tab delimited is best becase geological descriptions often contain commas, which throw off the column order if you use a comma delimited file.)
This defines your source data:
2. A Micromine data (.DAT) file with the following file structure.
Other fields may be present (and will be ignored) but you must include the listed fieldnames. This is the file that will be converted to a hatch set:
Here is how you use it. These instructions are also included at the top of the script, which may be viewed in the Micromine script editor or any text editor:
1. Save the script to your Micromine project (or somewhere convenient).
2. In Micromine, create a DATA file in your working project using the file structure described above.
3. Use File | Import | Text to import the tab-delimited version of the colours, codes, and descriptions into the new Micromine file.
4. Select Scripting | Open Script Editor from the main menu (or press F11), and then click the Load Existing Script button on the Script Editor toolbar to load the script into the script editor.
5. Change the filename on line 56 (the part between the quotes) to match the file you created in Step 3:
6. Change the form set name on line 57 (between the quotes) to suit your project data:
7. Click the Run Script toolbar button, or press F5, to run the script.
8. The new form set is now available via Tools | Hatch Sets | Text or the relevant Vizex display.
I've also included a file containing some sample codes and colours so you can see the script working. Imported-Geological-Colours.DAT
Regards,
Frank
There are really only two tricks to this process:
For example:
242 + (195 * 256) + ( 20 * 65526) = 1360882
You will, of course, have to use actual cell addresses for the [RED], [GREEN] and [BLUE] values. To make this easier I've set up the calculation on the RGB to Micromine tab of this Excel workbook: RGB-Hex-to-Micromine-Colours.xlsx
Once you've calculated the values for all of your colours, just select that entire column in Excel and copy the numbers. Then, in Micromine, click the colour heading row (the one with no label) and then press Ctrl+V to paste the colours, as shown here:
You can then do the same with the codes (Value) and their descriptions (Label).
To convert the colour set to a hatch set, just select Tools | Colour Sets | Convert to Hatch Set. You can then display the new hatch set in the hatch set editor and right-click a hatch to adjust its borders etc.
If you're importing colours from a Google Earth KML file into Excel you'll see the colours listed in hexadecimal character string format, along with an opacity value, in A-B-G-R order, where A = Alpha (opacity) and B, G, and R are the colours:
ff14c3f2
In this format, "ff" is the opacity, "14" is blue, "c3" is green, and "f2" is red.
(Be aware, other applications such as drawing software may list the colours in the opposite order. The opacity value is usually a pretty good indicator of which end is which because "ff" is pure white, which is not normally used for geological colours.)
You can easily use Excel to convert Google Earth hexadecimal ABGR colours to decimal, which you can then convert to a Micromine long integer using the preceding calculation. You'll need to use a few different Excel functions:
The calculations will look like this (remembering to use actual cell addresses). You'll find them on the HEX ABGR to Micromine tab of the attached workbook:
Frank
Frank,
I can't get a wildcard to work in the hatch set, is there something I'm missing?
Hi Geoff,
I suggest that you change your values for DIOR, LAMP, DYKE, and SY to all read *DIOR* and skip the "|" separators.
Erik