J. Miller Posted July 29, 2007 Share Posted July 29, 2007 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 Quote Link to comment
MullinRJ Posted July 29, 2007 Share Posted July 29, 2007 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; Quote Link to comment
J. Miller Posted July 29, 2007 Author Share Posted July 29, 2007 That's the ticket. I glad to see I'm not the only one reading / writing code on a Sunday. I was getting hung up with the FinSymDef function. Thanks Raymond, Jeff Quote Link to comment
MullinRJ Posted July 29, 2007 Share Posted July 29, 2007 My pleasure, Jeff. Glad I could help. - R 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.