Page 1 of 1

-REMOVE_SF no index, delete current SF if any

Posted: Sat Dec 30, 2023 11:03 pm
by PablerasBCN
Cool addition that finally we can set active SF by name, makes .bats much more timeproof and understanable
-SET_ACTIVE_SF {SF index or 'SF name'}

my request would be that if no index is provided, this command would remove the current SF instead of a warning, and warning only would display if no SF is active.

form the docs:
-REMOVE_SF {index} Removes the scalar field at the specified index (from all loaded clouds or meshes).
Notes:

if no SF is found at this index, a simple warning will be issued (no error will be triggered).
entities are not automatically saved after this command (you can use -SAVE_CLOUDS or -SAVE_MESHES explicitly)
since version 2.12


EDIT: Also, ir provided string SF does not exist, not sure what will happen, but not crash the loop but print a warning, I would say.

Re: -REMOVE_SF no index, delete current SF if any

Posted: Mon Jan 01, 2024 11:13 am
by alemx921
I totally get where you're coming from with the -SET_ACTIVE_SF command. It's really handy to be able to set the active Scalar Field (SF) by name – definitely a time-saver and makes scripts more readable. Your suggestion about the default behavior of removing the current SF if no index is specified seems like a logical step. It would streamline processes, especially in batch operations. Also, a warning for non-existent SFs instead of crashing the loop is a smart fail-safe. It's these little quality-of-life improvements that can make a big difference in usability. Looking forward to seeing how this evolves! A spreadsheet template is a pre-designed layout for a spreadsheet application like Microsoft Excel, Google Sheets, or similar programs.Business expense spreadsheet templates cater to the needs of different types and sizes of businesses. They are suitable for both small businesses that need a simple and efficient tool to track everyday expenses, and larger companies that require a more detailed record of their spending.

Re: -REMOVE_SF no index, delete current SF if any

Posted: Mon Jan 01, 2024 3:43 pm
by daniel
So it's hard to detect that no argument was provided (unless it's the very last command of course). So I would prefer something like
-SET_ACTIVE_SF -1 (-1 is the internal representation of 'no active SF').

Re: -REMOVE_SF no index, delete current SF if any

Posted: Tue Jan 02, 2024 1:40 am
by PablerasBCN
daniel wrote: Mon Jan 01, 2024 3:43 pm So it's hard to detect that no argument was provided (unless it's the very last command of course). So I would prefer something like
-SET_ACTIVE_SF -1 (-1 is the internal representation of 'no active SF').
I guess it is a missap, but I was referring to the -REMOVE_SF commando not the -SET_ACTIVE_SF one when requesting to not to provice index, meaning having alread activated by string an SF, to be able to remove the one that is current, simply by no having to input the index.

If by using -1 we could reffer to the active SF, to me that would be a good solution.

If not, adding string support to the -REMOVE_SF would be ok also, abit more bloaty tho.

Re: -REMOVE_SF no index, delete current SF if any

Posted: Fri Jan 05, 2024 12:35 pm
by daniel
Ah ok. I'll try to get back at it later.

Re: -REMOVE_SF no index, delete current SF if any

Posted: Sun Jan 07, 2024 11:17 am
by daniel
Ok, so now the current/default active scalar field can be designated by '-1' with the following commands:
  • REMOVE_SF
  • SF_TO_COORD
  • SF_ARITHMETIC
  • SF_OP
  • SF_INTERP
  • RENAME_SF
  • ICP (USE_MODEL_SF_AS_WEIGHT/USE_DATA_SF_AS_WEIGHT)

Re: -REMOVE_SF no index, delete current SF if any

Posted: Tue Jan 09, 2024 10:13 am
by PablerasBCN
superb! thank you so much!