Use filename of 2D file, to fill in iproperties - Inventor 2024

Use filename of 2D file, to fill in iproperties - Inventor 2024

jens_herrebaut83
New Member New Member
88 Views
5 Replies
Message 2 of 6

Use filename of 2D file, to fill in iproperties - Inventor 2024

jens_herrebaut83
New Member
New Member

Hi,

 

Is there a way to save a 2D file (ex: Title-desciption-customer.idw) and it automatically fills in the iproperties of that 2D file?

 

 

@jens_herrebaut83 Your post title was modified to add the product name and version and to increase findability - CGBenner

 

 

0 Likes
89 Views
5 Replies
Replies (5)
Message 1 of 6

andrewiv
Advisor
Advisor

This could be done with iLogic as long as the same format is used for your filenames all the time.

Andrew In’t Veld
Designer / CAD Administrator

Message 3 of 6

jens_herrebaut83
New Member
New Member

yes, the filename would be the same all the time. 

What steps do I have to do for that?

0 Likes
Message 4 of 6

CGBenner
Community Manager
Community Manager

@jens_herrebaut 

Hello, and welcome to the forum!  This is something that might be possible through some custom programming.  I will move this to the Inventor Programming forum for the experts there to look at and off some advice.  Can you tell us what version of Inventor you are using?  Thank you!

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

0 Likes
Message 5 of 6

jens_herrebaut83
New Member
New Member

I'm using 2024

0 Likes
Message 6 of 6

andrewiv
Advisor
Advisor

Here is a quick rule that will get you what you want.  I used a custom property for Client but you can assign that value to any property.

Try
	Dim oDoc As Document = ThisApplication.ActiveEditDocument
	Dim oName As String = ThisDoc.FileName(False)
	Dim oFirstDashPos As Integer = InStr(oName, "-")
	Dim oSecondDashPos As Integer = InStr(oFirstDashPos + 1, oName, "-")
	Dim oTitle As String = Left(oName, oFirstDashPos -1)
	Dim oClient As String = Mid(oName, oFirstDashPos + 1, oSecondDashPos - oFirstDashPos - 1)
	Dim oDesc As String = Right(oName, Len(oName) - oSecondDashPos)
	
	iProperties.Value("Summary", "Title") = oTitle
	iProperties.Value("Custom", "Client") = oClient
	iProperties.Value("Project", "Description") = oDesc
Catch
End Try

 

Andrew In’t Veld
Designer / CAD Administrator