How to Script importing specific 3dm file (w/ template layer set)

Recently starting to understand scripting, but still a bit slow :slightly_smiling_face:

GOAL: I’d like to import an external 3dm with a template Layer set, that I can use each time I’m building a new element in my current work file (see image)


I’ve tried a number of ways, but can’t seem to get it right. I’d have the script:

  • Ask for NewLayerName

  • Import the empty ElementLayerSet

  • ReplaceLayerName where XXX = NewLayerName

Down the road I might have it ask for a selected object in the current file, and if it has a name, use it as NewLayerName. Plus, automatically file it in the suitable sublayer, depending on the object type (i.e. crv, srf/sol, etc.) or on the object’s material (obj with emissive mat wld get filed in “Light”) I’ve been collecting snippets that I know will be needed for doing these types of things, so it will be a good way to practice my scripting…Though I’m happy to read to any advice thrown my way.

Any help appreciated, thanks!