Hello, I am trying to run any script from python that contains the function .getFirstSelectedElement()
And it constantly appears this Error message:
org.eclipse.ease.ScriptExecutionException: Traceback (most recent call last):
File “file:///C:/Siemens/SMW/capella/workspace/Python4Capella/sample_scripts/export_selected_element_diagrams.py”, line 27, in
from py4j.java_collections import ListConverter as _pyease_ListConverter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “workspace://Python4Capella/utilities/CapellaPlatform.py”, line 28, in getFirstSelectedElement
from py4j.java_collections import SetConverter as _pyease_SetConverter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: ‘NoneType’ object has no attribute ‘getFirstElement’
I am right-clicking on a random Element/diagram and selecting the pop-up.
Thanks a lot.
I don’t reproduce… The getSelection() return None, that’s why you get this error. You select the element from which editor/view ? I tried from the project explorer and a diagram editor and both worked for me.
Okey, thanks. It just needed a restart.
Nevertheless, this error is showing up, now:
org.eclipse.ease.ScriptExecutionException: Traceback (most recent call last):
File “file:///C:/Siemens/SMW/capella/workspace/Python4Capella/sample_scripts/xAB Functional Content.py”, line 155, in
# Last resort use string representation
File “C:\Users\miguel.lopez.cordero\AppData\Local\Programs\Python\Python311\Lib\site-packages\openpyxl\worksheet\worksheet.py”, line 597, in merge_cells
cr = CellRange(range_string=range_string, min_col=start_column, min_row=start_row,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\miguel.lopez.cordero\AppData\Local\Programs\Python\Python311\Lib\site-packages\openpyxl\worksheet\cell_range.py”, line 67, in init
raise ValueError(fmt.format(min_row=min_row, max_row=max_row))
ValueError: 1 must be greater than
Do you have any idea of what could be?
Thanks!
I think the upper bound (max_row) of the range is lower than the lower bound… but by seeing the error message max_row is not defined.