algorithmic modeling for Rhino
My file is consists of several insert blocks, each of them have surfaces on a layer. I wanted to get all the objects on the layer and calculate their area. So I first get the object table of each InstanceObject using:
block.Document.Objects
But when I try to do .FindByLayer, it failed to recognize the layer and return a null array. Then I tried to get the layerindex and using .FindByFilter and I found that the index I get using .LayerIndex is different from the one the reference document is using. (i.e. the layer index in the reference document is different) I want to know how to get the actual layer index used in that document through the FullPath of a layer.
I am using python and rhino.common.
Thanks!!!
Tags:
It seems that InstanceObject.Document returns the current document instead of the inserted document. Is it possible to access the linked document's layer table? Thanks!
Thanks David. I got some help from that forum. For future reference, this sample file is very useful for getting all the instance references in a document.
https://github.com/dalefugier/SampleCsCommands/blob/master/SampleCs...
Welcome to
Grasshopper
© 2025 Created by Scott Davidson.
Powered by