Thursday, July 28, 2005

GTViewer – More than a Viewer

Names have a funny way of becoming misleading, especially for software. In the beginning, GTViewer was a “Viewing” product and was aptly named. Now, however, GTViewer has grown and evolved beyond just being a viewer to include a variety of other capabilities, yet its name has not change to describe all of its talents. There are 4 different aspects to GTViewer:



Viewing is the foundation of GTViewer and from this aspect all of the others are possible. Viewing entails the graphical display of geospatially related graphics: Streets, buildings, conductors, mains, transformers, valves, terminals, etc. Viewing is in a seamless map environment that is easy to display what you want to see and easy to go where you need to go. Viewing GIS data is more than simply looking at maps; the database information behind the graphics is just as important and is readily available. Intelligent features are “smart” because of this tabular data and without access to it you are really not viewing GIS data.





Redlining goes hand in hand with Viewing; however, Redlining is a distinct aspect of GTViewer. Redlining allows a non-destructive mechanism for marking on top of your GIS data. Redlining includes more than just the basic drawing tools (lines, circles, shapes, text, etc.); more sophisticated tools are also available like dimensioning, symbols, and hyperlinks. Redlining is not just graphical either; you can add tabular data to your drawings and link them to other files such as photos or documents. Redlines also provide an easy method for GTViewer users to share information in a geospatial manner.




Analysis is a step above Viewing. Instead of just looking at the data as it comes from your GIS, GTViewer can help you analyze the data to see what it means. GTViewer provides two very power tools for analyzing data: Thematic Queries and Feature Counting. Thematic Queries allow you to view all features that match a specified criteria. For example, you can show all cast iron main, all wooden poles, all valves from a particular manufacturer, etc. Combined with GTViewer’s fast display and Emphasize mode, patterns in your GIS data become apparent and provide decision making information. Feature Counting allows point and linear features to be counted within a polygon. A polygon can be an existing feature (such as municipal boundary or tax district boundary) or drawn as a Redline. Feature Counting provides both graphical and tabular results to help you make the most of your data.




Applications is the most powerful aspect of GTViewer. With Applications built on top of GTViewer, you are not limited to what GTViewer provides off-the-shelf. Applications can be used for Inspection, Inventory, or other Data Collection. Even more power from your GIS data is liberated by applications that perform complicated tasks like network tracing, such as outage analysis, value isolation, and load computation. Applications can leverage all of GTViewer’s other aspects, Viewing, Redlining, and Analysis, to implement complete Engineering and Design workflows. GTViewer can be the basis of any application that can use your GIS data.





GTViewer is more than just a viewer. It is a powerful Viewing tool, but is has many other aspects that you can exploit. Redlining and Analysis are just the beginning of what GTViewer can do for you while Applications built on top of GTViewer open the door to opens the door to anything you can imagine with GIS data.

Tuesday, July 26, 2005

Overview Maps

I have seen several Overview Maps created by users lately and all of them have some common problems. I hope this blog entry will help provide information for building better more useful Overview Maps.

The Overview Map is the overall view of the data seen in the Overview Window. GTViewer, Pocket GTViewer, and GTVx all support an Overview Map. See previous blog entry for more info on the Overview functionality.

Here are some key facts about the Overview Window:


  • The Overview Category defines what is in the Overview Window. The Overview Category type is set to 1 in the .GTM file.
  • All contents of the Overview category are shown in the Overview Window. Display Filters will affect the display in the active view, but not in the Overview Window. If you are turning items off with the filter ids in the Overview Category, you probably have these features in the wrong category.
  • The Overview should be simple and have as few elements as possible while still providing “macro” reference information. This goal is sometimes hard to meet depending on the setup of your original data; however, some effort spent here will make your data look better and make the Overview more useful.
  • The Overview Window always uses a Red rectangle to show where the current view is. So, if your Overview Category contains a lot of red, it is hard to find the indicator. Thick styles can also make it difficult to find the indicator. One solution here is to use the [Overview] style definition to make the Overview Window use weight 0, style 0, and gray colors for all elements:

    [Overview]
    Style=0
    Weight=0
    ColorValue=120120120

  • The data range used by the Overview Window is the range provided by the Range or RangeFile entry in the .GTM file. The range defined here should closely bound the data (at least what is in the Overview category) so that there isn’t too much empty space around the data in the Overview window.

