Creating sublayers from a macro

(John Schindler) #1

Is it possible to create sublayers from a macro?


Sure, just use the double-colon syntax.

-layer new “Parent Layer::Child Layer::GrandchildLayer”

Double quotes are required if your layers have spaces in their names, otherwise they aren’t required.

(John Schindler) #3

That’s it - thanks!
Is this a documented feature? I couldn’t find it anywhere.

(Pascal Golay) #4

Hi John - that is an excellent question - it may not be, I don’t see it yet… I’ll see if I can figure out where best to add it if it is not in there someplace, probably under both the Layer command and under the bit that covers macros.


(Margaret Becker) #5

So I can figure this out, where/how did you look for this information?

(Margaret Becker) #6

Pascal, how did you know this? Do you remember?


Hey Margaret,

Not Pascal here… This layer/sublayer syntax is known by people who write scripts, as it’s needed for a lot of layer related functions. However, I’m not sure I’ve seen it in a help file anywhere, it might just be something that has been passed along in forum posts among scripters/developers…


(Wim Dekeyser) #10

And perhaps worth noting is that when you round-trip e.g. a STEP file, the layer hierarchy is flattened and the resulting layers get the parent::child long name.