Macro to export "File name" and "iProperty - Keyword" to a XLS database. Exists? Sugestions?

FilipeMais
Advocate
Advocate

Macro to export "File name" and "iProperty - Keyword" to a XLS database. Exists? Sugestions?

FilipeMais
Advocate
Advocate

Hello everybody,

 

In my company I am updating all old drawings to Inventor files.

 

Thousands of drawings to update and RENAME is also a condition.

 

To help the colleagues in the warehouse I thought to create a table with the "New names" and the "Old names".

The "Old name" are written in "iProperty - Keyword".

 

Is there any macro that could be added in Inventor that could feed/create a database with that information?

 

Would be great if I had a button on Inventor that charge that table after save the file and stored in Vault.

 

 

Table with two columns:

New file name - Old file name.

 

 

Thanks in advance!

 

All the best,

Filipe

 

0 Likes
Reply
Accepted solutions (1)
262 Views
2 Replies
Replies (2)

JelteDeJong
Mentor
Mentor
Accepted solution

If you don't mind working with CSV files. (Which can also be opened with Excel) then you could use this iLogic rule.

' Change the path on the next line to whatever you need.
Dim exportedFilesPath = "c:\temp\test.csv"
Dim doc As Document = ThisDoc.Document
Dim prop = doc.PropertySets.Item("Inventor Summary Information").Item("Keywords")

Dim fileInfo As New System.IO.FileInfo(exportedFilesPath)

Dim excelRow = String.Format("{0}|{1}", doc.FullFileName, prop.Value)


Dim lines As New List(Of String)
If (Not System.IO.File.Exists(exportedFilesPath)) Then
    lines.Add("sep=|")
End If
lines.Add(excelRow)

System.IO.File.AppendAllLines(exportedFilesPath, lines)

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

FilipeMais
Advocate
Advocate

@JelteDeJong Muito obrigado!!! Funciona muito bem!

 

Para evitar o texto "C:/Workplace/Designs..." tentei substituir a variável "Inventor Summary Information" pela variável "Part number", mas aparece uma mensagem de erro.

 

Qual variável deve ser escrita ali?

 

Atenciosamente,

Filipe

0 Likes