Subscribe to this thread
Home - General / All posts - transfer selection from drawing to image - M9
vincent

1,972 post(s)
#07-Dec-18 19:07

Hi,

I would like to know how to transfer selection from a drawing to a raster in M9 ?

Thank you.

tjhb
10,094 post(s)
#07-Dec-18 22:26

I don't think we can do this yet. AFAIK we cannot write to or update the SelectionKeys for any table. Neither in SQL nor in the API. (In SQL we can read the SelectionKeys.)

The same applies when both tables contain geometry, both contain tiles, or one geometry and the other tiles.

Bear in mind also that if we could transfer the selection to a table containing tiles, we could only select whole tiles, not individual pixels.

tjhb
10,094 post(s)
#08-Dec-18 00:11

Assuming that is right, I wonder if the best way to extend SQL syntax would be with an extra function

SelectionKeysUpdate(<table>, <keys>, <add>)

and variant

SelectionKeysUpdateWindow(<table>, <windowName>, <layerName>, <keys>, <add>)

where <table> would be the target table, <keys> a table of mfd_id values, and <add> a Boolean flag.

If the <add> flag were true, the table of mfd_id values would be added to the SelectionKeys table for the target table. If false, they would be removed.

The effect on the selection would be governed (as usual) by the state of the SelectionIsInverted (or SelectionIsInvertedWindow) flag. If false, then adding ids would select the given records, and removing ids would deselect records. If true, the reverse.

To add to the selection regardless of the state of SelectionIsInverted, we would use

SelectKeysUpdate(<table>, <keys>, TRUE XOR SelectionIsInverted(<table>))

and to subtract

SelectKeysUpdate(<table>, <keys>, FALSE XOR SelectionIsInverted(<table>))

The table of mfd_id values to add/subtract as keys could be built e.g. by a SELECT, VALUES or TABLE statement, possibly using ValueSequence, possibly using a FUNCTION, possibly stored by a VALUE assignment.

There is plenty of scope for Select templates making use of these functions, and writing them via the Edit Query button.

(At present, the Edit Query button for Select templates produces SQL which does not adjust the selection, but only lists records. With new functions like those above, output SQL could exactly reproduce the template functions.)

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.