Autodesk Inventor Engineer-to-Order
Reply
Topic Options
- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Using System...D ictionary from Intent
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
97 Views, 1 Replies
10-11-2012 03:39 PM
In this morning's "ETO Potlatch", Farren asked about using a System.Dictionary. Here is a simple example. Note that you cannot use "New", but you have to use CreateInstance.
Uncached Rule TestDictionary As List
Dim map As Any = System.Activator.CreateInstance("mscorlib", "System.Collections.Generic.Dictionary`2[System.In t32,System.String]").UnWrap()
map.Add(3, "Hello")
map.Add(42, "Goodbye")
Dim intentList As List
Dim kv As Any
For Each kv In map
intentList = intentList + {kv.Key, kv.Value }
Next
Dim retList As List
If (map.ContainsKey(3)) Then
retList = retList + { map.get_Item(3) }
End If
Return retList
End Rule
Thanks Mike!

Jon Balgley
Autodesk Inventor ETO team
Autodesk, Inc.
Solved! Go to Solution.
Re: Using System...D ictionary from Intent
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-11-2012 03:58 PM in reply to:
Jon.Balgley
Awesome! If only I had asked this question sooner. :-p
Thanks for 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"
************************************************************************************
************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
