Which tool versions are you using?
Isolation mode: venv
I’m trying to get two object out through GeometryResults, one SquareBeam and one Sphere, it gives me the error “TypeError: ‘SquareBeam’ object is not iterable”
I was hoping to get both the object out in the web view
This is possible, your implementation might be wrong. In order to visualize multiple geometric objects you can use a
Group, which you use as input for a single
GeometryResult. See the docs for an explainer on using a
Group and a code snippet with an example.
Let me know if this fixes your problem.
Thank you, that works.
I have a question, in the SDK reference for GeometryResult (SDK Reference - Views | VIKTOR Documentation), it says in case of multiple objects we simply specify it as GeometryResults[obj1, obj1…] Did I understand it incorrectly?
I see what you mean. The comments means that you can also specify a list of objects, e.g:
In your example the parentheses are missing:
In the documentation we use type hints for the parameters to help you with the accepted types. For the parameter
geometry you can use either a
Group inherits from), a sequence (e.g. a
TransformableObjects or a
The return value of a view method is always a singular object (e.g. an instance of
GeometryResult for a
Thank you, that helped a lot.