Jtoo Posted February 20, 2008 Share Posted February 20, 2008 I'm trying to write a script that will change the font of an already existing text box inside a group. My question is how do I assign a handle to an already existing object without actually clicking on it. I need the script to do this on its own. Quote Link to comment
Ben624 Posted February 20, 2008 Share Posted February 20, 2008 You could give the text box a name (it's the first field under the 'Data' tab in the object info palette) and then get the handle using tbH := getObject('name') where tbH is your handle and name is the name you have assigned. Quote Link to comment
Pat Stanford Posted February 20, 2008 Share Posted February 20, 2008 First, every object has a handle. What you need to do if determine the correct handle, not assign a handle. If the group the only thing selected on the drawing? If the text box the only one inside the group? If so, then you can get a handle to the group [FSActLayer], use that to get a handle to the first object inside the group [FinGroup] and then step through the objects in the group until you find the text. Something like (untested) H1:=FSActLayer; H2:=FinGroup(H1); While H2 <> Nil do Begin if GetType(H2)=TEXT then Begin {Edit your text here} End; H2:=NextObj(H2); {Point to the next object in the group} end; Pat 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.