I have for long written codes in python for rhino using rhinoscriptsyntax but since I have now to deal with a large number of geometries to be processed I thought that it could improve the speed of the code by using rhino common syntax instead (which I understand would run much faster). Hope the question below is not too stupid!
I am trying to select objects (one set from layer and one from selection) get their bounding box and compare them.
My first problem is that I don’t know what is the equivalent of GetObjects and GetObjectsByLayer in rhino common. I tried Rhino.Input.RhinoGet.GetMultipleObjects() but doesn’t seem to work (requires all the inputs?)
The second is that even if I use rhinoscriptsyntax I cannot evaluate the bounding boxes by using Rhino.Geometry.BoundingBox(rs.coercegeometry(objs02[j])) as it is telling me that a Brep is returned while Ienumerable required.
Sample code below.
Any suggestion? In general where would you look if you have to translate a script from rhinoscriptsyntax to rhino library?
Not a specific answer to you question but rather a few links to guide you into RhinoCommon. This way you know how to see how methods like ObjectsByLayer use RhinoCommon
Also to format python code in a post use this wrapper: