DraftingView.ByName and Element ID

Trying to understand why the element id for a drafting view is different when drafting view name is called from a viewport vs just a string.

Hi @David_Duarte,

I think one is the “Viewport” ID and one is the “View” ID. The Viewport is an Viewport element, therefore has its own ID but the View is an Element of type View, again has its own ID.

Cheers,
Dan

1 Like

I’m pretty sure the top two watch nodes are the view port ID and Unique ID
It’s two IDs and Unique IDs below that which vex me.
I also notice that when I delete a view from a sheet and undo, Revit assigns the view a new Element ID.

I think I’m just going to have to record an initial ID in the properties of the Selected View so I can find it again no matter what a user does to the view, deleting it aside.

Thanks

DraftingView.ByName creates a new view. I was expecting it to find a Drafting view by name. Tooltips cleared it up.

Hi @David_Duarte,

Sorry, didn’t see your previous post. Yeah, that node creates a new view! :laughing: Which is why the new ID every run.

If you want to find views i have written a node that does this (although, there are probably like a hundred out there already, this one allows you to search with a sub-string also)

FindViewsByName.dyn (7.5 KB)

Cheers,
Dan

Thanks!