SELECT_PYTHON_EXPRESSION
Send entities in the active drawing file for which a Python expression returns true to the current command.
This command only works as a transparent command: run it while another command that supports multiple selection is active (such as BORRAR or MOVE), and it sends the selected entities to that command. If no current command supports multiple selection, it displays "No command is being run that admits multiple selection.", sounds an error tone, and ends without further action.
Parameters
| Parameter number | Description | Values | Optional |
|---|---|---|---|
| 1 | Python expression | All text after the = sign forms the expression. Leading and trailing spaces are ignored. Selection names with # are not accepted. |
Yes. Without parameters, or with a blank parameter, the command displays the Python expression dialog box described in ON_PYTHON_EXPRESSION. |
The variable g, attributes (g.codes[0].attributes), the value the expression must return, and code snippets are explained in ON_PYTHON_EXPRESSION.
Example
With BORRAR active, to delete empty texts:
SELECT_PYTHON_EXPRESSION=type(g).__name__ == 'Text' and g.text == ''
Notes
- The command only evaluates entities in the active drawing file that are visible and within the area of interest. Deleted entities are only evaluated if DELETED is enabled.
- If the expression fails, Digi3D.AI displays the Python error, and the current command receives an empty selection, even if the expression returned true for other geometries in the active file before the error. The Errors section of ON_PYTHON_EXPRESSION describes the errors.
- The Immediate/Select by Python expression... submenu lists the active code table's selections below Introducing expression.... Each option runs this command with that selection's expression. The options are disabled when no current command supports multiple selection.
Command characteristics
| Command type | Transparent command |
|---|---|
| Repeats automatically | No |
| Menu option | Immediate/Select by Python expression.../Introducing expression... Immediate/Select by Python expression.../(code table selections) |
| Toolbar | This command has no associated toolbar button |
| Extension | DigiNG.OrdenesStandard.dll |
| Implementation | Native |
| Related variables | DELETED |
| Related commands | ON_PYTHON_EXPRESSION SELECT_COD SELECT_BY_ATTRIBUTE |
| Internal name | {60FBEA4A-2F76-40BB-9201-12C85A211682} |