nickhunter00 Posted February 22, 2012 Share Posted February 22, 2012 Hi, Just a quick one...I wonder if anyone had a script which would allow me to prefix all my classes once I have already imported a DWG? It's from a big OS Map, and I simply want to put "OS-" in front of every class so that they are all tucked away neatly, rather than having the 200 odd classes in my list. Shorter (the CAD consultant at my old office) had a script which I think ran as a VSM, where you could simply highlight the classes you wanted to change, and then it would do the whole thing for you. If anyone has any ideas, please let me know! Thanks N Quote Link to comment
VincentCuclair Posted February 23, 2012 Share Posted February 23, 2012 There is an option for this in the dwg import dialog...... Quote Link to comment
Kevin McAllister Posted February 23, 2012 Share Posted February 23, 2012 There is a menu script at Vector Depot ( http://www.vectordepot.com/plug-ins/ ) that says it will do this. I haven't tried it but I think it will only do all of the Classes in a document. You don't say what version of Vectorworks you are using but its probably worth a shot. Kevin Quote Link to comment
Farookey Posted February 23, 2012 Share Posted February 23, 2012 Hi there... Here is what we use... You can make this script into a menu command as we've done... should work on every version... Enjoy! Procedure AppendStrToAllClasses; {Written by Frank Brault, ?2004} VAR numberOfClasses, classIndex : LongInt; classVisibility : Integer; className, newClassName : String; Begin newClassName := StrDialog('This command will append the string entered here to the beginning of the name of each class.', 'Import-'); If Not(DidCancel) Then Begin numberOfClasses := ClassNum; If numberOfClasses > 2 Then Begin classIndex := 0; For classIndex := 3 To numberOfClasses Do Begin className := ClassList(classIndex); classVisibility:= GetCVis(className); RenameClass(className, Concat(newClassName, className)); End; End Else AlrtDialog('No classes were appended because there are no non-standard classes in this document. The classes "None" and "Dimension" are reserved.'); End; End; Run(AppendStrToAllClasses); Quote Link to comment
Pat Stanford Posted February 23, 2012 Share Posted February 23, 2012 Nick, You do realize there is an option in the DWG import routines to add a prefix to the classes as the import is taking place don't you? Quote Link to comment
Christiaan Posted February 23, 2012 Share Posted February 23, 2012 By the sounds of things he's already imported and saved the file. Quote Link to comment
Pat Stanford Posted February 23, 2012 Share Posted February 23, 2012 That's what I thought also, but it might be easier to reimport than to find/learn a script and if he does this often it can save a step to do it at import time. 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.