Importing file to layer - appears impossible

Same result as posted above.
???

Hm - let me try something… this lets you choose a layer - does that behave any better?

ImportUnderCurrentLayer.py (1.2 KB)

-Pascal

Same result. I did capture an image of an “exception” message which appears when I click on the file to import.
Exception occured

OK, I’ll see if I can figure that out… The script is dead simple, seems hard to go too wrong.

@davidcockey here’s a try at a fix but I do not get why the same files fail for you… givs this a try; if it fails, please look for the last entry of the text ‘Debug:’ on the command history and the lines following that - copy and paste all of these here…
ImportUnderCurrentLayer.py (1.5 KB)

-Pascal

@Pascal I found why your scripts were not working for me. Options > Files > Imported file layers “Use existing layers with matching name” was previously checked instead of “Use complete layer tree from source file”. I changed the selection and now the script works.

Can you provide the earlier version of the script where the current layer is used as the target location rather than needing to select the layer?

Somehow I missed this option when searching for possible causes of the behavior I didn’t want. I don’t recall ever looking at this option previously.

Image after changing selection:

1 Like

Yep - ImportUnderCurrentLayer.py (1.5 KB)
Still works??

-Pascal

It works as desired. Fantastic. Thank you. :grinning:

ok but with this setting also copy paste from another file should work…

i tried to find this kind of setting in the advanced settings.
seams like it is called
Rhino.Options.FileSettings.ImportFileLayerMatchingOptions
default value 0

I first found it by going through the advanced settings looking for what could be the cause of the difference in how Pascal’s scripts worked on my system. Then I found the corresponding place to change it in Options.