Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
FilipeMais
247 Views, 2 Replies

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

FilipeMais
Enthusiast
Enthusiast

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

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

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

 

2 REPLIES 2
Message 2 of 3
JelteDeJong
in reply to: FilipeMais

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

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

Message 3 of 3
FilipeMais
in reply to: FilipeMais

FilipeMais
Enthusiast
Enthusiast

@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

@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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report