BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Selection Manager

Started by Yacine, July 01, 2022, 12:33:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


In the a.m. topic I presented an idea about creating and saving lists of shapes - a kind of "selection manager".

update - 03.07.2022:

These lists are intended to be used as a specialized clipboard, not for copying and pasting data, but for recalling selections.
So that in "bigger" drawings - letting "bigger" be defined by your own perception - you can re-select shapes as you have previously done.
eg: you've selected the "apples", or the "motors", or the "red shapes", done some operations on them and later, even after having closed and reloaded the drawing, you just reload this specific selection and do further operations on them. That's why the saving feature provides an automatic naming - so you won't need to bother about any naming - and with the renaming feature you can specify a proper name, if you feel so.

This is here the tool, with the following features:

  • You can save either "static" selections, which are in fact lists of shape IDs
  • and dynamic selections, which are computed by means of interpreting a formula that interprets to TRUE. eg "PinX>1" or "LineColor=1"
  • When saving you can either use the proposed name of "sel_" + current date and time, or a custom name. eg "Corners", "Shapes", "Valves", whatever.
  • The selections can be modified, renamed or deleted.
  • Modifiying would mean that you select the list entry, then take the current selection as the new one. That is in case the selection type is "static".
  • If the selection type is "dynamic", you're asked for a new formula.
  • The form has two check boxes, which I hope are self explanatory. One is to enable and disable the automatic selection, the second will make the tool either create a new selection or add to the previously selected shapes.
What else?

  • Under the hoods, the form will write in the user section rows with a prefix of "sel_". The prompt is used to store the selection type and the value is either a semi-colon separated list or a formula. This way the selections are saved automatically and can be restored just by calling the form.
  • When using dynamic selections, the form writes in a cell "user.temp" of the doc an enhanced version of the formula and reads it to check whether the shape complies with the condition. This may be slow. But hey, still way faster than doing it manually.
What is open?

  • I haven't implemented an automatic repair of the IDs lists for the case shapes are deleted. The "redefinition" feature will help till then.
I welcome you guys to test it and give some critics.

PS: the tool is in the stencil. Drop the yellow square on the canvas to start the form.
PPS: the VSDX is just for playing. The tool should work with any other vdsx




Just thought about a "deselect" function, so as to remove a certain selection from the current one.
Eg Take the "frame" selection and remove the "corners", so as to keep only the pure sides.
Not a big deal. A button and 3 lines of code.

In a realistic use case I could for instance do "select all valves", then unselect all parts that are "pneumatically driven".

Thinking about it furthermore, it would be nice to have some sort of logic formula : (SelA AND selB) OR NOT(selB). But I wouldn't know adhoc how to implement it. (Maybe store the results, before applying?)

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 227 (show)
Files included: 32 - 1207KB. (show)
Memory used: 1022KB.
Tokens: post-login.
Cache hits: 15: 0.00164s for 26,766 bytes (show)
Cache misses: 4: (show)
Queries used: 16.

[Show Queries]