Musisback Posted April 13, 2011 Share Posted April 13, 2011 My plug-in processes selected object this way: H:=Fsactlayer; While (H<>nil) do BEGIN ............ ............ H:=nextSobj(H); END; I want it to work also in symbol definitions while in editing mode. I tried with H := FInSymDef(ActSymDef); But It does not work. FInSymDef seem to return the last new symbol definition and not the active one. Is there a way to still make it works? Quote Link to comment
JBenghiat Posted April 13, 2011 Share Posted April 13, 2011 If you are editing a symbol definition it is not necessarily the active symbol -- the active symbol is either the last created symbol, or what you have double-clicked in the resource browser (ie. the symbol that will insert with the symbol insertion tool). As far as I know, the only way to get a handle to a symbol definition being edited is the where's waldo method (roughly): locus(0,0); waldo:=LNewObj; hanContainer:=GetParent(waldo); {IF type of container is symbol definition then} nameSymDef:=GetName(hanContainer); hanSymDef:=GetObject(nameSymDef); h:=FInSymDef(hanSymDef); {Else get handle from layer} DelObject(waldo); -Josh Quote Link to comment
Miguel Barrera Posted April 13, 2011 Share Posted April 13, 2011 You need to call PROCEDURE SetActSymbol(name: STRING); before to set the symbol as active SetActSymbol('SymbolName'); H:=FInSymDef(ActSymDef); WHILE (H <> NIL) DO BEGIN ............ ............ H:=NextObj(H); END; Quote Link to comment
Musisback Posted April 14, 2011 Author Share Posted April 14, 2011 Thanks, Josh, I'll try this way. Miguel, I don't have the symbol's name. I want to get the handle of any symbol currently be edited by the user. if I had the name, it would indeed be easier. 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.