Jump to content
Developer Wiki and Function Reference Links ×

Rename Ordnance Survey Classes with prefix OS-


Dexie

Recommended Posts

I have been using this script for some time, it a prefix of OS- in front of all Classes in a drawing and it is used on Ordnance Survey Maps.

I would like to modify it to rename only those classes that begin with G80. This is so that I can prefix Ordnance Survey Classes in a drawing that contains many other classes already added to the drawing.

This is the vectrscrip as it stands:-

Procedure RenameClasses;

VAR

ClassName,NewName:STRING;

i: INTEGER;

BEGIN

i:=1;

REPEAT

ClassName:= ClassList(i);

NewName:= Concat( 'OS-',ClassName );

RenameClass ( ClassName, NewName );

i:=i+1;

UNTIL i = (ClassNum+1);

Sysbeep;

AlrtDialog('Renaming classes is complete!');

END;

Run (RenameClasses);

I am not experienced in vectorscript so any help would be much appreciated.

Edited by Dexie
Link to comment

Hi Dexie,

A very easy fix.

Raymond

Procedure RenameClasses;
{ Add "OS-" to the front of classes that begin with "G80". }
CONST
Prefix = 'G80';
VAR
ClassName, NewName :STRING;
i :INTEGER;

BEGIN
i := 1;
REPEAT
	ClassName:= ClassList(i);
	if (pos(Prefix, ClassName) = 1) then begin		{ only do next 2 lines if condition is met }
		NewName:= Concat( 'OS-', ClassName );
		RenameClass ( ClassName, NewName );
	end;
	i:=i+1;
UNTIL i = (ClassNum+1);

Sysbeep;
AlrtDialog('Renaming classes is complete!');

END;
Run (RenameClasses);

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