OhGeorgie Posted September 19, 2006 Share Posted September 19, 2006 I've got a question about handles. I previously made a couple of plug-ins that create PFC, UB and UC symbols for the UK structural steel sections but now I'm working on the hollow sections so I need to make an poly for the outside of the square section and another for the inside and then clip them and remove the inside. I can draw the two: ClosePoly; BeginPoly; MoveTo(50, 0); LineTo(90,0); ArcTo(100,0,10*3/4); ArcTo(100,100,10*3/4); ArcTo(0,100,10*3/4); ArcTo(0,0,10*3/4); LineTo(50,0); EndPoly; BeginPoly; MoveTo(50, 10); ArcTo(90,10,10/2); ArcTo(90,90,10/2); ArcTo(10,90,10/2); ArcTo(10,10,10/2); LineTo(50,10); EndPoly; PopAttrs; For example gives a 100x100x10 SHS. How can I use ClipSurfaces(s1,s2, HANDLE) and tell it that s1 and s2 are those two previous poly's that i just drew? Also will that keep s2 the same so I can delete it once it's clipped? Thanks Quote Link to comment
Jonathan Pickup Posted September 19, 2006 Share Posted September 19, 2006 as you create the first object get a handle to it, there is a procedure to get a handle to the last created object, make this object s1 then when you create the next object, get a handle the last created object, make that s2. Then use your clip procedure. Quote Link to comment
OhGeorgie Posted September 20, 2006 Author Share Posted September 20, 2006 Jonathan, I presume you meant using s1 := LNewObj; For ClipSurface(s1,s2) I used the example in the manual and I've done: ClipSurface(s1,s2); s3 := PrevObj(s2); DelObject(s2); Is that necessary because s1 is no longer an object so I need to redefine it as s3 now? s2 is not changed so I can still refer to it as thus and delete it yeah? Thanks for your help btw. I've got it working pretty well now and I'm adding handles to some previous scripts i've written which opens new doors. Just trying to get my head around some of the procedures. Quote Link to comment
Jonathan Pickup Posted September 20, 2006 Share Posted September 20, 2006 I?m glad i could help. Quote Link to comment
Miguel Barrera Posted September 21, 2006 Share Posted September 21, 2006 An alternate method would be the following code: ClosePoly; BeginPoly; MoveTo(50, 0); LineTo(90,0); ArcTo(100,0,10*3/4); ArcTo(100,100,10*3/4); ArcTo(0,100,10*3/4); ArcTo(0,0,10*3/4); LineTo(50,0); EndPoly; ClipHdl:= LNewObj; BeginPoly; MoveTo(50, 10); ArcTo(90,10,10/2); ArcTo(90,90,10/2); ArcTo(10,90,10/2); ArcTo(10,10,10/2); LineTo(50,10); EndPoly; templateHdl:= LNewObj; IF AddHole(ClipHdl,templateHdl) THEN BEGIN {Delete template} DelObject(templateHdl); {Change clipped poly color to diagonal pattern & gray} SetFPat(ClipHdl,25); SetFillBack(ClipHdl,50000,50000,50000); END; I would prefer this method because it indicates whether the clip was successful or not. Furthermore, the method ClipSurface has changed over the years and if you need a handle to the clipped poly, its handle location may change in the future. 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.