I received a file having bunch of same objects (groupped polysurfaces) copied several times with individual orientations. That increased file size to GB. I am able to select easily all these objects with SelVolume script. Is there any automatic way to convert these groupped objects to a specific blockinstance with target orientation?
Itās not a python script - but I donāt think you can use those new āRhinoā components like the Block Definition and Block Instance through the python script component? I had asked something similar in Using ModelBlockDefintion within Python Script? but didnāt receive any responses. I assume that means āNoā ? Would be awesome if it was possible though.
each group becomes a blockinstance ?
or each object, a single polysurface - inside a group becomes an instance of the same blockdefinition ?
or - the blockdefinition consists of a single polysurface of multiple ?
there is no automatic way to do it, but it can be scripted / programmed.
The amount of work depends wether a single case / file should be solved only once or a more general tool is needed.
what does the geometry offer to identify its orientation ?
you have a sample file with a few future-blocks ?
a screenshot of the overall GB-task ?
I am with Tom on this one. I expect determining orientation will be the most difficult part of the process. If a plane can be created for each set of objects, then replacing them with Block instances is not too terrible.
Here is the screenshot of the file. Yellow and Green (closed polysurface) are the same objects with different orientation. My aim is to convert these objects to BlockInstances. Example file is also attached.
Find for example largest-surface face, reparametrise it; at prm 0,0 find isocurves and construct tangents for u and v isocrve; and determine normal at same surface; crete plane by using these vectors (tangents and normal); do the same for all breps - construct such ābrep-planeā; orient brep from ābrep-planeā to xy plane; compare breps; equal breps can be changes to one block instance; remap blocks back to ābrep-planeā positions
Early exit conditions: only brep with the same brep face count and brep edged count will be comparedā¦