Jump to content
Developer Wiki and Function Reference Links ×

Getting the active symbol definition


Recommended Posts

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?

Link to comment

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

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