PropertySets Item method not defined (c#)

PropertySets Item method not defined (c#)

awatt
Advocate Advocate
580 Views
3 Replies
Message 1 of 4

PropertySets Item method not defined (c#)

awatt
Advocate
Advocate

I'm porting some code from VB to c#, and I'm being told the PropertySets object doesn't have an item method defined.

 

awatt_1-1699018914954.png

awatt_2-1699018955368.png

 

The Item method doesn't show up in the VS object browser.

 

I have a 'using Inventor;' statement, and a reference to autodesk.inventor.interop.  So far everything else has worked as expected.

 

What should I be looking for?

0 Likes
Accepted solutions (1)
581 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor
Accepted solution

Hi @awatt.  I am not good with C#, but since the Item property is its default one, you may be able to simply use a ["propertyset name"] right after the oDoc.PropertySets, like this:

Inventor.PropertySet statusPropertySet = oDoc.PropertySets["Design Tracking Properties"]

just a guess, based on what I've seen before.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 4

awatt
Advocate
Advocate

@WCrihfield  I think you might be right.  The code formatter accepted it, but it will be a while before I can compile and fully test.

 

Thank you.

0 Likes
Message 4 of 4

Frederick_Law
Mentor
Mentor

WCrihfield is correct.

 

Also try this:

https://github.com/icsharpcode/CodeConverter

 

I converted my VS VB template to C# with it.

0 Likes