Inventor Engineer-to-Order

Reply
Mentor
FarrenYoung
Posts: 263
Registered: ‎07-13-2009
Message 1 of 2 (82 Views)

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

82 Views, 1 Replies
11-05-2012 12:42 PM

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"
************************************************************************************
Mentor
FarrenYoung
Posts: 263
Registered: ‎07-13-2009
Message 2 of 2 (79 Views)

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

11-05-2012 02:06 PM 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"
************************************************************************************

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube