Jump to content
Developer Wiki and Function Reference Links ×

Assign class name on symbols


Ola

Recommended Posts

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

Link to comment

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);

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