I added elements from a selected group into a Set X using ADDGROUP. Now i need to create a new Set Y from Set X to based on element type. I looked into addsetrule and addrule. Addsetrule is where a set is created from an existing set...but looks like using using element type does not work there. Any thoughts ?
Solved! Go to Solution.
This might not be the best way but might get you what you need is to have 3 sets. The first set would be set1.AddGroup(...). Then set2.AddRule(....) where you add your elements by type. Then set3.AddCommon(set1.ID, set2.ID)
Just a point of clarification to what was already said. It isn't that using element type doesn't work with AddSetRule.. it does. It is just that AddSetRule doesn't work quite as you might have expected. It requires that the Set that you are providing is filled with the "types" that you want to select or other appropriate values based on the rule you choose. It can't be filled with the IDs of elements to limit the selection. That would be an interesting future enhancement, but is not there today. The suggestion to use AddCommon is the correct solution.