Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic access to Filename iProperty

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
SteveX82
3394 Views, 5 Replies

iLogic access to Filename iProperty

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?

5 REPLIES 5
Message 2 of 6

 

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

 

 

Message 3 of 6

Thanks, Curtis! I'm not very good with API, so I think you may over overestimated my gleaning abilities.... Smiley Very Happy

 

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?

Message 4 of 6
rjay75
in reply to: SteveX82

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.

Message 5 of 6
SteveX82
in reply to: rjay75

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!

Message 6 of 6
chanseman
in reply to: SteveX82

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

 

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

Post to forums  

Autodesk Design & Make Report