Is view placed

Is view placed

Anonymous
Not applicable
944 Views
2 Replies
Message 1 of 3

Is view placed

Anonymous
Not applicable

Dear Forum members,

Is there a way to find out that is a view placed in a sheet.

I know a long way to do it. loop all the sheets

ICollection<ElementId> views=viewSheet.GetAllPlacedViews()

and then loop all elements to find if the view in question is placed or not.

But is there any other solution to this except the above one may be a simple

isViewPlaced()

Thanks & Regards

Sanjay Pandey

0 Likes
945 Views
2 Replies
Replies (2)
Message 2 of 3

m.de.vriesTH5VM
Enthusiast
Enthusiast

Yes there is a simpler way, Sort of anyway.

 

You can look up the parameters VIEWPORT_SHEET_NUMBER (and VIEWPORT_SHEET_NAME). if this are set to a (string) value then this can be used to identify the Sheet on which the view is placed.

 

You will need to use a filtered element collector (filtering on the class and Name property) to get at the Sheet element.

 

It may be simpler to just iterate through the Sheets as you are already doing, if the number of sheets is guaranteed to be limited.

0 Likes
Message 3 of 3

Anonymous
Not applicable

Yes. number of sheets are not huge.

So will not change and use the existing code which I am using.

BTW thanks for the help and respone.

Thanks & Regards

Sanjay Pandey

 

0 Likes