extract iProperties without opening the file

This widget could not be displayed.

extract iProperties without opening the file

Anonymous
Not applicable
Hi,

The iProperties are exposed in the Windows Explorer with RMB-click. Is it
possible to have a macro in IV2009 that can read the iProperties without
actually opening the file?

Hans
0 Likes
Reply
Accepted solutions (1)
2,497 Views
11 Replies
Replies (11)

Anonymous
Not applicable
Hi Hans,

You can do that through the apprenticeserver.
You can read or write the iProperties.

Geert

Example:

Private Sub Vul_Prop_ApprenticeServer(strNew_Filenaam As String)
Dim oPropSets As Inventor.PropertySets

On Error GoTo ErrorHandler
If oApprenticeApp Is Nothing Then
Set oApprenticeApp = New ApprenticeServerComponent
End If
If Not oApprenticeApp.Document Is Nothing Then oApprenticeApp.Close
End If
'Open file.
Set oApprenticeServerDoc = oApprenticeApp.Open(strNew_Filenaam)
Set oPropSets = oApprenticeServerDoc.PropertySets

'Read iProperties
Dim oPropSet As Inventor.PropertySet
Dim oProp As Inventor.Property
Set oPropSet = oPropSets.Item("Design Tracking Properties")
Set oProp = oPropSet.Item("Designer")
'Read
strProp = oProp.value
'Write
oProp.Value = "YourName"
Set oProp = oPropSet.Item("Engineer")
oProp.Value = strInitialen

'for Custom iProperties
Set oPropSet = oPropSets.Item("User Defined Properties")

' Save the property changes to the document.
oApprenticeServerDoc.PropertySets.FlushToFile

GoTo Einde
Exit Sub

ErrorHandler:
GeneralErrorHandler "Vul_Prop_ApprenticeServer"

Einde:
' Release the document and apprentice references.
oApprenticeApp.Close
Set oApprenticeServerDoc = Nothing
Set oApprenticeApp = Nothing
0 Likes

Anonymous
Not applicable
Hi Geert,

Your answer is much appreciated, but the question is could is be done with
VBA in Inventor 2009.

Thanks,

Hans
0 Likes

Anonymous
Not applicable
Could this be done with VBA in Inventor 2009? Anybody?

Hans
0 Likes

Anonymous
Not applicable
Some info:
http://discussion.autodesk.com/adskcsp/thread.jspa?threadID=667014

ALink
0 Likes

Anonymous
Not applicable
The file will have to be opened but you can open it invisibly for a much
lighter load. You can read the properties and close it.
--
Brian Ekins
Autodesk Inventor API
0 Likes

Anonymous
Not applicable
OK, thanks I managed that, and it is light enough for me.

Hans


"Brian Ekins (Autodesk)" wrote in message
news:5944089@discussion.autodesk.com...
The file will have to be opened but you can open it invisibly for a much
lighter load. You can read the properties and close it.
--
Brian Ekins
Autodesk Inventor API
0 Likes

Anonymous
Not applicable
If you're using Vault you can get iProperties from the file through the Vault API. I don't know if you want to get that involved but it can definitely be done.
0 Likes

Anonymous
Not applicable
I also would like to know if there is a way to read the iProperties from a file without opening it. Does anyone know if this is possible?
0 Likes

Anonymous
Not applicable
Accepted solution
I've attached the contents of an Autodesk University class that discussed
iProperties. The last sample in the paper demonstrates using Apprentice to
access iProperties. Apprentice is a programming only component that does
not have a user-interface and provides minimal access to Inventor data,
including iProperties.
--
Brian Ekins
Autodesk Inventor API
0 Likes

Anonymous
Not applicable
I haven't looked at the attachment yet but correct me if I am wrong. Since apprentice is a member of Inventor. One would have to initialize a new instance of inventor and then apprentice to open the file and read the iproperties. Since Windows rmb properties gives access to iproperties I take it that apprentice is run with explorer being the host process? Message was edited by: nande12
0 Likes

Anonymous
Not applicable
Apprentice is a not dependent on Inventor. It is delivered as part of
Inventor but is also delivered as part of the Inventor View install (which
is freely available). I'm not sure exactly what the mechanism that the
shell extension is using from Explorer to access the property information,
but for your programs Apprentice should be the best solution.
--
Brian Ekins
Autodesk Inventor API
0 Likes