MullinRJ Posted September 14, 2023 Share Posted September 14, 2023 Has anyone ever gotten this function to work? The function's description in the Script Function Reference and on the Developer's WIKI reads as follows: There is not much else to go on. I've tried it with 2 Polygons, with 2 Polylines, and with a Polygon and Polyline. In all cases, two vertices of each were touching. Reversing directions of one or both Polys did not help. Tried in VW 2024 and in VW 2015 with the same results. Also there is no description for the function of the dFDuzz input, nor is there an expected range of input values. I tried 0, 1, 2, 0.1, 0.5, 0.01, 0.001, 0.0000001, 1.1, 2.5, 8, 10, 100, 1000, 10000000, all to no avail. I even tried negative values – Nada. To answer an obvious question; yes, the handles passed in were tested to be valid, and the handle returned was NIL on every try. Any guidance would be appreciated. Thanks, Raymond Quote Link to comment
Maarten DE Posted September 14, 2023 Share Posted September 14, 2023 Seems to work fine here... Windows 10 VW2024. PROCEDURE Test; VAR poly1, poly2, polyOut : HANDLE; BEGIN Poly( 0,0, 10,0, 10,10, 0,10 ); poly1 := LNewObj; Poly( 5,5, 15,5, 15,15, 5,15 ); poly2 := LNewObj; polyOut := CombinePolygons( poly1, poly2, 0 ); END; Run(Test); 1 Quote Link to comment
Maarten DE Posted September 14, 2023 Share Posted September 14, 2023 And this does not work, so I guess they need to overlap? PROCEDURE Test; VAR poly1, poly2, polyOut : HANDLE; BEGIN Poly( 0,0, 10,0, 10,10, 0,10 ); poly1 := LNewObj; Poly( 10,0, 20,0, 20,10, 10,10 ); poly2 := LNewObj; polyOut := CombinePolygons( poly1, poly2, 1 ); END; Run(Test); 1 Quote Link to comment
MullinRJ Posted September 14, 2023 Author Share Posted September 14, 2023 Thank you @Maarten DE, You clarified the use of this command for me. I was assuming it was akin to the menu Modify>Compose which joins two polys to make a longer poly, when it actuality it is akin to the menu Modify>Add Surface. The function's description, or lack thereof, left me hanging once again. Many thanks, Raymond 1 Quote Link to comment
DCarpenter Posted April 5 Share Posted April 5 Using the example above, how do I use the CallToolByName('Compose') to join two polygons created within the script? Should be simple but what am I missing? PROCEDURE Test; VAR poly1, poly2, polyOut : HANDLE; TF : BOOLEAN; BEGIN Poly( 0,0, 10,0, 10,10, 20,10 ); poly1 := LNewObj; Poly( 0,0, -10,0, -10,10, -20,10 ); poly2 := LNewObj; SetSelect(poly1); SetSelect(poly2); TF:=CallToolByName('Compose'); END; Run(Test); Quote Link to comment
Jesse Cogswell Posted April 5 Share Posted April 5 You have a couple of options. You can use AddSurface and feed in the two polys as in polyOut := AddSurface(poly1,poly2), which will result in a final polyline object, or you can use DoMenuTextByName('Compose',0) on the selection to force a compose command, resulting in a polygon object. Quote Link to comment
DCarpenter Posted April 5 Share Posted April 5 Jesse, thank you. I wasn't familiar with the those two similar commands DoMenuTextByName and CallToolByName. The AddSurface option gave me some intersecting geometry which didn't allow me to extrude the polyline after it was created, but the DoMenuTextByName option gave me exactly what i needed. REALLY REALLY appreciate your help. Dave Quote Link to comment
DCarpenter Posted April 5 Share Posted April 5 (edited) PROCEDURE Test; VAR poly1, poly2, polyOut : HANDLE; TF : BOOLEAN; BEGIN Poly( 0,0, 10,0, 10,10, 20,10 ); poly1 := LNewObj; Poly( 0,0, -10,0, -10,10, -20,10 ); poly2 := LNewObj; SetSelect(poly1); SetSelect(poly2); DoMenuTextByName('Compose',0); END; Run(Test); My apologies for dragging out this thread, but I can't figure out why I can't execute the example above in my larger script that I'm writing. I've tested and checked that I do have the two polygons (the blue objects in the screen shot below) selected that I want to combine, and that they are the only two things selected before executing the DoMenuTextByName('Compose',0) command. But for some reason, the two poly's don't combined. If I convert the PIO into a group and grab the two poly's myself, I can execute the Compose command and they combine correctly which proves to me that the two poly's are touching each other and can be combined. Hoping there might be someone smarter than I that can help me figure this out. Happy to provide the code or VWX file if that's helpful. Dave BeginPoly; ...... EndPoly; h1:=LNewObj; BeginPoly; ...... EndPoly; h2:=LNewObj; DSelectAll; SetSelect(h1); SetSelect(h2); DoMenuTextByName('Compose',0); Edited April 5 by DCarpenter Quote Link to comment
DCarpenter Posted April 10 Share Posted April 10 I've moved my issue above to it's own thread so I don't highjack this thread. 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.