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”
Expected Behavior
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.
Hi rdejonge,
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:
GeometryResult([obj1, obj2])
In your example the parentheses are missing:
GeometryResults[obj1, obj…]
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 TransformableObject (which Group inherits from), a sequence (e.g. a list) of TransformableObjects or a File.