Start a new topic

Using the "ModifyVertex" Window for a New Tool

I was tasked with making a script that allows the user to enter in a point, similar to how ModifyVertex allows you to select a target location. Is this GUI exposed in the OpenFlight API? I can accomplish this task by having the user enter in the x, y, and z coordinates manually via using mgPromptDialogParamBlock with a Double3, or using 3 mgPromptDialogFloat boxes for each coordinate. However, it would be very expedient to use the middle mouse button to select a point during the tool instead of copy-pasting each coordinate. I couldn't find any sample code that has this implemented, so I'm unsure if I can take advantage of existing GUIs for Creator's tools. 

Thank you for your time.


The OpenFlightAPI does have this capability exposed however not for the Python bindings. This can only be done by creating a Plugin using the C api.

Are you able to perform this task using the C api rather than Python?

It seems I am not to pursue using C at this time, at least not for this problem I am trying to solve. I'll likely go with one of the mgPromptDialog options for the time being.

That said, if my use case for using the C api arises, is there documentation on how I might get started making C Plugins with Creator? I imagine I would start with the C equivalent of Python's "from mgapilib import *" in an outside IDE.

Lastly, are the C functions for GUI those in the group of mgGuiGetProperty? 

If you do get into using the C api, there is a wealth of information and documentation on how to get started, complete with sample plugins.

you can find the documentation under:  c:\Presagis\SuiteXX\OpenFlightAPIxx\docs

In here there are the reference documentation describing all functions and record types (for both c and python)

Also here you can find the developers guide volume 1 and 2. This is where you would want to get started to understand the full process.

Samples can be found in the samples folder: c:\Presagis\SuiteXX\OpenFlightAPIxx\samples

The C API is more feature rich than the python bindings and can be easier to debug, but it can have a bit more setup to get started. Creator contains a Plugin Wizard that helps get a basic plugin started. Or you could always copy a sample plugin and modify it to your needs. (MAKE SURE YOU CHANGE THE GUIID if you duplicate a sample project)

1 person likes this
Login to post a comment