|
ExtensionGetLocalPath Method
|
Returns the local path from the PDM file object.
Namespace:
CADSharpTools.PDM
Assembly:
CADSharpTools.PDM (in CADSharpTools.PDM.dll) Version: 1.4.16.0 (1.4.16)
Syntax public static MethodReturn<string> GetLocalPath(
this IEdmFile5 file
)
<ExtensionAttribute>
Public Shared Function GetLocalPath (
file As IEdmFile5
) As MethodReturn(Of String)
Parameters
- file
- Type: IEdmFile5
File object
Return Value
Type:
MethodReturnStringMethodReturn of the local path.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEdmFile5. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Exceptions Remarks The method does not require the PDM object ID of the file's folder as opposed to the built-in GetLocalPath(Int32).
Examples
This example shows how to print the local path of the first file found at the root of folder of a PDM vault.
using CADSharpTools.Commons;
using EPDM.Interop.epdm;
using System;
using System.Diagnostics;
namespace CADSharpTools.PDM.Tests
{
class Test
{
public enum EdmLoginFlags
{
Nothing,
WebClient
}
[STAThread]
static void Main(string[] args)
{
var swPDMVault = new EdmVault5();
var swPDMVaultEx = swPDMVault as IEdmVault13;
swPDMVaultEx.LoginEx("Admin", "****", "CADSharp LLC", (int)EdmLoginFlags.Nothing);
var swPDMRootFolder = swPDMVaultEx.RootFolder;
var swPDMFirstFilePos = swPDMRootFolder.GetFirstFilePosition();
if (swPDMFirstFilePos.IsNull == false)
{
var swPDMFirstFile = swPDMRootFolder.GetNextFile(swPDMFirstFilePos);
var localPathRet = swPDMFirstFile.GetLocalPath();
if (localPathRet.IsError == false)
Debug.Print($"First local path: {localPathRet.Value}");
else
Debug.Print($"Error occurred while getting local path : {localPathRet.Error}");
}
else
{
Debug.Print($"Vault has no files at the root folder.");
}
}
}
}
See Also