CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

FullPathForTarget Property (ActiveX/ATO)

2023-1-1 21:45| 发布者: admin| 查看: 198| 评论: 0|来自: AutoCAD

摘要: 返回磁盘上文件的完整路径。

返回磁盘上文件的完整路径。

支持的平台:仅窗口

Namespace:传输利布

组装:acETransmit20.tlb

签名

VBA/VB.NET/C#:

object.fullPathForTarget
对象

类型:传递文件

此属性适用的对象。

属性值

只读:是的

类型:字符串

文件的绝对路径。

言论

没有额外的评论。

发布信息

释放:AutoCAD 2004 及更高版本

历史

  • 该接口已与该接口合并,并且该属性不再标记为仅在 AutoCAD 2010 版本的库中供 Autodesk 内部使用。ITransmittalFile2ITransmittalFileincludeInTransmittal
  • 该方法最初是在 AutoCAD 2004 版本的库中随界面一起引入的,但标记为仅供 Autodesk 内部使用。fullPathForTargetITransmittalFile

例子

VB.NET:

' Custom command that information about a file
<CommandMethod("FileInfo")> _
Public Shared Sub FileInfo()
    ' Create a transmittal operation
    Dim tro As TransmittalOperation = New TransmittalOperation()

    ' Setup the transmittal behavior
    Dim ti As TransmittalInfo = TransInfo(tro.getTransmittalInfoInterface(), _
                                          "C:\Users\Public\TransmittalAPITest\")

    ' Define file to add to the transmittal
    Dim tf As TransmittalFile = Nothing
    Dim dwgFile As String = "C:\AutoCAD\Sample\Sheet Sets\Architectural\A-01.dwg"

    ' Add file to transmittal and parse its information
    If tro.addDrawingFile(dwgFile, tf) = AddFileReturnVal.eFileAdded Then
        ' Get the current editor
        Dim acEditor As Editor = Application.DocumentManager.MdiActiveDocument.Editor

        ' Output information about the root file of the transmittal set
        ' Source and full target path to the file
        acEditor.WriteMessage(Environment.NewLine & "Source Path: " & tf.sourcePath)
        acEditor.WriteMessage(Environment.NewLine & "Full Path: " & tf.fullPathForTarget)
        acEditor.WriteMessage(Environment.NewLine & "Target SubPath: " & tf.targetSubPath)

        ' See if the root file is a drawing
        If System.IO.Path.GetExtension(tf.sourcePath).ToUpper() = ".DWG" Then
            ' Number of dependents and dependees
            acEditor.WriteMessage(Environment.NewLine & "# of Dependents: " & tf.numberOfDependents.ToString())
            acEditor.WriteMessage(Environment.NewLine & "# of Dependees: " & tf.numberOfDependees.ToString())
        End If

        ' Output file system information about the root file
        acEditor.WriteMessage(Environment.NewLine & "File Exists: " & tf.fileExists.ToString())
        acEditor.WriteMessage(Environment.NewLine & "File Size: " & tf.fileSize.ToString())
        acEditor.WriteMessage(Environment.NewLine & "File Type: " & tf.FileType.ToString())
        acEditor.WriteMessage(Environment.NewLine & "Include in transmittal: " & tf.includeInTransmittal.ToString())
        acEditor.WriteMessage(Environment.NewLine & "Date/Time: " & tf.lastModifiedTime.ToLongDateString() & "  " &
                                                                    tf.lastModifiedTime.ToLongTimeString())
        acEditor.WriteMessage(Environment.NewLine & "Type: " & tf.type.ToString())
        acEditor.WriteMessage(Environment.NewLine & "Version: " & tf.version.ToString())
    End If
End Sub

C#:

// Custom command that information about a file
[CommandMethod("FileInfo")]
public static void FileInfo()
{
    // Create a transmittal operation
    TransmittalOperation tro = new TransmittalOperation();

    // Setup the transmittal behavior
    TransmittalInfo ti = TransInfo(tro.getTransmittalInfoInterface(), @"C:\Users\Public\TransmittalAPITest\");

    // Define file to add to the transmittal
    TransmittalFile tf = null;
    string dwgFile = @"C:\AutoCAD\Sample\Sheet Sets\Architectural\A-01.dwg";

    // Add file to transmittal and parse its information
    if (tro.addDrawingFile(dwgFile, out tf) == AddFileReturnVal.eFileAdded)
    {
        // Get the current editor
        Editor acEditor = Application.DocumentManager.MdiActiveDocument.Editor;

        // Output information about the root file of the transmittal set
        // Source and full target path to the file
        acEditor.WriteMessage(Environment.NewLine + "Source Path: " + tf.sourcePath);
        acEditor.WriteMessage(Environment.NewLine + "Full Path: " + tf.fullPathForTarget);
        acEditor.WriteMessage(Environment.NewLine + "Target SubPath: " + tf.targetSubPath);

        // See if the root file is a drawing
        if (Path.GetExtension(tf.sourcePath).ToUpper() == ".DWG")
        {
            // Number of dependents and dependees
            acEditor.WriteMessage(Environment.NewLine + "# of Dependents: " + tf.numberOfDependents.ToString());
            acEditor.WriteMessage(Environment.NewLine + "# of Dependees: " + tf.numberOfDependees.ToString());
        }

        // Output file system information about the root file
        acEditor.WriteMessage(Environment.NewLine + "File Exists: " + tf.fileExists.ToString());
        acEditor.WriteMessage(Environment.NewLine + "File Size: " + tf.fileSize.ToString());
        acEditor.WriteMessage(Environment.NewLine + "File Type: " + tf.FileType.ToString());
        acEditor.WriteMessage(Environment.NewLine + "Include in transmittal: " + tf.includeInTransmittal.ToString());
        acEditor.WriteMessage(Environment.NewLine + "Date/Time: " + tf.lastModifiedTime.ToLongDateString() + "  " +
                                                                    tf.lastModifiedTime.ToLongTimeString());
        acEditor.WriteMessage(Environment.NewLine + "Type: " + tf.type.ToString());
        acEditor.WriteMessage(Environment.NewLine + "Version: " + tf.version.ToString());
    }
}

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-11 20:36

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部