# Get view template of 3D view

**URL:** <https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530>\
**Category:** Revit\
**Created:** [February 16, 2021, 2:22pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530 "2021-02-16T14:22:22Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![wihibyusuf](https://avatars.discourse-cdn.com/v4/letter/w/958977/32.png) [@wihibyusuf](https://forum.dynamobim.com/u/wihibyusuf)\
**Post date:** [February 16, 2021, 2:22pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/1 "2021-02-16T14:22:22Z")

</div>

Hi Guys,

have any of you goto any ideas how to get the view template as element of an 3D view? ive tryied everything but no luck ☹ ive also tryied the revitlookup table.

hope to hear from you guys

 ![afbeelding](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/e/1eefeb11d56e7bba7e13a52176dec7225c20476c.png)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [February 16, 2021, 2:41pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/2 "2021-02-16T14:41:25Z")

</div>

Hi @wihibyusuf,

> [@wihibyusuf](#):
>
> view template as element of an 3D view

This is a known limitation of Dynamo.

> <https://github.com/DynamoDS/DynamoRevit/issues/1636>
>
> \## Dynamo version
> 
> 1.2.3.592
> 
> \## Revit version
> 
> 2017.1
> 
> \## Operating sys…tem
> 
> Win 7
> 
> \## What did you do? 
> 
> Ran \`\`\`All Elements of Type\`\`\` on \`\`\`View3D\`\`\` types.
> 
> \## What did you expect to see?
> 
> A list of all 3D views, hopefully including view templates
> 
> \## What did you see instead?
> 
> !\[3dviewtemplatesreturnedasnull\](https://cloud.githubusercontent.com/assets/3014437/24388810/77839a5a-137d-11e7-8182-9cd2dd6e8738.PNG)
> The last two items are 3D view templates and return \`\`\`null\`\`\` (to reproduce run these nodes on the basic architectural sample that ships with Revit).
> The same thing happens when running \`\`\`All Elements of Category\`\`\` on category \`\`\`Views\`\`\`, btw.
> Admittedly, this is better than the original bug (https://github.com/DynamoDS/Dynamo/issues/2970), but it would obviously be better if these nodes wouldn't return \`\`\`null\`\`\` and even better yet if they would actually return 3D view templates as well (view templates for all other view types are returned).

---

<div class="post-metadata">

**Author:** ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)\
**Post date:** [February 16, 2021, 2:42pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/3 "2021-02-16T14:42:19Z")

</div>

Use the property accessor:

```
viewTemplateId = view.ViewTemplateId 

templateElement = doc.GetElement(viewTemplateId)
```

---

<div class="post-metadata">

**Author:** ![Joelmick](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/joelmick/32/93148_2.png) [@Joelmick](https://forum.dynamobim.com/u/Joelmick)\
**Post date:** [February 16, 2021, 2:43pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/4 "2021-02-16T14:43:40Z")

</div>

Hi @wihibyusuf

I don’t think it is possible to get a Dynamo 3D view of the ViewTemplate.

It is possible to get the API object for the viewTemplate. Dynamo constantly tries to wrap the API object to a Dynamo object (which results in a Null for 3D view templates)

 ![Untitled](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/c/6c5b3ad2f1c7a97dba9a5eaf6480110255ee3953.png)

---

<div class="post-metadata">

**Author:** ![Joelmick](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/joelmick/32/93148_2.png) [@Joelmick](https://forum.dynamobim.com/u/Joelmick)\
**Post date:** [February 16, 2021, 2:44pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/5 "2021-02-16T14:44:40Z")

</div>

This also returns a null for me, Dynamo tries to wrap the API 3D View into a Dynamo 3D view

---

<div class="post-metadata">

**Author:** ![wihibyusuf](https://avatars.discourse-cdn.com/v4/letter/w/958977/32.png) [@wihibyusuf](https://forum.dynamobim.com/u/wihibyusuf)\
**Post date:** [February 16, 2021, 5:12pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/6 "2021-02-16T17:12:57Z")

</div>

yes thank you @Joelmick ive noticed the same thing. still im getting nulls ☹

---

<div class="post-metadata">

**Author:** ![wihibyusuf](https://avatars.discourse-cdn.com/v4/letter/w/958977/32.png) [@wihibyusuf](https://forum.dynamobim.com/u/wihibyusuf)\
**Post date:** [February 16, 2021, 5:14pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/7 "2021-02-16T17:14:07Z")

</div>

mee too also

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [February 16, 2021, 5:26pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/8 "2021-02-16T17:26:47Z")

</div>

Spring nodes implemented a node to collect all of them.

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/5/c538402124580d214a284e7fb42c8d1b13f3b0c7.png)

within his node he actually wrapped the 3d view templates himself:

```auto
import clr

clr.AddReference('RevitAPI')
import Autodesk.Revit.DB as DB

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)

ueWrapper = None
wrappers = clr.GetClrType(Revit.Elements.ElementWrapper).GetMethods()
for w in wrappers:
	if w.ToString().startswith("Revit.Elements.UnknownElement"):
		ueWrapper = w
		break

fec = DB.FilteredElementCollector(doc).OfClass(DB.View3D)
OUT = []
for i in fec:
	if i.IsTemplate:
		OUT.append(ueWrapper.Invoke(None, (i, True) ))

```

---

<div class="post-metadata">

**Author:** ![paris](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paris/32/144289_2.png) [@paris](https://forum.dynamobim.com/u/paris)\
**Post date:** [March 9, 2021, 1:38pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/9 "2021-03-09T13:38:44Z")

</div>

Hi @john_pierson do you know if there is another similar node that works to get the templates associate at the 3D views inside the linked models in a project?  
Thank you  
Cheers

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [March 9, 2021, 2:42pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/10 "2021-03-09T14:42:49Z")

</div>

You can use the _View ByName_ or the _SelectByCateOrType_ nodes for 3D view templates.

 ![View template](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/4/04ba4d0fc1d47c0943035f06a2b65216d8d12766.png)

---

<div class="post-metadata">

**Author:** ![paris](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paris/32/144289_2.png) [@paris](https://forum.dynamobim.com/u/paris)\
**Post date:** [March 9, 2021, 2:58pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/11 "2021-03-09T14:58:00Z")

</div>

Hi @Alban_de_Chasteigner , thank you very much for your answer, but I would like to get the Template Name from my 3D view from the linked model like below:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/a/9ad6cf43ca2dde61eeb43ce16e13057589594025.png)  
Thank you for your efforts  
Cheers

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [March 9, 2021, 3:04pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/12 "2021-03-09T15:04:19Z")

</div>

_GetParameterValueByName_ works only in the current document and not for the linked documents.

---

<div class="post-metadata">

**Author:** ![paris](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paris/32/144289_2.png) [@paris](https://forum.dynamobim.com/u/paris)\
**Post date:** [March 9, 2021, 3:20pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/13 "2021-03-09T15:20:57Z")

</div>

Thank you @Alban_de_Chasteigner , for your answer, yes you are right, but I have the same result with “View.ViewTemplate” node from Clockwork, is there another note to do this task?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/5/059119b51c5d8edd04d8da69339b99967b2e87ad.png)  
Cheers

---

<div class="post-metadata">

**Author:** ![paris](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paris/32/144289_2.png) [@paris](https://forum.dynamobim.com/u/paris)\
**Post date:** [March 9, 2021, 3:44pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/14 "2021-03-09T15:44:34Z")

</div>

Hi @Alban_de_Chasteigner I figured out , it’s something funny, if in a 3D view a template is created from a 3D view I can’t get it, but if the template came (from example) from floor plan view it’s works…  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/f/cfa592654ccabc6f5c90b942e75e3b12c3691629.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/c/bc96128beee64d9b1b9d69dd63312acb5cc34d53.png)  
any thoughts?  
Cheers

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [March 9, 2021, 3:49pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/15 "2021-03-09T15:49:50Z")

</div>

> [@paris](#):
>
> 3D view a template is created from a 3D view I can’t get it

It has already been answered in posts 8 and 10.

---

<div class="post-metadata">

**Author:** ![paris](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paris/32/144289_2.png) [@paris](https://forum.dynamobim.com/u/paris)\
**Post date:** [March 9, 2021, 4:00pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/16 "2021-03-09T16:00:56Z")

</div>

Hi @Alban_de_Chasteigner excuse me but the object of the post is “Get view template of 3D view”, and I thoughts that is useful also for others that you can Get view template of 3D view, if the Template that is applyed is not generate from a 3D view. I hope that make sense.  
Thank you for your time  
Have a good day  
Cheers

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [March 9, 2021, 4:22pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/17 "2021-03-09T16:22:58Z")

</div>

> [@paris](#):
>
> Get view template of 3D view, if the Template that is applyed is not generate from a 3D view

Sorry but that’s not true now.  
Dimitar Venkov found a solution, @john_pierson showed it in post 8.  
I also integrated this method into a few nodes, see post 10 (crediting Dimitar into the custom nodes)

---

<div class="post-metadata">

**Author:** ![paris](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paris/32/144289_2.png) [@paris](https://forum.dynamobim.com/u/paris)\
**Post date:** [March 9, 2021, 4:40pm UTC](https://forum.dynamobim.com/t/get-view-template-of-3d-view/60530/18 "2021-03-09T16:40:24Z")

</div>

Hi @Alban_de_Chasteigner yes of course you are right, my problems it was to get the name of 3D view template applyed on the 3D view of linked files, I found another workaround with schedule view. Thanks
