I am trying to use the iProperties.Value("part1", "Summary", "iProperty") function to get the filename or complete filepath of a component within a subassembly. I know that these iProperties exist because I can insert them onto a drawing, and I see them in the general tab of the iProperty window.
However, when I try something like:
filename = iProperties.Value("part1", "General", "Filename")
I get an error message indicating that the General tab can't be found. How might I go about getting this filename iProperty, or is there an easier way?
Solved! Go to Solution.
Solved by rjay75. Go to Solution.
Hi SteveX82,
I did a lot of this in this example:
http://inventortrenches.blogspot.com/2011/08/copy-design-and-revision-rolling-with.html
I think you should be able to glean what you need from there.
Also, you might find more information on customization and ilogic over here as well:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Thanks, Curtis! I'm not very good with API, so I think you may over overestimated my gleaning abilities....
I've stumbled across a couple of examples of code (including your's) that retrieve component filenames, but they all seem to loop through all components in an assembly to do so. Is there a way to use something like the "FullFileName" code, but attach it to a single, specific component in the browser instead?
I've stabilized all of my browser names, and all I want to do is have a single line of code similar to:
filename = Component.InventorComponent("block1").FullFileName
I can see the component filename is a half-dozen locations, but does iLogic lack a simple way to capture that filename and throw it into a string parameter?
This will get you the file path name of an component.
Component.InventorComponent("TestName").Definition.Document.FullFileName
I'm sure there's probably a shorter way too.
That's exactly what I was looking for. I figured I was just missing a few words from my code, but I had no clue what to add.
Thanks again to both of you!
Dim invDoc = ThisApplication.Documents.Open("C:\Users\Chanseman\Downloads\Part1.ipt", False) Dim invSUMProperties As PropertySet = invDoc.PropertySets.Item("Inventor Summary Information") Dim invDTProperties As PropertySet = invDoc.PropertySets.Item("Design Tracking Properties")
MessageBox.Show(invDTProperties.Item("Description").Value, "Description")
'Examples 'invDTProperties.Item("Description").Value 'invSUMProperties.Item("Revision Number").Value