Path Property (ActiveX)

Gets the path of the block, document, application, or external reference.

Supported platforms: Windows only

Signature

VBA:

object.Path
object

Type: Application, Block, Document, ExternalReference, PointCloud, PointCloudEx

The objects this property applies to.

Property Value

Read-only: Yes; except for the ExternalReference and Block objects

Type: String

The path of the application, document, or external reference.

Remarks

No additional remarks.

Examples

VBA:

Sub Example_Path()
    ' This example returns the path of the drawing and application.
    
    ' If the drawing has not been saved, the path of the
    ' document will be blank.
    Dim docPath As String
    docPath = ThisDrawing.Path
    MsgBox "The Path of the current drawing is " & docPath, , "Path Example"
    
    Dim appPath As String
    appPath = ThisDrawing.Application.Path
    MsgBox "The Path of the current appication is " & appPath, , "Path Example"
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Path()
    ;; This example returns the path of the drawing and application.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; If the drawing has not been saved, the path of the
    ;; document will be blank.
    (setq docPath (vla-get-Path doc))
    (alert (strcat "The Path of the current drawing is " docPath))
    
    (setq appPath (vla-get-Path acadObj))
    (alert (strcat "The Path of the current appication is " appPath))
)