Ola Posted November 19, 2019 Share Posted November 19, 2019 Hi, I've been roaming around in here trying to figure out if it possible to write a script that can assign class name to a symbol. I have a symbol library the I need to modify the class names. The symbol contains only one class. Or is it an easier way maybe? Cheers, Ola Quote Link to comment
Pat Stanford Posted November 19, 2019 Share Posted November 19, 2019 Yes this can be scripted, but you will either need to learn how to work with Resource Lists or walk the symbol definitions manually. I think walking it manually for a 1 time use might be easier. H1:=FSymDef returns a handle to the first symbol definition in the file. Check if that symbol definition has a class that needs to be replaced (whatever that means in your case). If it does need to be replaced, then use SetClass or SetClassN to change the class if not do nothing. NextObj(H1); Procedure Pseudocode: Var H1:Handle; Begin H1:=FSymDef; While H1<>Nil do Begin If GetClass(H1)='Class to Replace' then SetClass(H1,'NewClassName'); H1:=NextObj(H1); End; End; Run(Pseudocode); Quote Link to comment
Ola Posted November 20, 2019 Author Share Posted November 20, 2019 Thank you, I will give it a try! Cheers, Ola Quote Link to comment
Pat Stanford Posted November 21, 2019 Share Posted November 21, 2019 Ask again if you need more help. 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.