Sewing shapes together


Your Ad Here


Topsolid online Help Index

This example shows how to sew several shapes together.

 

Dim TopDoc As TopSolid.DocumentDesign

 

...

    Dim nshs As Integer

    Dim ish As Integer

    Dim ix As Integer

    Dim sh As TopSolid.Shape

    Dim vsh As Variant

    Dim shs() As TopSolid.Shape

    Dim vshs As Variant

    Dim vsewnshs As Variant

    

    ' get document sheet shapes

 

    nshs = TopDoc.Shapes.Count

    ReDim shs(nshs - 1)

    ish = 0

    

    For ix = 1 To TopDoc.Shapes.Count

    

        Set sh = TopDoc.Shapes(ix)

        

        If sh.Type = topShapeTypeSheet Then

        

            Set shs(ish) = sh

            ish = ish + 1

        

        Else

        

            nshs = nshs - 1

            

        End If

        

    Next ix

 

    ReDim Preserve shs(nshs - 1)

 

    ' sew shapes together

 

    vshs = shs

    Call doc.Shapes.Sew(vshs, 2, 0.00001, vsewnshs)

    

    ' clean + simplify shapes

    

    For Each vsh In vsewnshs

    

        Set sh = vsh

        

        Call sh.CleanGeometry(0.00001, 0.001)

        

        Call sh.SimplifyGeometry(0.00001, 0.001)

        

    Next

...

 

 

Topsolid online Help Index

Your Ad Here