Excel VBA to export a value from a cell to iProperties?

Excel VBA to export a value from a cell to iProperties?

fabianrebora
Enthusiast Enthusiast
766 Views
4 Replies
Message 1 of 5

Excel VBA to export a value from a cell to iProperties?

fabianrebora
Enthusiast
Enthusiast

 

I need to export the existing values in the cells (example columan C) to the properties of the path files in column H.

 

Captura de pantalla completa 21092018 112659 a.m..bmp.jpg

If someone could help me, I will be very grateful

0 Likes
Accepted solutions (2)
767 Views
4 Replies
Replies (4)
Message 2 of 5

bradeneuropeArthur
Mentor
Mentor

 

You can use apprentice for this...

 

Regards,

Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Dimension Component! | Partlist Export! | Derive I-properties! | Vault Prompts Via API! | Vault Handbook/Manual!
Drawing Toggle Sheets! | Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 5

fabianrebora
Enthusiast
Enthusiast

Sorry, I Can't understand your answer

Message 4 of 5

Anonymous
Not applicable
Accepted solution

Apprentice is basically a lightweight backdoor for inventor.  See this article for more details. 

 

http://modthemachine.typepad.com/my_weblog/2010/03/iproperties-without-inventor-apprentice.html

 

This should get you on the right path. 

0 Likes
Message 5 of 5

fabianrebora
Enthusiast
Enthusiast
Accepted solution

Thanks for putting me on the right path.
After some attempts, I did it

 

 

Public Sub Cargardatos()
' Declare a variable for Apprentice.
Dim invApprentice As New ApprenticeServerComponent


Dim r As Integer
r = 1

Line1:
' Open a document using Apprentice.
Dim invDoc As ApprenticeServerDocument
Set invDoc = invApprentice.Open(ActiveWorkbook.ActiveSheet.Cells(r + 1, 17))

 

 

Dim InvDocISI As PropertySet
Set InvDocISI = invDoc.PropertySets.Item("Inventor Summary Information")

Dim InvDocDTP As PropertySet
Set InvDocDTP = invDoc.PropertySets.Item("Design Tracking Properties")

Dim InvDocIDSI As PropertySet
Set InvDocIDSI = invDoc.PropertySets.Item("Inventor Document Summary Information")

 

' Edit the values of a couple of properties.

InvDocISI.Item("Revision Number").Value = ActiveWorkbook.ActiveSheet.Cells(r + 1, 2) ' revision
InvDocDTP.Item("Stock Number").Value = ActiveWorkbook.ActiveSheet.Cells(r + 1, 3) 'bas
InvDocIDSI.Item("Manager").Value = ActiveWorkbook.ActiveSheet.Cells(r + 1, 4) ' activo
InvDocIDSI.Item("Company").Value = ActiveWorkbook.ActiveSheet.Cells(r + 1, 5) ' clase de proveedor
InvDocISI.Item("Subject").Value = ActiveWorkbook.ActiveSheet.Cells(r + 1, 6) 'tipo
InvDocISI.Item("Title").Value = ActiveWorkbook.ActiveSheet.Cells(r + 1, 7) 'linea
InvDocIDSI.Item("Category").Value = ActiveWorkbook.ActiveSheet.Cells(r + 1, 8) 'equipo maquina
InvDocISI.Item("Keywords").Value = ActiveWorkbook.ActiveSheet.Cells(r + 1, 9) 'subconjunto
InvDocISI.Item("Comments").Value = ActiveWorkbook.ActiveSheet.Cells(r + 1, 10) ' descripcion


' Save the changes.
invDoc.PropertySets.FlushToFile

' Close the document and release all references.
Set invDoc = Nothing
invApprentice.Close
Set invApprentice = Nothing

r = r + 1

If Not IsEmpty(ActiveWorkbook.ActiveSheet.Cells(r + 1, 17)) Then GoTo Line1:

MsgBox "Terminado"

End Sub

 

 

Captura de pantalla completa 01102018 014638 p.m..bmp.jpg