VectorGeek Posted July 14, 2011 Share Posted July 14, 2011 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) Quote Link to comment
Pat Stanford Posted July 14, 2011 Share Posted July 14, 2011 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. Quote Link to comment
VectorGeek Posted July 14, 2011 Author Share Posted July 14, 2011 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. Quote Link to comment
JBenghiat Posted July 15, 2011 Share Posted July 15, 2011 This is a case where you have to use the where's waldo technique: SymbolToGroup(symH, 1); locus(0,0); waldo:=LNewObj; symH:=PrevObj(waldo); delObject(waldo); -Josh Quote Link to comment
VectorGeek Posted July 15, 2011 Author Share Posted July 15, 2011 And Waldo worked perfectly. Thanks Pat and Josh! V-G. 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.