Dexie Posted August 17, 2006 Share Posted August 17, 2006 (edited) 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 August 17, 2006 by Dexie Quote Link to comment
MullinRJ Posted August 17, 2006 Share Posted August 17, 2006 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); Quote Link to comment
Dexie Posted August 17, 2006 Author Share Posted August 17, 2006 What a response. Works like a dream. Thanks very much. Quote Link to comment
Recommended Posts
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.