Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
chandra.shekar.g
in reply to: Anonymous

@Anonymous,

 

Try this. Can you please provide sample path of WorkspacePath and ThisDoc.Path.

 

WorkspacePath = ThisDoc.WorkspacePath()

WorkspacePathLength = Len(WorkspacePath)

PathOnly = ThisDoc.Path

Pathlength = Len(PathOnly)

If Pathlength > WorkspacePathLength Then
	DirectoryPath = Strings.Right(PathOnly, Pathlength - WorkspacePathLength)
Else
	DirectoryPath = Strings.Right(PathOnly, WorkspacePathLength - Pathlength)
End If  

PDFPath = "\\sbs 2011\files\Z\Tegninger PDF"

If(Not System.IO.Directory.Exists(PDFPath)) Then
    System.IO.Directory.CreateDirectory(PDFPath)
End If

ThisDoc.Document.SaveAs(PDFPath & "\" & ThisDoc.FileName(False) & ".pdf" , True)

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network