Solid Edge Part Type Library
AddMeshControl Method
Control on body/face/edge
Type of size control
-1 if Default, 1 to 10 if subjective
Tetrahedral mesh growth ratio
Allow mid-side nodes or not
Type of mesh elements
Element mesh sizing for face and edge
Number of elements or size
Number of elements
Number of elements on lines
Number of elements on closed edges
Description
Add a mesh control – body/edge/face.
Syntax
Visual Basic
Public Sub AddMeshControl( _
   ByRef arrstudyGeomProxies() As Object, _
   ByVal iMeshCtrlType As Integer, _
   ByVal iMCtrlSizeType As Integer, _
   ByVal dMCtrlSize As Double, _
   ByVal dMCtrlSizeCustom As Double, _
   ByVal dMCtrlTetGRatio As Double, _
   ByVal bMidSideNodes As Boolean, _
   ByVal iSurfElemType As Integer, _
   ByVal dMCtrlElemSize As Double, _
   ByVal bUseNumElements As Boolean, _
   ByVal iNumElements As Integer, _
   ByVal bUseElemsOnLines As Boolean, _
   ByVal iNumElemsOnLines As Integer, _
   ByVal bUseElemsOnClosedE As Boolean, _
   ByVal iNumElemsOnClosedE As Integer, _
   ByVal bUseElemsOnOtherE As Boolean, _
   ByVal iNumElemsOnOtherE As Integer, _
   ByRef ppMeshCtrl As Object _
) 
Parameters
arrstudyGeomProxies
iMeshCtrlType
Control on body/face/edge
iMCtrlSizeType
Type of size control
dMCtrlSize
-1 if Default, 1 to 10 if subjective
dMCtrlSizeCustom
dMCtrlTetGRatio
Tetrahedral mesh growth ratio
bMidSideNodes
Allow mid-side nodes or not
iSurfElemType
Type of mesh elements
dMCtrlElemSize
Element mesh sizing for face and edge
bUseNumElements
Number of elements or size
iNumElements
Number of elements
bUseElemsOnLines
iNumElemsOnLines
Number of elements on lines
bUseElemsOnClosedE
iNumElemsOnClosedE
Number of elements on closed edges
bUseElemsOnOtherE
iNumElemsOnOtherE
ppMeshCtrl
Example
Imports System.IO
Imports System.Runtime.InteropServices

Module Example
    <STAThread()> _
    Sub Main()
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objPartDocument As SolidEdgePart.PartDocument = Nothing
        Dim objStudyOwner As SolidEdgePart.StudyOwner = Nothing
        Dim objStudy As SolidEdgePart.Study = Nothing
        Dim objMeshOwner As SolidEdgePart.MeshOwner = Nothing
        Dim objMeshControl As SolidEdgePart.MeshControl = Nothing
        Dim objModel As SolidEdgePart.Model = Nothing
        Dim objExtProt As SolidEdgePart.ExtrudedProtrusion = Nothing
        Dim objEdges As SolidEdgeGeometry.Edges = Nothing
        Dim objProxiesArray(1) As Object
        Dim nMeshCtrlType As Integer = 2
        Dim nMCtrlSizeType As Integer = 2 ' Type of size control - Default, Subjective, Custom
        Dim dMCtrlSize As Double = 3.0 ' -1 if Default, 1 to 10 if subjective
        Dim dMCtrlSizeCustom As Double = 0.0028366052049647972 '
        Dim dMCtrlTetGRatio As Double = 1.1 ' Tetrahedral mesh growth ratio - Exposed via VT
        Dim bMidSideNodes As Boolean = True ' Allow mid-side nodes or not
        Dim nSurfElemType As Integer = 1 ' Type of mesh elements in case of surface - quad/tri
        Dim dMCtrlElemSize As Double = 0.0125 ' Element mesh sizing for face & edge - Exposed via VT
        Dim bUseNumElements As Boolean = True ' User number of elements or use element size
        Dim nNumElements As Integer = 1 ' Number of elements - if this value is less than 1 then
        Dim bUseElemsOnLines As Boolean = False
        Dim nNumElemsOnLines As Integer = 1 ' Number of elements on Lines - Exposed via VT
        Dim bUseElemsOnClosedE As Boolean = False
        Dim nNumElemsOnClosedE As Integer = 12 ' Number of elements on closed edges - Exposed via VT
        Dim bUseElemsOnOtherE As Boolean = False
        Dim nNumElemsOnOtherE As Integer = 1 ' Number of elements on other edges - Exposed via VT

        Try
            OleMessageFilter.Register()

            ' Connect to Solid Edge
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")
            objPartDocument = objApplication.ActiveDocument

            objStudyOwner = objPartDocument.StudyOwner
            objStudy = objStudyOwner.Item(1)
            objStudy.GetMeshOwner(objMeshOwner)

            ' Get Model
            objModel = objPartDocument.Models.Item(1)

            ' Get Protrusion.
            objExtProt = objModel.ExtrudedProtrusions.Item(1)

            ' Get Edges Colection
            objEdges = objExtProt.Edges(SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryAll)

            ' Store edge proxies in vector
            objProxiesArray(0) = objEdges.Item(3)
            objProxiesArray(1) = objEdges.Item(4)

            ' Create Mesh Control
            objMeshOwner.AddMeshControl(objProxiesArray, _
                                        nMeshCtrlType, _
                                        nMCtrlSizeType, _
                                        dMCtrlSize, _
                                        dMCtrlSizeCustom, _
                                        dMCtrlTetGRatio, _
                                        bMidSideNodes, _
                                        nSurfElemType, _
                                        dMCtrlElemSize, _
                                        bUseNumElements, _
                                        nNumElements, _
                                        bUseElemsOnLines, _
                                        nNumElemsOnLines, _
                                        bUseElemsOnClosedE, _
                                        nNumElemsOnClosedE, _
                                        bUseElemsOnOtherE, _
                                        nNumElemsOnOtherE, _
                                        objMeshControl)

        Catch ex As Exception
            Console.WriteLine(ex.Message)
        Finally
            OleMessageFilter.Revoke()
        End Try
    End Sub
End Module
See Also

MeshOwner Object  | MeshOwner Members  | Solid Edge ST3 - What's New