Display filename in pop up message

Display filename in pop up message

joseph.cooley
Explorer Explorer
247 Views
2 Replies
Message 1 of 3

Display filename in pop up message

joseph.cooley
Explorer
Explorer

I'm trying to make a reminder that will have people select a non generic material.  When the file is saved it triggers this rule. 

 

materialName = ThisDoc.Document.ComponentDefinition.Material.Name
If materialName = "Generic" Then
	MessageBox.Show("Please update material", "Generic Material")
End If
iLogicVb.UpdateWhenDone = True

 The problem is that it doesnt tell you which file it is if there is a large assembly and a file inside is non specified.  How would I have the file say what the filename is within the popup message?

0 Likes
Accepted solutions (1)
248 Views
2 Replies
Replies (2)
Message 2 of 3

Michael.Navara
Advisor
Advisor
Accepted solution

Try this update

Dim msg = String.Format("Please update material in {0}", ThisDoc.Document.DisplayName)
MessageBox.Show(msg, "Generic Material")
Message 3 of 3

joseph.cooley
Explorer
Explorer
Yep that worked great! I added the file extension for additional clarity, Thank you!

materialName = ThisDoc.Document.ComponentDefinition.Material.Name
If materialName = "Generic" Then
Dim msg = String.Format("Please update material in {0}.ipt", ThisDoc.Document.DisplayName)
MessageBox.Show(msg, "Generic Material")
End If
iLogicVb.UpdateWhenDone = True
0 Likes