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: 

extract iProperties without opening the file

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
Anonymous
2275 Views, 11 Replies

extract iProperties without opening the file

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
11 REPLIES 11
Message 2 of 12
Anonymous
in reply to: Anonymous

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
Message 3 of 12
Anonymous
in reply to: Anonymous

Hi Geert,

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

Thanks,

Hans
Message 4 of 12
Anonymous
in reply to: Anonymous

Could this be done with VBA in Inventor 2009? Anybody?

Hans
Message 5 of 12
Anonymous
in reply to: Anonymous

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

ALink
Message 6 of 12
Anonymous
in reply to: Anonymous

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
Message 7 of 12
Anonymous
in reply to: Anonymous

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
Message 8 of 12
Anonymous
in reply to: Anonymous

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.
Message 9 of 12
Anonymous
in reply to: Anonymous

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?
Message 10 of 12
Anonymous
in reply to: Anonymous

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
Message 11 of 12
Anonymous
in reply to: Anonymous

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
Message 12 of 12
Anonymous
in reply to: Anonymous

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

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report