Thursday, July 21, 2005

The Roundtrip with GTFormatInfo

Today, there are many different ways to get data collected by GTViewer, GTVx, or Pocket GTViewer back to your GIS. The approach that probably comes to most users’ minds is Safe Software’s FME using the GTViewer Reader. This approach is easy to use and is the most flexible in supporting graphic and tabular information. However, it is not the only solution. GTRead and GTVx can also read collected data and provide a flexible mechanism for processing the information; however, this blog entry is going to be on a tool provided by GTData called GTFormatInfo which requires no programming or additional software.

First, how do you collect data with GTViewer or Pocket GTViewer? This job usually requires an external application like the demo Pole Test/Inspection app delivered with Pocket GTViewer or the Pole and Valve Inspection demos available for GTViewer and GTVx. These data collection apps are easy to implement and are generally just a variation of the templates GTI provides.

The data collections apps generally result in session graphics (redlines) that include embedded tabular data. Let’s say for example, you are using the Pole Inspection app and visit 50 poles. The external app stores the collected data on the redline marks used to indicate that a pole has been visited. These redlines are part of a .GTX extract file or they can be exported as a .GTG file (from a .GTM, GTS, or .GTX file). Either a .GTG or .GTX file is the input file to either FME or GTFormatInfo.

The GTFormatInfo utility is used to extract tabular data embedded on session graphics data in a .GTG file or a .GTX file. The embedded tabular data is applied to user provided templates converting a graphical .GTG or .GTX file into an ASCII file such as an SQL script containing update or insert statements. The GTFormatInfo utility could also be used to create reports or format input for a custom application. The point is, you do not have to be a programmer to access the data contained in the redline elements.

The GTFormatInfo utility is really just a text replacement tool, but it has the ability to select items from the embedded tabular data in the redline graphics to replace tokens with in a template file. You can provide 3 template files: Header File, Entry File, and a Footer File. The Header File is prepended to the output file, and the Footer File is appended to the output file. The Entry File will be written once for each element containing session graphics with embedded data. In the Entry File, you can place special tokens that will be replaced with attributes from data embedded on the session graphics. A token is specified in the following format:

<%ATTR:table.attribute%>

Where table is a table in the embedded data and attribute is an attribute within that table.

If you wanted to create SQL insert statements, an Entry File template might look like the following:

INSERT
INTO COLLECTED_DATA( IPID, DATE, TYPE )
VALUES (<%ATTR:EDIT.IPID%>,'<%ATTR:EDIT.DATE%>',

'<%ATTR:EDIT.TYPE%>');

So if you had 3 session graphics each with embedded data containing a table called Edit with attributes IPID, DATE, and Type, then you would get three records in the output file like this:

INSERT
INTO COLLECTED_DATA( IPID, DATE, TYPE )
VALUES (10023,'7/21/2005',

'PRIVATE');

INSERT
INTO COLLECTED_DATA( IPID, DATE, TYPE )
VALUES (10025,'7/21/2005',

'PUBLIC');

INSERT
INTO COLLECTED_DATA( IPID, DATE, TYPE )
VALUES (10037,'7/21/2005',

'PRIVATE');

The Header and Footer Files are optional but they could be added to make the data more easily work with another application. For example, you might add a Footer File that contains:

commit;
exit;


How you collect and get data back to your GIS will undoubtedly be depended on many different things. There are many tools available to help with this process. GTFormatInfo is a simplistic approach to the problem, but it may be quite usable in many situations.

Wednesday, July 20, 2005

Settings in GTViewer

