Jump to content
Developer Wiki and Function Reference Links ×

Counting Symbols Inside of a Symbol


Recommended Posts

I seem to be a bit lost here. I have a selection of symbols (that have symbols inside of them),I want to count the quantity of a specific symbol inside of the selected symbols. I'm not sure how to traverse through the individual symbol parts to find the particular symbol i want to count. Believe me, I have tried with no luck. Any hints to this issue?

Thanks in advance

Jeff Miller

Link to comment

Hi Jeff,

???Try the following "untested" code snippet to step inside and count your embedded symbols. You can use an outer WHILE loop to step through the selected objects, or give this snippet a function name and use ForEachObjectInLayer(), pick your poison.

HTH,

Raymond

{ for each selected symbol instance pointed to by SymHnd, step inside and look around }

H := FInSymDef(GetObject(GetSymName(SymHnd)));

while (H<>nil) do begin

???if (GetType(H)=15) & (GetSymName(H)=TargetSymName) then

?????? Cnt := Cnt + 1;

???H := NextObj(H);

end;

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