Variable legend referencing a library table

Hello

I have 6 symbol boxes I would like to populate on a legend with rock type symbols specific to my project (variable legend entity). The problem is that my project rock description table fields for different borings do not directly lookup from the material graphics symbols, so I don't know what to enter into the "Field with Data" box of the variable legend entity.. 

Some info about my template:

  • Field with rock types for my boring:  <<STRATIGRAPHY.Rock_Name>> - with required lookup from the Libtbl!rock type
  • Library table (Rock Type) has these fields:  Name, MatlSymbol, and Description
  • MatlSymbol in the library table has the names of the symbols I have defined in the Material tab of Symbol design (USGS types)
  • For example BASALT in library table calls USGS 717 from the Material symbol library

Because the rock description table field I have set to look up from a library table, I don't think the variable legend function will work for me, or will it.

If it won't work, how can I code my template so I can make six boxes on my key, pick the six most common rock types that are entered into the table.

Still experimenting - will delete this if I get it to work.

Thanks.

  • I tried making a User System Data expression as follows:  <<Lookup(<<ROCK TYPE.MatlSymbol>>,<<ROCK TYPE.Name>> = <<STRATIGRAPHY.Rock_Name>>)>>

    And then putting the name of that USD into the "Field with Data" field in the Variable Legend Entity, but that did not work.

  • I am not able to test any of these ideas right now but here are some approaches you might consider trying.

    1. Add a field to your data structure in the stratigraphy table that is for symbolID or some other name. This field can be hidden so users will not see it. Then write a simple gINT rule that looks up your Rock_Name field and populates the symbolID field with th correct symbol. The rule can be set tu run on table exit so it is completely transparent to the user. Your variable legend can then function normally by referencing the symbolID field.

    2. Create your 6 legend blocks as stand alone rectangles. You can then use an SQL command to extract the relavant rock names into a list,  extract the first item from that list and look it up in your rock type table. This result would be used to specify the fill type in the rectangle. Copy the box 6 times and set the getlistitem to the 2nd, 3rd, 4th,etc item in the list. You would have to add a similar text item next to the box to display the description. Finally you would have to add entire entity output criteria so they dont print if there are not 6 items in the list.

    3. A really dirty hack would be to copy all the relevant rock symbols in your library and save them with the name of your rock type. You would only need to do the ones in your rock type table. This would leave two identical patterns in your library, one named with the usgs number and one named with the your rock type name. You could then use the variable legend command like normal using the rock type without breaking any of the rest of your logs. Yes it is not efficient to have two identical patterns with different names but honestly the average user will never notice. This has the advantage of not changing your data structure and avoids some messy SQL.

    Just some thoughts, when I have a chance I may try some of them out. There are probably many other ways to do this.