In GTViewer, the Session Settings Dialog under Options/Settings provides several configurable settings that many users may not be familiar with. In this posting, I will go through each of the settings.




  • CoordinateReadout – This setting has been described in other posting, but its value (none, computed or system) determines how GTViewer will display coordinates (on the status bar and on the Attribute Info dialog’s Element tab) and how the Locate XY dialog will interpret values. The default is Computed and changing it to System or None will only last for the current session. However, you can add an entry in the .GTM file to set the default value (use CoordinateReadout in the [General Info] section). See "Associating a Coordinate System with a Dataset" for related information.
  • Coordinate Readout Precision – This setting determines how many digits will be displayed after the decimal point when coordinates are displayed. You can set it from 0 to 7 digits. The default is one digit; however, if you are displaying coordinates in Latitude and Longitude, you will need more digits displayed. Also, you can set the default precision in the .GTM file with the CoordinateReadoutPrecision entry in the [General Info] section.
  • Locate Single Find – This setting defaults to No, but if it is set to Yes, it will cause a Query to automatically perform a locate if only one record is found. This mode will essentially save you a couple of clicks if you only get one record returned. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Logging Level – This setting sets the current logging level. The default is 0 (minimum); however, you can set it up to 5 (maximum) to add more information to the log file. It is sometimes very useful to have additional information in the log file when trying to resolve a problem or optimizing performance. See this previous Blog entry on logging more information. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Maximize Initial View – This setting defaults to No, but if set to Yes, it will cause a newly created session to maximize its initial view window. Many users do not use more than one session at a time and the first thing they do is maximize a newly created session’s view. To save this step, you can set the Default to Maximize Initial View. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Mouse Wheel Increment – This setting determines how much the mouse wheel will zoom in or out when rolled. The default is 3 times, but it can be set between 1.25 and 4.0. Increasing the value will make the zoom in and zoom out faster when the mouse wheel is rolled as it will go in larger increments; however, you will not have the same degree of control if you only want to change the zoom by a small amount. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Move Increment – This setting determines how much a selected session graphics element is moved when using the Ctrl-Arrow Key combinations. This action is normally only used for precision adjustments; however, if you need to change the move increment to a smaller or larger value, this setting can be used. The default is 1000 system units. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Open Last File – This setting defaults to No, but when set to Yes, GTViewer will open the last session used automatically when it is started. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Repeating Tabular Components – This setting is provided to give users the choice of showing repeating tabular component on a Single Tab (in a grid) or on Separate Tabs in the Attribute Info Dialog box. The Default is Show on Single Tab, but can be changed to Show on Multiple Tabs. GTViewer originally always showed repeating components on multiple tabs. Then, the Grid for similar tabular components was provided and made the default; however, you can still use the old style if needed. The Set As Default button is available to permanently change the default and will apply to all session in the future.

  • Rotation Increment – This setting allows the angle increment selected session graphics elements are rotated (with the Shift-Left Arrow/Shift-Right Arrow or toolbar buttons) to be changed. The default is 5 degrees, but it can be changed to values from 1 to 30 degrees. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Scale Increment – This setting allows the scaling factor selected session graphics elements are scaled (with the Shift-Up Arrow/Shift-Down Arrow or toolbar buttons) to be changed. The default is 10% and can be changed to values from 1 to 25%. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Show Element Tab – This setting defaults to Yes, but it can be set to No if you want to hide the Element Tab on the Attribute Info dialog. The element tab is not useful to some users and may be confusing. The Set As Default button is available to permanently change the default and will apply to all session in the future.








Thursday, July 14, 2005

Magnify and Overview in GTViewer

GTViewer provides two very useful tools for gaining perspective on your data without constantly zooming in or out. The Magnify and Overview tools are really opposites in what they do, but they can make it very easy to look at your data up close and far away all at the same time without ever modifying your current view.


