ENZYME-APD / tapir-archicad-automation

The easiest way to use the JSON/Python API from Archicad without knowing how to code.
MIT License
54 stars 17 forks source link

Enhance HighlightElements command to be able to assign different colors for highlighted elements #89

Closed tlorantfy closed 1 month ago

tlorantfy commented 1 month ago

I tried 3 solutions:

  1. Rename 'elements' input parameter to 'elementsWithColors' and that array would contain elementId+color pairs.
  2. Change 'highlightedColor' input parameter to array and rename it to 'highlightedColors'. This way the size of this array must match the size of the elements array. So the color of elements[i] would be highlightedColors[i].
  3. Make 'highlightedColorsOfElements' input parameter which would define a color for a group of elements, so that array would define color+elements pairs. This way it's easier to group elements with the same color.

At first I implemented the 1st solution in C++, but I found it hard to use in tapir_py/core.py, so finally I chose the 2nd solution.

From C++ point of view, each has almost the same complexity. Which would our python developers choose?

tlorantfy commented 1 month ago

@kovacsv, is there any reason why this pull request is not merged yet? Please tell me if you have any questions or concerns

kovacsv commented 1 month ago

@tlorantfy sorry for the delay, thank you for the contribution!