Hyperlink in Message Box

Hyperlink in Message Box

KWarrenCA
Advocate Advocate
409 Views
1 Reply
Message 1 of 2

Hyperlink in Message Box

KWarrenCA
Advocate
Advocate

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

 

0 Likes
Accepted solutions (1)
410 Views
1 Reply
Reply (1)
Message 2 of 2

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

Hi @KWarrenCA . Add this to your code:

BatchPlotFolder = "X:\7 - Design\0 - Batch Plot Drawings\"
i = MessageBox.Show("Open folder path?", "Open folder!", MessageBoxButtons.YesNo,
					MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)
If i = vbYes Then
	System.Diagnostics.Process.Start("explorer.exe", "/select,""" & BatchPlotFolder & """")
End If

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature