Again an iProperty question

Again an iProperty question

b.graaf
Advocate Advocate
734 Views
6 Replies
Message 1 of 7

Again an iProperty question

b.graaf
Advocate
Advocate

I have looked in the forum and on internet, but still did not find if this is possible.

 

Within Windows Explorer, you can read the iProperties of an Inventor file.

 

I would like to do this within an Inventor Add-in and without actually opening the file (for performance/speed).

I know, there is the apprentice option, but this does not work within an Addin and as far as I am right it still opens the file.

 

In my code, I select a directory with Inventor files and would like to do something with only the files with some sepcific text within an iProperty.

 

Because there can be a lot of files in that directory and I only want to process a few specific files, with the sepcific value in some properties, I would not like to open al files, only to read the iProperties.

Instead I would like to check some iProperties and if the values are what I am looking for, I will open the file and process it.

 

Does anybody know if this can be done?

 

Best Regards,

Branko.

0 Likes
735 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable

I tried to perform the task that you mentioned, and I think that if you want to access to an iprop of a file, you need to have a connection with that file. I mean that if you want to access to a part, at least you need to open it or you need to have that part in an assembly, otherwise you'll get "READ ONLY" error.

This is the personal experience of a neophyte in ilogic, but a master level google searcher.

0 Likes
Message 3 of 7

ekinsb
Alumni
Alumni

The data you want to look at is in the file so it's impossible to read that information without opening the file.  Even when you use Explorer to look at iProperties, the file is being opened.  The trick is how much of the file is being read and loaded?  Inventor files use Microsoft technology that breaks up the data within the file into logical units so only the portions of the file that are needed need to be read into memory.  That's what Explorer is using so it's opening the file but only reading the iProperty information from it.  The same it true with Apprentice.  The initial open, opens the file in a minimal way and then additional data is loaded depending on which API calls are used.  If you just call iProperty related API functions then that's all that gets loaded.  Apprentice also supports a way of saving just the iProperty portion of a file if you also want to edit iProperties.

 

Inventor is also optimized in this way.  In general much more is loaded when you open a file in Inventor because it needs to read graphics data to display the model and also some modeling information to build the browser.  However, when you open a document in Inventor there is an option to open it invisibly.  If you do this it opens it in a minimal way and using the iProperties portion of the API will cause the iProperty portion of the document to load.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 4 of 7

YuhanZhang
Autodesk
Autodesk

Consider the performance I think the ApprenticeServer is the best option foryour purpose anyway. If you application is an addin in Inventor you may call an out-of-process application(which use the ApprenticeServer) to do this. 



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 5 of 7

mslosar
Advisor
Advisor
I asked this same type of question before and never got very far.

Is there some sort of phrasing that'd let you open an IDW invisibly without having it have to track down all it's associated ipt/iam files? I just need to access the titleblock. We've got files (largely due to network issues) that can take 10-15+ minutes to open) and i'd like to try and grab the titleblock info substantially faster than that.

I have added defer updates, but it doesn't seem to help much.
0 Likes
Message 6 of 7

ekinsb
Alumni
Alumni

There probably isn't a way to speed this up very much.  Even with the title block there could be fields that are dependent on referenced documents so when a file is opened, Inventor wants to load those dependencies to make sure everything is up to date.

 

I haven't tried this, but one thing to try would be to have a seperate project that doesn't point to any directories outside of itself and to temporarily copy the drawing into the workspace path for that project, have that project active, and open the drawing.  Inventor will fail to find any of the references.  You will need to set the SilentOperation property to avoid the dialogs about missing references but I'm guessing it will open much quicker.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 7 of 7

mslosar
Advisor
Advisor
Hmm..interesting idea. I'll have to try that 🙂

I'm pretty sure you were talking inventor in the general sense, but none our titleblocks refer to linked anything. The closest thing they refer to is the custom properties of the sheet itself.

Just have to figure out where to put an empty project, where I have write access and everyone else can get to it 🙂
0 Likes