Start a new topic

Trouble with OpenFlight Script function, "mgGraphicsViewSettingSetInteger"

 Hello. Apologies if this is the incorrect forum or source to receive help. If this is the incorrect forum, I'd appreciate being directed accordingly.

Anyway, I was trying to use OpenFlight Script to manipulate manipulate freeze flags. I'd like to begin by simply activating and deactivating the X, Y, and Z flags, before I attempt something more complicated. However, when running the following code (attached as on a new Untitled1.flt file, I found unusual results: 

db = mgGetCurrentDb ()
YFound, YValue = mgGraphicsViewSettingGetInteger(db, MGVI_FREEZEY, 0)
if (YFound):
   mgGraphicsViewSettingSetInteger (db, MGVI_FREEZEY, not YValue, MGVSM_SETCURRENT );
   YFound, YValue = mgGraphicsViewSettingGetInteger(db, MGVI_FREEZEY, 0)

  From this script, I noticed the following based on what flags were checked and were not checked:

- When all flags are unchecked, the X flag is checked instead of Y

- When X is checked and Y is unchecked, X remains checked and Y remains unchecked. YValue is 0 in both instances

- When Y is checked regardless of X, Y remains checked and X remains unchecked. YValue is 1 in both instances

- Replacing all Y variables and code for X (as seen in attached, I called the FreezeX function with X and Y unchecked. This results in X being properly checked. XValue is initially 0, then gets changed to 1; all expected behavior. Calling the function again when X is already checked results in no changes: XValue remains 1 instead of flipping to 0.

I imagine this may be a misunderstanding on my part. I did not understand the documentation of MGVSM_SETCURRENT and MGVSM_SETALL when they refer to different graphics views. If my code is correct and I have had no misunderstanding, my next guess is that the function "mgGraphicsViewSettingSetInteger" may be doing something strange.

Thank you very much for your time and help.

(299 Bytes)
(306 Bytes)

Wow, you are right. There is something not right going on there. I'll log a bug for this so it can get looked at.

Glad to hear I'm not crazy. This functionality isn't urgent for me, but when are bug fixes or new versions usually implemented? Creator 23, I imagine?

Login to post a comment