List with "Errors" and Elemets - How to get just the element

Hi there. This should be an easy one.
I used Rhythm Viewport.Create to create a viewport on a sheet. The result from this returns a lists as shown in the image below.

I would like to extract the element(s) that was created by the Viewport.Create function. How do I loop thru the list and just return the valid elements? In this example, All of the other elements read “Error: View XYZ can not be added…”. I want to throw these away and just get the valid elements. It is possible that the list can return more than 1 valid element?


For context, I am inserting details onto sheets that have same names as the sheet. I am then repositioning it to a desired coordinate view the use of BoundingBox to figure out where the center of the viewport is and where it actually needs to be.

1 Like

@bgumPXZJF ,

can you preselect views not on sheets… i think there are plenty topics regarding that…

I assume these errors are strings. You could filter by string, which will likely create a null…but then you could filter by isnull.

Otherwise, get the data type and then filter based on data type.