Utilizing XRGF

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
Weathernator
Posts: 8
Joined: Mon Dec 09, 2013 4:42 pm

Utilizing XRGF

Post by Weathernator »

How can I call an xgrf file from a script? If I cannot, how can I add it to a bundle? Hopefully someone here knows, I'm sure it is a simple answer that I can't seem to find.

Weathernator
User avatar
tomw
Posts: 296
Joined: Tue Dec 23, 2008 3:40 pm

Re: Utilizing XRGF

Post by tomw »

There are at least two options that come to mind:

1. in Jython do:

Code: Select all

makeDataSource("/temp/mydrw.xgrf")

(pointing at your file). The side-effect of this is that it will usually pop up the Drawing Control window.

2. make a bundle and then load it when you want to display the "drawing". To make the bundle, create the .xgrf file and display it (with nothing else), and then File->Save Bundle. When you later load up the bundle from Jython:

Code: Select all

loadBundle("/temp/mydrwbund.mcv")


Will display without the Control window being displayed. In both cases, you can edit the .xgrf file as needed (for example, you could actually replace the contents with a new set of lat/lon coordinates, new text, etc.).
Post Reply