The Magnify Tool is used to see details around the mouse cursor without having to zoom in or change the view. When the Magnify Tool is activated, a new window is created and the mouse is shown with a box around it. The area in the box is displayed in the Magnify window as a closer zoom level.






The Magnify Window is updated every time the mouse is moved and probably provides a few features that are not commonly known by its users.

  • Double-clicking the mouse will match the zoom level of the current view to the Magnify Window. So, if you see something you like in the Magnify window, double-click the mouse and the current view will be set to match.
  • If your mouse has a wheel, rolling the wheel up or down will increase or decrease the size of the box around the cursor. This action is a very handy way for getting even more detail once you have found an area of interest. If your mouse does not have a wheel, the Page Up and Page Down keys will perform the same tasks.
  • The Magnify Window is movable and resizable. It will also remember the last size and position from one use to the next.



The Overview Tool is somewhat different from the Magnify tools. Instead of providing you with a detailed view of something around the mouse cursor, the Overview Tool creates a new window to show you an overall view of your data with an indicator for the current view location.




The Overview Window is updated every time the view changes and it too probably provides a few features that are not commonly know by its users.

  • Clicking the mouse in the Overview Window will set the current view to that location. You can basically drag the view indicator around the Overview Window to get to the location you want.
  • The Overview Window is movable and resizable. It will also remember the last size and position from one use to the next.
  • The Overview Window’s contents are determined by the Overview Category. All GTViewer datasets must have an Overview category defined and its contents will be used for the Overview Window.
  • A special Style Rule called “Overview” can be defined to override the display of all elements in the Overview Window. Sometimes it is useful to remove the weights, linestyles, and color in the Overview window, but leave the element alone when viewing them in a regular view.

If you have not used the Magnify or Overview tools before, give them a try. If you have used them before, see if any of the features listed here are new to you.

Wednesday, July 13, 2005

Friday, July 08, 2005

GTData Review

GTData currently delivers over 40 utilities for converting, creating, manipulating, and analyzing GTViewer data. Most users may only be familiar with the basic tools to do their conversion, but GTData continues to grow its collection of data utilities. This Blog entry is really just to expose everyone to all that is included with GTData and not to tell how to use them. Documentation on all of the utilities can be found in GTData.doc.

General Utilities

The general utilities are utilities that may be used regardless of the source data type.

  • GTConfig - GUI utility for editing Table Definition files (*.tab) and generating database scripts (for loading data directly out of Oracle). Very useful tool that is probably underused.
  • GTIndex - Creates a spatial index (.gtn) for Graphics files (.gtg).
  • GTAsciiIndex - Creates the Ascii Index (.idx) for a tabular file (data.txt). This index file is automatically created by FV2Ascii and GTConvData, but it is sometimes need when creating your own data.
  • GTSortIdx - Sorts a Tabular Data .idx file.
  • GTRefSort – Sorts a reference index and can create a .fer file from a .ref file.
  • GTQuery - Compiles queries (*.qry) from the Query Definition files.
  • GTTextQuery - Creates a locate query based on the text dump file from GTConv. Used to make text searches from text elements that are not features.
  • GTExtract - Creates an extract file (.gtx) by range from the command line. Identical in functionality to the interactive Extract in GTViewer; however, this one can run in a script.
  • GTPack - Creates an extract file (.gtx) from the command line. Similar to GTExtract except the data is not extracted, it is packed. See previous blog entry for more information on the differences.
  • GTFontEdit – GUI tool for creating and editing Font characters in the GTViewer font format (*.dfn).
  • GTFont - Convert ASCII Font definitions to GTViewer Fonts (*.dfn).
  • GTGetKeys - Creates linkage index for graphics files
  • GTGetOffset - Retrieves coordinate information from dgn files. Can help determine the offset values when preparing for a conversion.
  • GTGetRange - Determines the range of a set of features based on an Attribute value(s).
  • GTGetRange1 - Finds the range of a specific feature in a graphics file.
  • GTDumpMdb - Creates an Ascii dump file (data.txt) from an Access file (.mdb).
  • GTDumpDbf - Dumps the contents of a .dbf file to the Tabular data or a raw pipe delimited format.
  • GTMergeGtg - Merge multiple graphics files (.gtg) files into one .gtg file.
  • GTMergeData - Merge multiple Tabular Data (data.txt) files into one. Also, provides the incremental data support for tabular data.
  • GTUpdateGtg - Integrates an update .gtg file (with adds and deletes) into an existing .gtg file. Part of the Incremental Update tool collection.
  • GTRemap – Remaps the filter ids in a graphics file (.gtg) to another a mapped set of filter ids.
  • GTRemap1 - Remaps element in a graphics file (.gtg) from one (filter id, color, style, weight) to another (filter id, color, style, weight).
  • GTSplitGtg - Split one graphics file (.gtg) file into multiple files based on filter id. A parameter file defines the mapping.
  • GTShiftGtg - Scales and/or Shifts all elements in a graphics file (.gtg).
  • GTRasterIndex - Create raster index shapes for MrSID files.
  • GTCompact - Compacts Group Elements and elements with duplicate element (with same keys and optionally with same filterid).
  • GTTile - Tiles multiple .gtg files into a single .gtg file.

