Gets a single object class.
Visual Basic |
---|
Public Function GetObjectClass( _ ByVal ObjectClass As Long _ ) As ObjectClass |
' Identify the object. Dim oObjVer As MFilesAPI.ObjVer '... ' Get the value of class property. Dim oPropertyValues As MFilesAPI.PropertyValues = oVault.ObjectPropertyOperations.GetProperties(oObjVer) Dim oPropertyValue As MFilesAPI.PropertyValue = oPropertyValues.SearchForProperty( _ MFilesAPI.MFBuiltInPropertyDef.MFBuiltInPropertyDefClass) ' As this is class property, the data type is always "Lookup value". If oPropertyValue.TypedValue.DataType <> MFilesAPI.MFDataType.MFDatatypeLookup Then Throw New SystemException("Internal error") End If ' The value of lookup item is the class id. Resolve the class object. Dim iClassId As Integer = oPropertyValue.TypedValue.GetLookupID() Dim oObjectClass As MFilesAPI.ObjectClass = oVault.ClassOperations.GetObjectClass(iClassId) ' Resolve the class name. Dim szClassName As String = oObjectClass.Name