Inventor General Discussion

Inventor General Discussion

Reply
Valued Contributor
SteveX82
Posts: 69
Registered: ‎05-26-2010
Message 1 of 5 (1,157 Views)
Accepted Solution

iLogic access to Filename iProperty

1157 Views, 4 Replies
10-13-2011 10:23 AM

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?

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.

*Expert Elite*
Curtis_Waguespack
Posts: 3,000
Registered: ‎03-08-2006
Message 2 of 5 (1,147 Views)

Re: iLogic access to Filename iProperty

10-13-2011 11:24 AM in reply to: SteveX82

 

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

 

 



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Valued Contributor
SteveX82
Posts: 69
Registered: ‎05-26-2010
Message 3 of 5 (1,121 Views)

Re: iLogic access to Filename iProperty

10-14-2011 04:58 AM in reply to: Curtis_Waguespack

Thanks, Curtis! I'm not very good with API, so I think you may over overestimated my gleaning abilities.... :smileyvery-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?

Valued Mentor
rjay75
Posts: 362
Registered: ‎04-14-2005
Message 4 of 5 (1,117 Views)

Re: iLogic access to Filename iProperty

10-14-2011 05:53 AM 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.

Valued Contributor
SteveX82
Posts: 69
Registered: ‎05-26-2010
Message 5 of 5 (1,113 Views)

Re: iLogic access to Filename iProperty

10-14-2011 06:12 AM 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!

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.