Data Creation Utilities

  • GTGetRecords - Extracts a set of attributes for a specified table from an ASCII data file.
  • GTMakeInter - Creates intersection elements and data files from a delimited text file of values.
  • GTIntersect - Generate intersection nodes from Shapefile street segments. Also, can generate street labels from Shapefiles.
  • GTInterGtg - Creates intersection features from graphics files (.gtg) files (similar to GTIntersect).
  • GTLabelGtg - Create street labels from street line segments in a graphics file (.gtg) (similar to GTIntersect).
  • GTFormatInfo - Extract embedded data from a .gtg file and apply to a template for formatting.


Shapefile Related Utilities

  • GTShapeConv - Data Conversion utility for Shapefile graphics.
  • GTShapeDbfConv - Data Conversion utilty for Shapefile data (*.dbf) files.

DGN based Data Conversion Tools

These utilities are generally used with source data from Framme, Field View, MGE, and Microstation.

  • GTConv - Data conversion utility for FRAMME, FV, MGE, DGN graphics data. This utility may be the used the most if your source data is DGN based. This utility is probably the most complex of the GTData set and has been around the longest.
  • FV2Ascii - Converts a Field View snapshot’s tabular data to the GTViewer tabular format. If you start with Field View data, you would use this tool. If you start with Framme data, you would use GTDataConv.
  • GTFilterUpd - Updates Filter Definition files (*.flt) with FRAMME Feature and component names.
  • GTFRBConv - Creates Field View Rulebase files (*.dta) from FRAMME rulesbase source files (.rdl, .fdl, .cdl, etc.).
  • GTDataConv - Data Conversion utility for database dump files.
  • GTGetUDLSMap - Creates a UDLS map file for GTConv. This file show the user-defined linestyles name map in a DGN file.
  • GTSum - Creates a summary of element information from a set of DGN files including element types used, levels used, colors used, etc.


Thursday, July 07, 2005

The Star Buttons in Pocket GTViewer

There are two buttons on the Pocket GTViewer toolbar that can be customized to do various tasks. These buttons are grayed out if they have not been associated with anything and you may have not given them much though. Generally, these buttons are used to launch external applications, but there are other uses for them as well even if you are not using external applications with Pocket GTViewer.

The Yellow and Blue Star Buttons are on the right side of the toolbar:


The GTVConfig.doc describes in detail how to configure these button. However, it may not be readily apparent even to those who use the Star buttons that they can be assigned to other things besides External Apps.

The DefaultApp1 and DefaultApp2 entries in the [Additional Properties] section of the .GTM file associate the Star Buttons. DefaultApp1 one goes with the Yellow Star and DefaultApp2 goes with the Blue Star. They are usually set to the name of the external app you wish to run; however they can also be set to:

