Jump to content
Developer Wiki and Function Reference Links ×

Ye Olde "add prefix to layers/classes" script


Recommended Posts

  • Vectorworks, Inc Employee

Hi Grant,

Copy everything within the quote below and paste it into a script. This script only works with Class names and changes ALL class names (except "None" and "Dimension") in the active document. This could be modified to act on ALL Layer names in a document. Adding the ability to select only certain classes would be a bit more involved.

HTH,

Matt

{

Written by:

Matthew G. Panzer

PanzerCAD Services, Inc.

1997

}

PROCEDURE ChangeClassNames;

VAR

Count: INTEGER;

ClassName: STRING;

PrefixStr: STRING;

BEGIN

PrefixStr := StrDialog('Add prefix(to all classes):', 'DWG-');

IF (ClassNum>1)

AND

YNDialog('This will rename all of your classes! Are you sure you wish to continue?')

THEN

BEGIN

FOR Count := 3 TO ClassNum DO BEGIN

RenameClass( ClassList(Count), ConCat(PrefixStr, ClassList(Count)) );

END;

END;

END;

RUN(ChangeClassNames);

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...