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.
-REMOVE_SF no index, delete current SF if any
-
- Posts: 296
- Joined: Sat Jan 20, 2018 1:57 pm
Re: -REMOVE_SF no index, delete current SF if any
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.
Last edited by alemx921 on Mon Jan 01, 2024 7:01 pm, edited 1 time in total.
Re: -REMOVE_SF no index, delete current SF if any
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').
-SET_ACTIVE_SF -1 (-1 is the internal representation of 'no active SF').
Daniel, CloudCompare admin
-
- Posts: 296
- Joined: Sat Jan 20, 2018 1:57 pm
Re: -REMOVE_SF no index, delete current SF if any
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
Ah ok. I'll try to get back at it later.
Daniel, CloudCompare admin
Re: -REMOVE_SF no index, delete current SF if any
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)
Daniel, CloudCompare admin
-
- Posts: 296
- Joined: Sat Jan 20, 2018 1:57 pm
Re: -REMOVE_SF no index, delete current SF if any
superb! thank you so much!