<apps>
<queries>
<gps>

When set to <apps>, the GTV/Applications dialog is activated when the button is pressed. This association is sometimes very useful if you have many external applications (more than two) and it will save you from navigating through the menu to get to the Applications dialog.

When set to <queries>, the GTV/Queries dialog is activated when the button is pressed. If you frequently use queries to navigate the data, this association can be useful.

The <gps> setting will activate the GPS Tracking dialog when its button is pressed. This dialog is normally displayed when you select GTV/Options/GPS Tracking, so it can save several steps if you use a GPS on a regular basis.

Don’t have gray Star buttons any more. Use them to your advantage.

Wednesday, July 06, 2005

GTVx 4.0.x.6 is Available

GTVx 4.0.x.6 is now available.

-----------------------
04.00.00.06 - 7/6/05
-----------------------
  • FIX - Problem with graphic offset and connectivity queries as a result of the large file processing introduced in the previous version.
  • FIX - The Force Black and White print option did not affect colored fonts.
  • FIX - Extraction of Thematic Queries containing more than one prompt would not always produce a complete unique list for the accompanying prompt query.
  • FIX - FitView with Mode 1 was using the threshold for session graphics when it should have only been using the display status.

Tuesday, July 05, 2005

The Log File is your Friend

Most GTI products produce a log file of some kind or another. GTViewer and GTVx produce the most informative ones and these log files can be used to solve various problems. GTWeb Client and GTWeb Server also produce very detailed log files.

When you are setting up GTViewer data for the first time, the log files can be immensely helpful. They always give more details as to what the problem is and the logging level can be increased to a higher level to see exactly what steps led up to the problem. If anyone has called support with a GTViewer problem, I am sure the first question asked was, “What did the log file say?”

In GTViewer, the logfile is very easy to access. There is a command under the Options menu called View Log File. Selecting this command launches the log file in Notepad.

The log file always tells one very important piece of information, the product version. The beginning of each log file created by GTViewer (other products produce similar headers) looks like the following:

1 - Jul 05 12:27:08.625 - (0.000) - <0> - *****************************
2 - Jul 05 12:27:08.625 - (0.000) - <0> - ** GTViewer - Version 4.0.0.20
3 - Jul 05 12:27:08.625 - (0.000) - <0> - *****************************

The log file contains the following information for each entry:
  • Line Number
  • Date/Time
  • Elapsed Time since the application began in seconds “(x.xxx)”
  • Message Level “"
  • Message


The Date/Time and Elapsed Time fields can be used to test performance. This information is especially useful if you are wanting to make the display faster via setting filter or category thresholds. Looking at the log file before and after a change can help identify any performance change and the amount.

The Message Level shows the severity of the message. Message level 0 is either the log file header (as seen above) or an error. If you see a message in the log file other than the header messages, an error has occurred. Message levels range from 0 to 5 and the logging level is set in GTViewer under Options/Settings. Only messages with levels less than or equal to the Logging Level setting will be added to the log file. The default Logging Level is 0 and can be changed to a different value for your current session or it can be set to a new default value. If you are debugging problem, it is usually good to set the logging level to 5 so you will see all of the logging information. Level 5 does produce a significant amount of log file messages, so it is not good to leave logging at this high level unless you are trying to track down a problem or are performing some type of performance analysis.

The GTViewer log file is always called GTViewer.log and is always stored in the operating system’s temp directory for the current user. This path can be in various places depending on your setup. The Environment Variable TEMP will show the location. From a command prompt, you can say:

set temp

to see where the temp path is or you can do something like this:

cd %temp%

And go to the TEMP directory.

GTViewer is not the only GTI product to produce a log file. The other applications also write their log files to the TEMP directory. GTVx’s log file is called GTVx.log; GTConv.exe’s log file is called GTConv.log, etc.

Log files are reset each time an application is run, so if you want to keep the information from a log file between runs of an application, make sure to make a copy of it before running the application again.

