Solid Edge Revision Manager Object Library
Add Method
Specifies the property name.
Specifies the property value. The type specified determines the type of the property.
Description
This method adds and returns an object that specifies a new custom property.
Syntax
Visual Basic
Public Function Add( _
   ByVal Name As String, _
   ByVal Value As Variant _
) As Object
Parameters
Name
Specifies the property name.
Value
Specifies the property value. The type specified determines the type of the property.
Remarks
The newly added properties are not saved to the file until the Save method is called.
Example
Imports RevisionManager
Imports System.Runtime.InteropServices

Module Example

    Sub Main()
        Dim objApplication As RevisionManager.Application = Nothing
        Dim objDocument As RevisionManager.Document = Nothing
        Dim objPropertySets As RevisionManager.PropertySets = Nothing
        Dim objProperties As RevisionManager.Properties = Nothing
        Dim objProperty As RevisionManager.Property = Nothing

        Try
            ' Start Revision Manager.
            objApplication = New RevisionManager.Application

            objPropertySets = objApplication.PropertySets
            objPropertySets.Open("C:\Part1.par", False)
            objProperties = objPropertySets.Item("Custom")
            objProperty = objProperties.Add("My Custom Property", "My Custom String")
            objPropertySets.Save()
        Catch ex As Exception
            ' Write any errors to console.
            Console.WriteLine(ex.Message)
        Finally
            ' Release COM Objects.
            If Not (objProperty Is Nothing) Then
                Marshal.ReleaseComObject(objProperty)
                objProperty = Nothing
            End If
            If Not (objProperties Is Nothing) Then
                Marshal.ReleaseComObject(objProperties)
                objProperties = Nothing
            End If
            If Not (objPropertySets Is Nothing) Then
                Marshal.ReleaseComObject(objPropertySets)
                objPropertySets = Nothing
            End If
            If Not (objDocument Is Nothing) Then
                Marshal.ReleaseComObject(objDocument)
                objDocument = Nothing
            End If
            If Not (objApplication Is Nothing) Then
                objApplication.Quit()
                Marshal.ReleaseComObject(objApplication)
                objApplication = Nothing
            End If
        End Try
    End Sub

End Module
See Also

Properties Collection  | Properties Members

Send comments on this topic.