MOI3D to Modo preserving styles / materials

 From:  Andy Peterson (ANDYPETE)
6551.4 In reply to 6551.3 
Sure. Are you working in modo? If so, here’s what I did (with some help from another modo user).

I’ve attached the python script. It’s run in modo. The assemblies I’m working with are STEP files from my client. I’m not sure where the hierarchy is lost. Technically, only the folders or grouping are lost. When I opened them in modo, I noticed a delimiter (“:”) in the item names indicating their place in the grouping structure. Using that index is the key to rebuilding the structure.

Here are typical item or layer names for one part:
MSH024RS: 71010903:1: Solid1
MSH024RS: 71010903:2: Solid1
MSH024RS: 71010903:3: Solid1

Here’s a break down of what the script does:

Iterate through the item list. For each item:

Strip the first number from the item name. In my case it’s the file name. You may not need to do this. If not, “new_name” is the variable you don’t need. You should be able to comment that line out and replace it’s occurrence with “layer_name.”

The second number (71010903) identifies the part to which the item belongs. Each unique number becomes a folder.

Creates a group locator and assigns the item to the group.

The script is quite simple. Talking to modo is where I’m inexperienced. But this was a huge time saver, so I’m happy share.