Jump to content
Developer Wiki and Function Reference Links ×

CombinePolygons()


MullinRJ

Recommended Posts

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:

 

image.png.14f19a50412ccda945807594f44994ff.png

 

   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

Link to comment
  • 6 months later...

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);

Link to comment

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

Link to comment

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);

Screenshot 2024-04-05 at 4.54.56 PM.png

Edited by DCarpenter
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...