Jump to content
Developer Wiki and Function Reference Links ×

Scaling symbol inside a PIO


Recommended Posts

Hey gurus,

I am creating a fairly simple plug-in that grabs a symbol from an external file, converts said symbol to a group and then scales it according to a parameter. Sounds simple, but this code does not scale the symbol:

Symbol(TheSymbolName,0,0,0);

hNew := LNewObj;

SymbolToGroup(hNew,2);

hScale2D(hNew,0,0,iscale,iscale,FALSE);

The following code does work, but I lose the ability to set the scaling origin point:

Symbol(TheSymbolName,0,0,0);

hNew := LNewObj;

DoMenuTextByName('Convert to Group Chunk',1);

Scale(iscale,iscale);

I have tested to ensure that the handle is being passed to the symbol and that the scaling variable is working. Any thoughts?

V-G

VW 2010, SP4

Mac OS 10.6.6

1975 AMC Gremlin (with 8-Track)

Link to comment

I don't have time to actually try it now, but in the first case, isn't your handle still pointing to the symbol instance, not to the group created by the SymbolToGroup?

I don't know if LNewObject catches the conversion to group. If not, you can use the Waldo method (I think Gerard Jonkers coined the name and maybe came up with the method.) Insert a locus, LNewObject, Get the handle to the previous object, delete the locus.

Link to comment

Hi Pat,

Thanks for taking a quick look. I did notice that the handle was not being passed to the ungrouped object, but adding another LNewObj doesn't work. I am guessing that is because Ungrouping doesn't really create a new object in VS's mind.

Now reverting to Waldo.

V-G.

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