Some of the command-line utility in GTData will allow you to specify the location of the log file and the logging level. For example, the –logging flag allows the logging level to be specified and the –logFile flag allows you to specify the location of the log file. These options are common to all utility with logging capabilities.

GTWeb Client places it log file in the operating system's TEMP directory like the other products; however, GTWeb Server makes its logfile available over the internet via the GTWeb Server Administrator web pages (which is very handy when you are not physically at the web server).

Let the log file be your friend if you are having problems. It will usually provide good information as to why you are having a problem when it is not immediate obvious from the application itself. Also, if you are having problem, increase your logging level and keep copies of the files to send to GTI support as this information may speed along the resolution to your problem.

Monday, July 04, 2005

Reading the Linkage off of an Element

A common task when programming with GTViewer or GTVx is to get the Linkage off of an element (for more info on linkages, look here). For example, if an event were fired indicating that an element had been selected, you get the Category Id and the Element Offset of the selected element as parameters in the event. So, how do you get the Linkage stored on the element so that you can lookup database information? It turns out that there are several ways to do this, but I am going to provide a generic approach that should work for most cases.

It turns out that there is a method provided by both GTViewer and GTVx to retrieve the linkage from an element. It is aptly named GetElementLinkage; however, it returns an array of linkage values (since GTViewer data can have 1 to 7 linkage values per element). Most datasets use a 1 or 2 key linkage system and it sometimes, so it sometimes seems cumbersome to deal with an array when you know you will always be getting one or two linkage values. It is pretty easy to write a function in VB to just return you the one key or two keys without having to deal with the array. The example below is for 2 keys, but it should be obvious how to downgrade this code to a 1 key version.

Function GetElementLinkage(ByVal categoryId As Long, _
ByVal offset As Long, _
dataId As Long, _
key1 As Long, key2 As Long) As Boolean

' This function will get the linkage off of the element specified by its
' categoryId and offset. The dataId, key1, and key2 values will be populated.
' If the element contains only a 1 key linkage, key2 will be 0.
' The function returns True if a linkage was found and False otherwise.

GetElementLinkage = False

Dim linkageList As Variant
Dim linkCount As Long

key1 = 0
key2 = 0

If docObj.GetElementLinkage(categoryId, offset, linkageList, linkCount) Then

dataId = docObj.GetDataId(categoryId)

If linkCount > 0 Then

key1 = linkageList(0)

If linkCount > 1 Then

key2 = linkageList(1)

End If

GetElementLinkage = True

End If

End If

End Function


The function above is for GTViewer, but it is very easy to use it with GTVx as well. You can either change the docObj reference to a GTVx1 (or whatever variable name you assigned to the control) or you can add something like the following to your code and use the same code for both GTViewer and GTVX. Write your code for GTViewer making sure to use the correct object when calling the methods (appObj, docObj, or viewObj). For GTVx, just define variables like the ones below in your general section:

Dim appObj As GTVx
Dim docObj As GTVx
Dim viewObj As GTVx

And somewhere in your code, assign the object variables to the GTVx control (Form_Load is a good place to do this):

Private Sub Form_Load()

Set appObj = GTVX1
Set docObj = GTVX1
Set viewObj = GTVX1

.
.
.

End Sub

That is all you have to do. The function is provided in an appendix to the GTVx.doc file. There are other useful code snippets in this document as well.

Friday, July 01, 2005

GTData version 3.0.0.17 is Available

GTData version 3.0.0.17 is now available.

-----------
03.00.00.17 - 07/01/05
-----------
- FIX - FV2Ascii - Problem with the multi-segment feature creating offset RB_PRMRY values in Framme data modes.


- FIX - GTFontEdit - Problem with Move to Front and Move to Back where when selecting empty space after the move. Only affected character with style origins.

- FIX - GTConv - Elements with Tag Element attribute would not respect the UseLevelAsFilterId entry.