Editing documents in libraries paths via API isn't allowed anymore. 2018 vs 2017

Editing documents in libraries paths via API isn't allowed anymore. 2018 vs 2017

danipon71
Enthusiast Enthusiast
953 Views
7 Replies
Message 1 of 8

Editing documents in libraries paths via API isn't allowed anymore. 2018 vs 2017

danipon71
Enthusiast
Enthusiast

In Inventor 2018 build 112, every document's change made via API throws COMException if the document is in libraries path.

This behavior is different from Inventor's previous versions and that's a problem for some commands I wrote in the past.

 

I've attached a simple solution for reproduce the problem.

How it's work:

 

  1. Launch Inventor (2017 or 2018)
  2. Open an ipt (lib path or other path)
  3. Build and run InvExeApp.exe
  4. Click on execute button of the form

If Inventor is Inventor 2018 and the ipt is in libraries path then an exception will be thrown, otherwise everything will be ok.

 

The exception is thown at this line:Snippet

customPropSet.Add(PropertyValue, PropertyName)

 

0 Likes
954 Views
7 Replies
Replies (7)
Message 2 of 8

pball
Mentor
Mentor

I just used my own iProperties editor and trying to edit a library part throw errors. I'm guessing it probably was not intended that the API could edit library parts since library parts shouldn't be able to be edited, so Autodesk is probably just "fixing" that issue. Which has unintended consequences for people like us that didn't follow the rule that library parts are not to be editable.

 

I've unfortunately seen changes like this before, an example being the ability to copy/paste parts while using the constraint command was removed because it was a "bug".

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
Message 3 of 8

danipon71
Enthusiast
Enthusiast

Build 158, Release: 2018.1 the problem*  is still there.

 

*I know that it could be seen as a bug but it's been there since I started to work with Inventor API many years ago.

0 Likes
Message 4 of 8

danipon71
Enthusiast
Enthusiast

Looking for someone issuing the same problem I found this question about failure with Vault editing property of a library part.
Are these problems related? Maybe Vault itself cannot edit documents in library path via Inventor API anymore?

0 Likes
Message 5 of 8

pball
Mentor
Mentor

I found a post from an Autodesk employee referring to this as a defect, so chances are this will not be changed. Also I don't have vault and editing library parts in 2018 via the API is not allowed.

 

https://forums.autodesk.com/t5/inventor-customization/ilogic-error/m-p/7139947#M72778

 

In the end is seems Autodesk is treating this as a bug they fixed, even though users used this "feature".

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
Message 6 of 8

sajith_subramanian
Autodesk Support
Autodesk Support

Hi @pball,

 

You are right, It's a change in API from Inventor 2018. 

 

Regards,

Sajith


Sajith Subramanian
Autodesk Developer Network
0 Likes
Message 7 of 8

frederic.vandenplas
Collaborator
Collaborator

Close the part, switch to another project (Default) , open the part, make changes, close the part,  restore project, open the part Smiley Indifferent

 

Or you could place them in the workgroup search path as alternative Smiley Very Happy

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
0 Likes
Message 8 of 8

danipon71
Enthusiast
Enthusiast

I reckon that from a theoretical point of view it can be consider a bugfix. The point is that the "bug" has been there for 16 years and no one complained. The ideastation suggestion is not directly related with this issue.

Again, I agree that the document has to be protected from unintentional changes (from user side), but PDM software sometimes need to be able to set some iProperties even on library components and this won't be allowed anymore. This change deeply impacts on our customers.

I would suggest to consider a rollback to IV2017 behaviour or provide an API that allow the programmer to set the iProperties.

0 Likes