AFObject.GetPath Method (AFObject)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Returns the path to the object relative from another object.
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public string GetPath( AFObject relativeTo )
Public Function GetPath ( relativeTo As AFObject ) As String Dim instance As AFObject Dim relativeTo As AFObject Dim returnValue As String returnValue = instance.GetPath(relativeTo)
public: String^ GetPath( AFObject^ relativeTo )
member GetPath : relativeTo : AFObject -> string
Parameters
- relativeTo
- Type: OSIsoft.AFAFObject
Specifies that the path should be relative to the specified object. Use this parameter and the path returned from one of the AFObjectFindObject methods to restore this object.
Return Value
Type: StringReturns the path to the object.
Remarks
A path to an object is created by this method and can be restored from a string using one of the
AFObjectFindObject or
AFObjectFindObjects methods.
A path, such as "\\MySystem\MyDatabase\MyElement|Attribute1", can be used
to reference any object derived from AFObject.
See Path Syntax for a
complete description of the path syntax.