Inventor Engineer-To-Order (Read-Only)
Welcome to Autodesk’s Inventor ETO Forums. Share your knowledge, ask questions, and explore popular Inventor ETO topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot set rule iProperties if iProperty name starts with underscore - Error

1 REPLY 1
Reply
Message 1 of 2
FarrenYoung
315 Views, 1 Reply

Cannot set rule iProperties if iProperty name starts with underscore - Error

Assuming I have a custom iProperty pre-existing in my document that starts with an underscore, I am getting an error when setting the iProperties rule. 

 

Rule iProperties As List = {{"_10_DRAWING_NUM", "MyNumber"}} 'for example

 

If my document doesn't already have the iProperty starting with a underscore, it will create it and have no problems.  Has anyone else ran into this?

 

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
1 REPLY 1
Message 2 of 2
FarrenYoung
in reply to: FarrenYoung

I believe this is due to the fact that an iProperty starting with an underscore is a special case in Inventor.  It basically makes it only accessible by name PropertySet.Item("_PropNameHere") and not by looping through the collection (I haven't figured out where this would be useful).

 

So my assumption is that the intent function is looping through the collection of properties and comparing the names until it finds it.  If it doesn't it is creating it (as it should).  If it does exist, it thinks it doesn't exist since it wasn't visible in the collection and then tries to create it, throwing an error since it already exists.

 

This is a problem because the first time it creates my drawing it will correctly add the iproperty, but when the drawing is modified it will again call iv_PropertyPut and error out.

 

Obviously the solution is to just get the item by name.

 

Thoughts?

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************

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

Post to forums  

Autodesk Design & Make Report