Sam Jones Posted January 17, 2020 Share Posted January 17, 2020 Is there a way to get the bounding box (x1,y1,x2,y2) of a group. I want to create a group and then get its bounding box. Selecting the objects and then grouping them does not yield a handle to the group SelectObj(((Criteria))); Group; GrpObj := LNewObj: {GrpObj returns nil here} I would like to get a handle to the group and then get its bounding box, but that doesn't seem to work. Quote Link to comment
Pat Stanford Posted January 17, 2020 Share Posted January 17, 2020 It seems to work here. Procedure GroupBB; Var X1,Y1,X2,Y2:Real; Begin GetBBox(FSActLayer,X1,Y1,X2,Y2); AlrtDialog(Concat(GetTypeN(FSActLayer),' - ',X1,' - ',Y1,' - ',X2,' - ',Y2)); End; Run(GroupBB); Quote Link to comment
Pat Stanford Posted January 17, 2020 Share Posted January 17, 2020 Probable that Group does not change LNewObject. Try the Waldo Method. Insert Locus, LNewObj,GetPrev(LNewObject), Delete Locus. I think this was originally disclosed by @Gerard Jonker back around 2002. Quote Link to comment
MullinRJ Posted January 18, 2020 Share Posted January 18, 2020 Sam, A new Group is always created on top of the stacking order, so if you are on a design or sheet layer, LActLayer will return a handle to a new Group. If you are drawing inside a container, you can use the Waldo method that Pat mentioned. With the handle you can then get the Group's BBox. Raymond Quote Link to comment
Sam Jones Posted January 18, 2020 Author Share Posted January 18, 2020 Thank you ...again Raymond. 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.