jplante Posted July 8, 2009 Share Posted July 8, 2009 I was wondering if there is a way to create a script that would change all class properties to no fill, set the all the classes to one color (RGB: 204, 204, 255) and all to one line weight (.15) The biggest hang up I would think, would be having the script change everything inside of blocks without converting them to groups. Any one even know where to begin with this? Thanks so much, J Quote Link to comment
Jonathan Pickup Posted July 9, 2009 Share Posted July 9, 2009 if you are only changing the classes, you do not need to enter blocks. you do need to cycle through all the classes and edit each class, you can use a loop to do this, or you might be able to use the for each object function Quote Link to comment
jplante Posted July 9, 2009 Author Share Posted July 9, 2009 Right now I am doing everything manually and it does not change the color of items inside symbols when I edit the class properties. Quote Link to comment
MullinRJ Posted July 9, 2009 Share Posted July 9, 2009 J, What you want is somewhat easy to do, especially changing the class attributes. Using the ForEachObject commands is a little tricky, but with a few examples, it's not all that hard. Remember to run this script on a COPY of your work. Going backwards in not as easy unless you don't use Class Attributes at all in your files. Here's a quick and dirty script that makes the changes you outlined (I think) .... PROCEDURE Homogenize; VAR ???I :Integer; ???ClassName :String; ???function SetByClass(H :Handle) :Boolean; ???{ Set Fill Pattern, Pen Color, Line Style & Line Weight to be "ByClass". } ???Begin ??????SetFPatByClass(H); ??????SetPenColorByClass(H); ??????SetLSByClass(H); ??????SetLWByClass(H); ???End; { SetByClass } BEGIN ???{ Change Attributes of all Classes to affect Fill Pattern, Line Style, Pen Color, and Line Weight. } ???for I := 1 to ClassNum do begin ??????ClassName := ClassList(I); ??????SetClFPat(ClassName, 0); { No Fill } ??????SetClLS(ClassName, 2); { Solid Foreground Pen } ??????SetClPenFore(ClassName, 52428, 52428, 65535); { Pen Color = RGB(255) x 257 } ??????SetClLW(ClassName, 6); { Line Weight in mils } ???end;??????{ for } ???{ if you need to change all objects to accept "Attributes By Class", then do the following... } ???ForEachObjectInLayer(SetByClass, 0, 2, 1); { all objects on all layers, active layer=0, 2, 0 } ???ForEachObjectInList(SetByClass, 0, 2, FSymDef); { all objects within symbol definitions } ???SysBeep; { sound when done } END; Run(Homogenize); HTH, Raymond Quote Link to comment
Miguel Barrera Posted July 9, 2009 Share Posted July 9, 2009 Right now I am doing everything manually and it does not change the color of items inside symbols when I edit the class properties. If objects inside the symbols are not changing is because they are not using the class attributes. Edit the symbol and use the attribute palette to change each object's settings. Quote Link to comment
jplante Posted July 28, 2009 Author Share Posted July 28, 2009 I have been absent from work for a while, but I just wanted to thank everyone for their help! You guys ROCK!!!! 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.