Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an ilogic that I create that will export a part to a stp file in a specific folder on our server and it lets the designer know to the file has been exported with a message box. Is there a way to add a hyperlink to the that message box of the folder using the BatchPlotFolder so the designer can jump directly to it.
'Validates the document is a part
Dim oDoc As PartDocument = ThisDoc.Document
If oDoc.DocumentType = Inventor.DocumentTypeEnum.kPartDocumentObject Then
Dim partname As String = ThisDoc.FileName(False) & " REV-" & iProperties.Value("Project", "Revision Number")
iProperties.Value("Custom", "LC") = partname &".stp"
iProperties.Value("Project", "Part Number") = partname
Dim folderpath As String = oDoc.File.FullFileName
'defines backslash as the subdirectory separator
Dim strCharSep As String = System.IO.Path.DirectorySeparatorChar
'find the postion of the last backslash in the path
FNamePos = InStrRev(folderpath, "\", -1)
'get the file name with the file extension
Name = Right(folderpath, Len(folderpath) -FNamePos)
'get the path of the folder containing the file
Folder_Location = Left(folderpath, Len(folderpath) -Len(Name) -1)
'Server Main Folder Location
Dim FilePath As String = "X:\7 - Design\0 - Batch Plot Drawings\" + Folder_Location.Substring(16)
Dim NewFilePath As String = FilePath + "\"
'Used to check folder location path
'i = MessageBox.Show("The Value you entered was incorrect " & NewFilePath, "My iLogic Dialog", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
Dim NewPathName As String = "X:\7 - Design\0 - Batch Plot Drawings\" + Folder_Location.Substring(16) + "\" + partname
Dim BatchPlotFolder As String = "X:\7 - Design\0 - Batch Plot Drawings\" + Folder_Location.Substring(16) + "\"
'If folders doesn't exist then create the folders
If Not System.IO.Directory.Exists(BatchPlotFolder) Then
System.IO.Directory.CreateDirectory(BatchPlotFolder)
End If
'Save .stp in new file path
ThisDoc.Document.SaveAs(NewPathName + ".stp", True)
i = MessageBox.Show("Your file has been exported to the batch plot folder.", "Congrats", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)
Else
i = MessageBox.Show("This must be run on a part file!", "Wrong File Type", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
Return
End If
Solved! Go to Solution.