Jump to content
Developer Wiki and Function Reference Links Read more... ×
Sign in to follow this  
grant_PD

Create new layer/Create new Class

Recommended Posts

I'm looking for a way to create new layer, new class from either a context window (right click) on the document workspace or by keyboard command. But there's no menu option for create new layer/new class. One must open up a dialog box to do so.

Is this possible?

Share this post


Link to post

you could easily create a menu item that asked for a name, then created that class. I made a tool that when you clicked on a object, it made a class with those graphic attributes.

Share this post


Link to post

You could also use the Workspace Editor to add the Layers... and Classes... menu items to either a menu with a shortcut or the contextual menu. (Then command/cntrl-N to create a new one).

-Josh

Share this post


Link to post

There's a lot of moving about to different palettes, to the point where it's slowing down my workflow. I realized this as I was working in photoshop today. My workflow is to know that I need/want a new layer, create layer on the fly/worry about naming it later, keep drawing.

VW makes organization so time consuming that I find that I'm not paying enough attention to the actual drawing itself.

Share this post


Link to post

Here is a start on a script to do what you want. It creates a new layer with the same scale as the current layer and a dummy name including the date so you don't end up with a duplicate.

You could easily make this into a menu command and assign it a keyboard shortcut.

Use as you see fit.

Procedure MakeSL;

{creates a new layer with a name of Scratch plus the date. Assigns it a light grey }
{layer color, and sets the layer scale the same as the active layer.}
{Use at your own risk.}

{November 15, 2011}
{? 2011, Coviana, Inc - Pat Stanford pat@coviana.com}
{Licensed under the GNU Lesser General Public License}

const  Fore=30583;  {RBG Value for light/medium Grey}
 Back=61166;  {RGB for light Grey}
var

H1,ALH:	handle;
L1:	string; {Scratch Layer Name}
R1:	real;

Procedure SetLayerColors;
Begin
LPenFore(Fore,Fore,Fore);
LPenBack(Back,Back,Back);
LFillBack(Back,Back,Back);
LFillFore(Fore,Fore,Fore);
end;

begin

L1:=concat('Scratch ',date(2,1)); {Set the layer name to date/time}
ALH:=ActLayer;

if GetLayerByName(L1)=nil then 
begin
	R1:=GetLScale(ActLayer);
	Layer(L1);
	SetScale(R1);
	SetLayerOptions(4); {Show/Snap Others}

	h1:=FLayer;
	While h1<> nil do
		begin
			Layer(GetLName(h1));
			SetLayerColors;
			h1:=NextLayer(h1);
		end;
end;

	Layer(L1);
	SetPref(11,True);
	RedrawAll;
end;

Run(MakeSL);

Share this post


Link to post

Not a problem. If you need help, just ask. I just happened to have this script that I mostly wrote back in 2008 for someone else.

I will be happy to help with modifications or lessons on how to make it a menu item. Just ask.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×