Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
CattabianiI
2149 Views, 29 Replies

❗ Inventor Apprentice 2022 - cannot retrieve master propertysets

Apprentice is widely use to get iProperties from outside Inventor,  the manual statesIf only the FullFileName is specified for part and assembly documents, the master document within the file is opened.
This is no longer true in Inventor 2022, what I get now are the property sets of factory document in the latest saved model state.
This definitely breaks any apprentice based application.

Could you please confirm this behaviour and let me know when it will be fixed?

Labels (2)
nmunro
in reply to: CattabianiI

The 2022 API added a FilePropertySets property to the Document object. This property returns the master document property sets whereas the PropertySets property returns the property sets from the currently active model state document. You should be able to access this from an ApprenticeServer app as long as you update the Inventor Interop reference to the 2022 version.

        


https://c3mcad.com

CattabianiI
in reply to: nmunro

FilePropertySets is not an ApprenticeServerDocument property and it does not work indeed.

FilePropertySet is equivalent to the iProperties that got from Shell Extension and you're right to suppose that a property like that should work in apprentice but it doesn't

nmunro
in reply to: CattabianiI

Agreed, it does seem like they have missed this in the 2022 apprentice server implementation. I tried a couple of ideas but there didn't appear to be a way to get to the master property sets.

        


https://c3mcad.com

JaneFan
in reply to: CattabianiI

Hello @CattabianiI , 

 

Sorry for the inconvience. We've already tracked this issue and will try to provide a fix in the coming release. 




Jane Fan
Inventor QA Engineer
chrisw01a
in reply to: JaneFan

Hey guys/gals, I have a similar issue here do you think this is related?

 

https://forums.autodesk.com/t5/inventor-ilogic-api-vba-forum/help-with-sdk-quot-copy-design-quot-cop...

 

chrisw01a
in reply to: JaneFan

Is this why my part number is not being written?  The code gets the correct part number, but it does not write it into the "part number" field in iProperties.

 

---

'Get the iProperty "part number" from the current document.
Dim partNumber As Inventor.Property = openedDoc.FilePropertySets.Item("Design Tracking Properties").Item("Part Number")
'Set the partnumber field
partNumber.Value = renamePartNumber(dwgDoc)

 

---

 

 

 

Working with part 54321-101.ipt and renaming it to 99999-101.ipt

The "renamePartNumber" routine just strips out the "-101" which seems to be working fine.

 

During debug, if I hover on "partNumber.Value", I get the correct value which in this case is "-101", but it does not get written to the iProperties, it is left blank.

 

chrisw01a_0-1635424769107.png

 

 

 

JaneFan
in reply to: CattabianiI

Hello @chrisw01a ,  

 

As @CattabianiI  mentioned in another thread that PropertySets.FlushToFile  is needed to make the property change be written back to the file. Do you have this step in your code?




Jane Fan
Inventor QA Engineer
chrisw01a
in reply to: JaneFan

I do not yet but I will give it a try.  How can I know if I am manipulating the properties for "Master" model state or any other model state?

 

Thanks

chrisw01a
in reply to: JaneFan

Here is what I get when I try your suggestion:

 

chrisw01a_0-1635516143056.png

 

chrisw01a
in reply to: JaneFan

I feel like I do not have the correct reference to "Autodesk.Inventor.Interop.dll"

How can I tell?  One time I changed it and then my project would not build stating something about requiring .NET 4.0 or something...

 

chrisw01a_0-1635516371221.png

 

CattabianiI
in reply to: CattabianiI

As I said in the other thread you have to update the .NET framework of your project to 4.8, update the inventor reference that you can find here: C:\Program Files\Autodesk\Inventor 2022\Bin\Public Assemblies
and then fix the compile errors due to this big update on your project.
After that looking into objects through watcher in VS or checking the inventor api manual you can find which modelstate FilePropertySets is referring to. 

chrisw01a
in reply to: CattabianiI

I really appreciate your help.  I have the Inventor reference updated now, but I don't understand how to update the project to .NET 4.8.  Do I need to install something?

chrisw01a
in reply to: CattabianiI

I think I got it updated.  Lol

 

chrisw01a_0-1635518417466.png

 

chrisw01a
in reply to: CattabianiI

Got it!

Now to run through some scenarios.

Thank you guys!

 

chrisw01a_0-1635518899783.png

 

chrisw01a_1-1635518940093.png

 

 

chrisw01a
in reply to: CattabianiI

I did not mean to hijack this thread.  Can a moderator separate my posts to a new thread or something?  Sorry about that.

 

Well I have the program working, but it looks like I have a lot of work to do in order to allow it to handle the new model states.  I do not see any reference to model states in the Apprentice documents.  Do any of you know if Apprentice can recognize model states?

 

I think when the original file is selected, the program needs to get all referenced files from the master model state even if they are suppressed that way all the files will be available in the new folder.  The way it is now, if any of the items are suppressed, they are not added to the list.  

 

Anyhow, I will probably make a new post to address this.

 

Once again, thank you all for your help.

 

Chris

 

chrisw01a_0-1635609926258.png

 

CattabianiI
in reply to: CattabianiI

@chrisw01a read this thread and linked documents to better understand model states, and then go with a new post :slightly_smiling_face:

chrisw01a
in reply to: CattabianiI

Will do.  Thanks for your time.

gilsdorf_e
in reply to: JaneFan

Hello Jane,
we have tested it with Vault 2022.2 and Inventor 2022.2 and it is still not working with apprentice?

Regards
Erik
CattabianiI
in reply to: gilsdorf_e

we have tested it with Vault 2022.2 and Inventor 2022.2 and it is still not working with apprentice?
What are you talking about?