Hide Table of Contents
InsertUntrimSurface2 Method (IFeatureManager)

Extends a surface along its natural boundaries or fills interior surface holes, optionally trimming outside these boundaries or holes.

.NET Syntax

Visual Basic (Declaration) 
Function InsertUntrimSurface2( _
   ByVal FaceUntrimType As System.Integer, _
   ByVal EdgeUntrimType As System.Integer, _
   ByVal Distance As System.Double, _
   ByVal BMerge As System.Boolean, _
   ByVal BTrimOppositeSide As System.Boolean _
) As Feature
Visual Basic (Usage) 
Dim instance As IFeatureManager
Dim FaceUntrimType As System.Integer
Dim EdgeUntrimType As System.Integer
Dim Distance As System.Double
Dim BMerge As System.Boolean
Dim BTrimOppositeSide As System.Boolean
Dim value As Feature
 
value = instance.InsertUntrimSurface2(FaceUntrimType, EdgeUntrimType, Distance, BMerge, BTrimOppositeSide)
C# 
Feature InsertUntrimSurface2( 
   System.int FaceUntrimType,
   System.int EdgeUntrimType,
   System.double Distance,
   System.bool BMerge,
   System.bool BTrimOppositeSide
)
C++/CLI 
Feature^ InsertUntrimSurface2( 
&   System.int FaceUntrimType,
&   System.int EdgeUntrimType,
&   System.double Distance,
&   System.bool BMerge,
&   System.bool BTrimOppositeSide
) 

Parameters

FaceUntrimType
Untrim face edge type as defined by swFaceUntrimType_e; valid only if a face is selected
EdgeUntrimType
Connect endpoints or extend edges as defined by swEdgeUntrimType_e; valid only of one or more edges are selected
Distance
Distance by which to untrim the surface
BMerge
True to create a surface extension that merges with the original surface, false to create a new, separate surface body
BTrimOppositeSide
True to remove the surface outside the selected surface edges or interior surface holes, false to not; valid only if BMerge is false

Return Value

Pointer to the IFeature object

Example

'VBA

'This example creates a planar polygonal surface, untrims (extends) the surface outside the selected face edges,
'and trims (removes) the surface inside the selected face edges.
'=======================================================================
'Preconditions: Ensure that the specified template exists.
'
'Postconditions:
'1. Creates Surface-Plane1.
'2. Creates Surface-Untrim1 by untrimming outside all edges of the selected face, not merging with the original part, and trimming inside all edges of the selected face.
'3. Click on Surface-Untrim1. The untrimmed areas are in green.
'========================================================================
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim swPart As SldWorks.PartDoc
Dim skSegment As SldWorks.SketchSegment
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long

Sub main()

    Set swApp = Application.SldWorks
 
    Dim swSheetWidth As Double
    swSheetWidth = 0
    Dim swSheetHeight As Double
    swSheetHeight = 0
    Set Part = swApp.NewDocument("C:\ProgramData\SolidWorks\SOLIDWORKS 2024\templates\Part.prtdot", 0, swSheetWidth, swSheetHeight)
    Set swPart = Part
    Set Part = swApp.ActiveDoc
    Part.SketchManager.InsertSketch True
    boolstatus = Part.Extension.SelectByID2("Front Plane", "PLANE", -4.90383108306059E-02, 3.86835343160318E-02, 3.91373764799244E-03, False, 0, Nothing, 0)
    Part.ClearSelection2 True
    Set skSegment = Part.SketchManager.CreateLine(-0.035002, 0.035119, 0#, 0.025668, 0.036519, 0#)
    Set skSegment = Part.SketchManager.CreateLine(0.025663, 0.036519, 0#, 0.025201, -0.016451, 0#)
    Set skSegment = Part.SketchManager.CreateLine(0.025201, -0.016451, 0#, -0.068137, -0.018551, 0#)
    Set skSegment = Part.SketchManager.CreateLine(-0.068137, -0.018551, 0#, -0.067204, 0.026718, 0#)
    Set skSegment = Part.SketchManager.CreateLine(-0.067204, 0.026713, 0#, -0.036169, 0.026251, 0#)
    Set skSegment = Part.SketchManager.CreateLine(-0.036169, 0.026251, 0#, -0.035002, 0.035119, 0#)
    Part.ClearSelection2 True
    Part.SketchManager.InsertSketch True
    Part.SelectionManager.EnableContourSelection = True
    boolstatus = Part.Extension.SelectByID2("Sketch1", "SKETCHREGION", 2.26345552080154E-02, -0.013184045043844, 0, True, 1, Nothing, 0)
    boolstatus = Part.InsertPlanarRefSurface()
    Part.ClearSelection2 True
    boolstatus = Part.Extension.SelectByRay(-4.08355377464196E-02, 1.83176555033939E-02, 0, 0, 0, -1, 7.93376161930438E-04, 2, True, 0, 0)
    Part.FeatureManager.InsertUntrimSurface2 0, 2, 0, False, True
    Part.SelectionManager.EnableContourSelection = False

End Sub

Remarks

This method:

  • is valid only for surface parts.
  • requires preselection of the face or edges you want to untrim.

For learn more about Untrim Surfaces, see the SOLIDWORKS Help > Parts and Features > Features > Surfaces > Surface Controls > Untrim Surface topic.

 

See Also

Availability

SOLIDWORKS 2024 FCS, Revision Number 32


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   InsertUntrimSurface2 Method (IFeatureManager)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2024 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.