DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

named layer question

Started by Mark Laing, November 05, 2007, 07:47:39 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Mark Laing

When switching layers in a macro I use '<layer 2', for instance. Can I somehow use the name of the layer instead of its number? I'm worried that the same number will already be in use in an old drawing.
And if the layer doesn't already exist when the macro runs, will that be a problem?

Thanks in advance,
Mark.

DrollTroll

Hi Mark,

I don't think you can do that right now. Internally, DesignCAD is still using the layer numbers for organizing everything -- the layername is little more than a decoration (as far as DesignCAD is concerned, that is -- I know many users feel differently).

When we change to a layer-name-based system, that'll break a lot of existing behaviors in BasicCAD and Automation. I expect we'll get there eventually, though.
25 years with DesignCAD

prl

Possible with OLE now but not basiccad.  In OLE you can get a layer object with either index or name.

QuoteFunction Item(vIndexOrName As Variant) As Layer

Arguments:
vIndexOrName - This variable specifies which Layer object to retrieve, either by name or by numeric index.

Returns:
An object of class Layer.

Description:
The Item property returns a specific Layer object.