Jump to content
Sign in to follow this  
Musisback

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?

Share this post


Link to post

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

Share this post


Link to post

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;

Share this post


Link to post

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.

Share this post


Link to post

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.

Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...