Python : Read SD Custom Attributes in Rhino Imported Objects

Hi,
ShapeDiver’s Geo Import Component can’t handle multiple files yet.

I’ve tried to code a python script to load multiple DXF to batch them.

Preview :

BUT : It’s working but i don’t know how to retrieve specific ShapeDiver’s Attributes ?
I have output “Rhino.DocObjects.ObjectAttributes” Object, but how to extract data ?

The commented part (trying to get attached attributes) generates me an error :
Runtime error (MissingMemberException): 'ObjectAttributes' object has no attribute 'OCSMappingChannelId'

Exemple with same first file with SD Geo Import Component :

Maybe you could easily make it multi-thread ? :slight_smile:

Thanks for helping me =)

If you are loading DXF files using a script and not using ShapeDiver’s Import component, the objects you are importing cannot include ShapeDiver Attributes. Those attributes are created in the Import Geometry components, which convert document properties (names, layers, materials) into ShapeDiver Atttibutes that are attached to the imported objects. If you are using a custom script to import files, you will need to use an alternative way to import those properties. Or am I missing something?

If your question is about importing multiple files using the Import component, this is something we are considering but not fully specified yet, therefore I cannot give you a timeline for the implementation.

Hi Mathieu !

Just found a workaround ! :tada:

Hope this will give you ideas to handle multiple files in Geo Import Component ^^

Have a good day !

1 Like