News:

Please note new Forum URL: forum.designcad.com

Main Menu
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.

Permanate Layer Name Change

Started by Paul, December 31, 2007, 01:56:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Paul

I want to change the name of some of my layers permanently. Save as default isn't doing the trick. Ideas?
DesignCAD 3D Max 18

The Scud

If this is to be your 'default' drawing space, you would be best to set your drawing space as a template with layers already named. You could have a template set up for each drawing sheet you print to. IE A3 landscape, A4 Landscape, A4 Pictorial etc. Is this what you want? If so, I have gor my drawing sheet/space set with my layers named with linetype etc and in modelspace, I have a seires of concentric circles drawn on each layer then saved as StdDrawingSpace or something similar. That way, I know my linetypes etc stay there.
BETA tester from long ago.
User of:
SolidWorks 2024, CREO10 and TurboCAD Professional.
FIM Senior Technical Steward for MotoGP.
Work at: Semi-retired..

Mark Laing

'Or you could try a macro.
'Cut and paste this code into a text file named Change Layer Name.d3m
'and save it in the designcad directory
''''''''''''''''''''''''''''''''''''''''''''''''
'Change Layer Name.d3m
sys(800) = 0
INCLUDE "*\DcadAlias.d3i"
'''''''''''''''''''''''''''''
input "New Layer name?", name$
Sys$(93) = name$
regen
>Save
{
}
end
'You have to mouse over the name in the layer toolbox to see it, but it's done.

Paul

Hmm, let me tell you my end game and maybe you guys can tell me the best way to go.

I work in a cabinet shop. I'm using DC as a file converter from a program/machine that creates a line drawing of a room to a CNC machine that needs to receive a DXF file that has uses layer names to tell it which tool (router bit) to use when cutting out parts.

So, I'm not going to ever print anything out on paper from DC. I say that because the help files tell me to create a template from within  a paper space. But it doesn't have an option to save layer names, not that I can see. Advice?
DesignCAD 3D Max 18

Rob S


So, let me understand.

The input from the "a program/machine that creates a line drawing" does or does not not contain the layer names? 

If it does, and you import the file into DCAD, the layer names should come with it.

If not, are the layer names always the same, in the same order??

If so, then I would say a macro to run after the import which would cycle through your layers and name them would be best.  Someone else would have to help with the macro, I'm not expert in that.

You can't pre-name the layers, because DCAD imports the file into empty un-named layers.
User since forever

Bob P

SYS$(93) is the name of the current layer, so you could write a macro something like this...

currentlayer=sys(3) 'Store current layer

sys(3)=1 'Change to layer 1
sys$(93)=mylayername1 'Name the layer
sys(3)=2 'Change to layer 2
sys$(93)=mylayername2 'Name the layer
...
repeat through all your named layers

sys(3)=currentlayer 'Return to original layer

end

Lar

Paul, once you change the name of a layer using the Layer Dialogue Box ('L' key or 'Options' menu> Layer...) it becomes permanent for that file. Of course, if you don't Save the file (File menu> Save...) before closing the new names will be lost. The 'Save As Default' button saves the names, colors and linestyles for new files that you start later.

If you don't know how to name/rename a layer, here's how:

1] Press the 'L' key (or 'Options' menu> Layer...), which opens the Layer Dialogue Box...
2] Click on the number of the layer you want to change. It will highlight in blue...
3] Either:
    3a] Type the desired name in the 'Name' field below the section with the layer names. If it has a name already just drag the mouse over the entire name to highlight it then type the new name over it;
    Or:
    3b] Click the number again. The highlight will become a text field with a blinking cursor. Type the name you want there. If the layer has a name already it will be highlighted already so just type over it...

4] Lastly, click any other layer number, or press the Tab key, to lock in the layer name.

When you are done with the Layer Dialogue Box click OK or press Enter. If you click Cancel the new names will be lost. Save the file so that the new names will be there when the file is reopened. If, however, you export to DXF (or whatever) before saving then the exported file will have the new layer names.

Lar

ps: using any of the BasicCAD examples posted above will also make the new name permanent.

Paul

The input from the "a program/machine that creates a line drawing" does or does not not contain the layer names? It does not.

The 'Save As Default' button saves the names, colors and linestyles for new files that you start later. I am not finding that to be the case.

I'm at home now but I'll tackle more of these suggestions in the morning. Thanks a bunch for all you guys input so far!
DesignCAD 3D Max 18

Lar

Quote from: Paul on January 02, 2008, 03:52:36 PM

The 'Save As Default' button saves the names, colors and linestyles for new files that you start later. I am not finding that to be the case.


Paul, you are right. The 'Save As Default' button only saves the colors and linestyles, not the layer names.

If the layer order is always the same you could name the layers as needed in one of your files, save it under its own name, then 'Save As' under something like 'Template.dcd'. Next time you want to import, open the template file, 'Save As' with a new name, turn on and unlock all the layers, Select All and delete everything. Then import the new file. Since your imports do not have layer names already, the existing layer names should stick.

Otherwise, Bob P's macro suggestion should work. If you have trouble with it you can post a list of your layer numbers and names and I will post back the macro.

Lar

Paul

Sorry about the delay in responce here...
I want layer 1 to be "Wall". All others can stay nameless.

I'm trying to keep the quantity of steps to a min. Is there a way within a macro to select all and assign this layer to it. (If I need to use a different layer # that's fine.) I already have a macro recorded that selects all, combines, make a plane, extrude and rotate. Can I add this new macro stuff within that one? (I hope I' not getting too greedy here.)
DesignCAD 3D Max 18

Rob S


I know you can do this on the screen by simply turning on all layers, selecting all, bring up info box, and set the layer to 1.  Done.

I'm sure a macro to cycle through all of your entities and set their layer to "1" is easily doable by some macro experts here.
User since forever

mjkoski

Hi Paul,
         I think if you run BobP's macro information and add -

>Selectall
  {
    }

>DuplicateToLayer
{
  <layer [modellayer] 'layer name you are using -want the stuff placed
  }
     -where needed may work.

Paul

Thanks for the macro text but I don't have the slightest idea where to enter this info...
DesignCAD 3D Max 18

DrollTroll

#13
Open the macro you already have in your fave text editor. Presumably, somewhere in your macro you have a SelectAll command...

i.e.

'some macro preliminary stuff may or may not be present
>SelectAll
{
}
'more stuff like Extrude, rotate, etc.

Open the macro in your fave text editor.
Immediately after the lines
>SelectAll
{
}


add the following lines:

Sys(3) = 1
Sys$(93) = "Wall"
>ApplyLayer
{
}


save the macro (ideally under a new name, just in case you messed up).

I humbly advise against the "DuplicateToLayer" suggestion, as this will make COPIES of your existing geometry instead of just moving it to the desired layer.
25 years with DesignCAD