Edit iProperty using Apprentice and C#

Edit iProperty using Apprentice and C#

Anonymous
Not applicable
2,108 Views
2 Replies
Message 1 of 3

Edit iProperty using Apprentice and C#

Anonymous
Not applicable

I've been haing some issues getting the PropertySets.Item to work in C#

I've been trying to follow the VB examples in the SDK folder but I'm still scratching me head.

If you have any idea what I'm missing I would be much obliged!

 

 

Thanks,

James

 

 

Using Visual Studio 2012 with Inventer 2014 SP1

 

iProperties.jpg

 

Error:

'InventorApprentice.PropertySets' does not contain a definition for 'Item' and no extension method 'Item' accepting a first argument of type 'InventorApprentice.PropertySets' could be found.

 

0 Likes
2,109 Views
2 Replies
Replies (2)
Message 2 of 3

Vladimir.Ananyev
Alumni
Alumni

Try this style:

//Get "Inventor Summary Information" PropertySet
PropertySet oPropertySet = oApprenticeDoc.PropertySets["{F29F85E0-4FF9-1068-AB91-08002B27B3D9}"];
//Get Author property
InventorApprentice.Property oProperty = oPropertySet["Author"];
oProperty.Value = author;

 Cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 3 of 3

Anonymous
Not applicable

That worked out great.

 

Working Solution added as text file below.

0 Likes