# Views sheet number value not showing

**URL:** <https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269>\
**Category:** Uncategorized\
**Created:** [July 29, 2022, 6:18am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269 "2022-07-29T06:18:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [July 29, 2022, 6:18am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/1 "2022-07-29T06:18:10Z")

</div>

I think it may be something to do with dependant views? But I cant get the sheet number value for this and some other views on sheets. Anyone know whats up?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/9/698218968d07cb24901bd79e1e771dc1158f3324.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/a/1ac10ac9a8208182357f94f2c6d48662fb490630.png)

whaaaaaaat

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/1/61666624ee234d71d00bbc6eaf6f6706f080b940.png)

---

<div class="post-metadata">

**Author:** ![robert12546358](https://avatars.discourse-cdn.com/v4/letter/r/c5a1d2/32.png) [@robert12546358](https://forum.dynamobim.com/u/robert12546358)\
**Post date:** [July 29, 2022, 6:45am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/2 "2022-07-29T06:45:12Z")

</div>

try this.

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

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [July 29, 2022, 6:46am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/3 "2022-07-29T06:46:35Z")

</div>

@vanman ,

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/9/891cae4530570c01e4422ee319747f86405f264c.png)  
Are you filtering correctly in my case under “views” there severial other types of elements

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [July 29, 2022, 6:49am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/4 "2022-07-29T06:49:08Z")

</div>

No luck. I notice I can report the sheet number from the viewport. Not sure how to get the views viewport though as a weird way to fix

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/3/13a6d508c1f21efb3e099c723afff99839fc4e2b.png)

---

<div class="post-metadata">

**Author:** ![robert12546358](https://avatars.discourse-cdn.com/v4/letter/r/c5a1d2/32.png) [@robert12546358](https://forum.dynamobim.com/u/robert12546358)\
**Post date:** [July 29, 2022, 6:51am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/5 "2022-07-29T06:51:59Z")

</div>

Can you share your revit file?

---

<div class="post-metadata">

**Author:** ![robert12546358](https://avatars.discourse-cdn.com/v4/letter/r/c5a1d2/32.png) [@robert12546358](https://forum.dynamobim.com/u/robert12546358)\
**Post date:** [July 29, 2022, 7:00am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/7 "2022-07-29T07:00:52Z")

</div>

“Referencing Sheet” input as ParameterName. not Sheet Number

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [July 29, 2022, 7:03am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/8 "2022-07-29T07:03:39Z")

</div>

trying to sort a file for ya. Referencing sheet is the wrong information. I want the sheet number. Which is showing in the revit parameter. Dynamos just not pulling it

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [July 29, 2022, 9:01am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/9 "2022-07-29T09:01:22Z")

</div>

I cleared out the revit file to send to you with just sheets and views but then it started reporting the sheet number with the file cleared out 🤪

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [July 29, 2022, 9:38am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/10 "2022-07-29T09:38:09Z")

</div>

Sorry I think I know what’s happening! The ReferenceCalloutsView node is getting the the main view. Not the the split up dependent view the reference callout is in. Would anyone know how to fix that?

For instance its getting  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/c/ec191439cd256e20b3f38e69b0dcdf501af26cc9.png)  
But it should be getting one of these two views, whichever the reference callout is in  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/a/1a203def937c537de83f19d86ada826cc0357298.png)

```auto
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

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

def GetOwnerView(item):
	if hasattr(item, "OwnerViewId"): return item.Document.GetElement(item.OwnerViewId)
	else: return None

items = UnwrapElement(IN[0])

if isinstance(IN[0], list): OUT = [GetOwnerView(x) for x in items]
else: OUT = GetOwnerView(items)

```

@Ewan_Opie simple fix by any chance? Had covid this week so only just now been feeling ok to dynamo again 😅 still need to try out your tag all views node

maybe something here

> [@Python Script - Function](https://forum.dynamobim.com/t/python-script-function/44005/9):
>
> I’ve added the flatten function from @Kulkul The last line takes every item of your list of views and counts it. Then it takes every item of your revision list and multiplies it by that count. Tip! Never ever ever use drop down menus in your Script. So instead of node Categories use Category.ByName. You can read [here](https://www.linkedin.com/posts/alexander-berg-b5b77b93_programming-dynamo-python-activity-6603260968413863936-hqjg) why exactly it’s not a good idea and my simple solution to resolve it. import clr clr.AddReference("RevitAPI") from Autodesk.Revit.DB import \* clr.AddReference("RevitNodes") imp…

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [July 30, 2022, 12:44am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/11 "2022-07-30T00:44:18Z")

</div>

Had to add a dependent views checker. This isnt a great fix, dosnt really work with the script if its checking things in a linked or open project with element.isvisable node to get the right dependent view

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/8/b8ab19892caec1ac363ddc85419435c658b31fda.png)

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [July 30, 2022, 9:31am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/12 "2022-07-30T09:31:22Z")

</div>

> [@vanman](#):
>
> simple fix by any chance?

I should think so, will look Monday 😀

> [@vanman](#):
>
> Had covid this week

Bugger that for a joke, hope you are properly on the mend.

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [August 1, 2022, 1:53am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/13 "2022-08-01T01:53:44Z")

</div>

@vanman Try this one.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/4/b4febc4f30016bd4f4596ae4158ea37c3d1426cc.png)

```auto
import clr
clr.AddReference("RevitAPI")

from Autodesk.Revit.DB import FilteredElementCollector,BuiltInCategory,Viewport, View

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

## Convert an instance/list to a list
def tolist(obj1):
	if hasattr(obj1," __iter__"): return obj1
	else: return [obj1]
	
def GetOwnerView(item):
	if hasattr(item, "OwnerViewId"): return item.Document.GetElement(item.OwnerViewId)
	else: return None	
	
	## Get an Element Parameter
def getParam(element,param):
	value = []
	try:
		DB = element.GetParameters(param)
		for i in DB:
			if "Double" in str(i.StorageType): 
				# Metric Converstion
				value.append(i.AsDouble()*304.8)
			elif "Integer" in str(i.StorageType):
				value.append(i.AsInteger())
			elif "String" in str(i.StorageType):
				value.append(i.AsString())
			else:
				elemId =i.AsElementId()
				value.append(doc.GetElement(elemId))
	except:
		pass
	return value

# Get All Viewports (Views on Sheets)
doc = DocumentManager.Instance.CurrentDBDocument

viewports = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Viewports).WhereElementIsNotElementType().ToElements()

viewNames = []
viewportIds = []
views = []
viewIds = []
viewRefs = []

# Map Viewports to View Names
for viewport in viewports:
	viewId = viewport.ViewId
	v = doc.GetElement(viewId)
	views.append(v)
	viewIds.append(viewId)
	viewNames.append(v.Name)
	viewportIds.append(viewport.Id)
	
	# Construct Viewport Ref
	vpRefNum = str(getParam(v, "Detail Number")[0])
	vpRefSheet = str(getParam(v, "Sheet Number")[0])
	viewRefs.append(vpRefNum+"-"+vpRefSheet)
	
# Input views to find which sheet they are placed on
elems = tolist(UnwrapElement(IN[0]))

eOwnerSheets = []
eOwnerViews = []
eViews = []

for e in elems:
	# Check if elem is a Viewport
	if "Viewport" in str(e.GetType()):
		# Get the owner Sheet
		eOwnerSheet = GetOwnerView(e)
		eOwnerSheets.append(eOwnerSheet)
		
		# Get the associated View
		vid = e.Id
		vIndex = viewportIds.index(vid)
		refView = views[vIndex]
		eViews.append(refView)
		
		# Get the Owner View
		refViewD = str(getParam(refView, "Referencing Detail")[0])
		refViewS = str(getParam(refView, "Referencing Sheet")[0])
		find = refViewD+"-"+refViewS
		
		refOwnerIndex = viewRefs.index(find)
		refOwner = views[refOwnerIndex]
		eOwnerViews.append(refOwner)
			
		
	else:
		# Get the view name
		eName = e.Name
		# Find the same name in the mapped names/viewports lists
		eViewport = viewports[viewNames.index(eName)]
		
		# Get the owner Sheet
		eOwnerSheet = GetOwnerView(eViewport)
		eOwnerSheets.append(eOwnerSheet)
		
		# Get the associated View
		vid = e.Id
		vIndex = viewportIds.index(vid)
		refView = views[vIndex]
		eViews.append(refView)
		
		# Get the Owner View
		refViewD = str(getParam(refView, "Referencing Detail")[0])
		refViewS = str(getParam(refView, "Referencing Sheet")[0])
		find = refViewD+"-"+refViewS
		
		refOwnerIndex = viewRefs.index(find)
		refOwner = views[refOwnerIndex]
		eOwnerViews.append(refOwner)

OUT = eOwnerSheets,eOwnerViews,eViews

```

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [August 1, 2022, 3:05am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/14 "2022-08-01T03:05:53Z")

</div>

wow this looks like alot of work. Thank you so much, I’m getting this error for some reason…

```auto
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed. 
Traceback (most recent call last):
  File "<string>", line 107, in <module>
ValueError: list.index(item): item not in list

```

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

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [August 1, 2022, 3:13am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/15 "2022-08-01T03:13:48Z")

</div>

Try this and lets see which elements are erroring.

```auto
import clr
clr.AddReference("RevitAPI")

from Autodesk.Revit.DB import FilteredElementCollector,BuiltInCategory,Viewport, View

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

## Convert an instance/list to a list
def tolist(obj1):
	if hasattr(obj1," __iter__"): return obj1
	else: return [obj1]
	
def GetOwnerView(item):
	if hasattr(item, "OwnerViewId"): return item.Document.GetElement(item.OwnerViewId)
	else: return None	
	
	## Get an Element Parameter
def getParam(element,param):
	value = []
	try:
		DB = element.GetParameters(param)
		for i in DB:
			if "Double" in str(i.StorageType): 
				# Metric Converstion
				value.append(i.AsDouble()*304.8)
			elif "Integer" in str(i.StorageType):
				value.append(i.AsInteger())
			elif "String" in str(i.StorageType):
				value.append(i.AsString())
			else:
				elemId =i.AsElementId()
				value.append(doc.GetElement(elemId))
	except:
		pass
	return value

# Get All Viewports (Views on Sheets)
doc = DocumentManager.Instance.CurrentDBDocument

viewports = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Viewports).WhereElementIsNotElementType().ToElements()

viewNames = []
viewportIds = []
views = []
viewIds = []
viewRefs = []

# Map Viewports to View Names
for viewport in viewports:
	viewId = viewport.ViewId
	v = doc.GetElement(viewId)
	views.append(v)
	viewIds.append(viewId)
	viewNames.append(v.Name)
	viewportIds.append(viewport.Id)
	
	# Construct Viewpoer Ref
	vpRefNum = str(getParam(v, "Detail Number")[0])
	vpRefSheet = str(getParam(v, "Sheet Number")[0])
	viewRefs.append(vpRefNum+"-"+vpRefSheet)
	
# Input views to find which sheet they are placed on
elems = tolist(UnwrapElement(IN[0]))

eOwnerSheets = []
eOwnerViews = []
eViews = []

errors = []

for e in elems:
	# Check if elem is a Viewport
	if "Viewport" in str(e.GetType()):
		try:
			# Get the owner Sheet
			eOwnerSheet = GetOwnerView(e)
			eOwnerSheets.append(eOwnerSheet)
			
			# Get the associated View
			vid = e.Id
			vIndex = viewportIds.index(vid)
			refView = views[vIndex]
			eViews.append(refView)
			
			# Get the Owner View
			refViewD = str(getParam(refView, "Referencing Detail")[0])
			refViewS = str(getParam(refView, "Referencing Sheet")[0])
			find = refViewD+"-"+refViewS
			
			refOwnerIndex = viewRefs.index(find)
			refOwner = views[refOwnerIndex]
			eOwnerViews.append(refOwner)
		except:
			# Add the element instead for troubleshooting
			errors.append(e)		
		
	else:
		try:
			# Get the view name
			eName = e.Name
			# Find the same name in the mapped names/viewports lists
			eViewport = viewports[viewNames.index(eName)]
			
			# Get the owner Sheet
			eOwnerSheet = GetOwnerView(eViewport)
			eOwnerSheets.append(eOwnerSheet)
			
			# Get the associated View
			vid = eViewport.Id
			vIndex = viewportIds.index(vid)
			refView = views[vIndex]
			eViews.append(refView)
			
			# Get the Owner View
			refViewD = str(getParam(refView, "Referencing Detail")[0])
			refViewS = str(getParam(refView, "Referencing Sheet")[0])
			find = refViewD+"-"+refViewS
			
			refOwnerIndex = viewRefs.index(find)
			refOwner = views[refOwnerIndex]
			eOwnerViews.append(refOwner)
		except:
			# Add the element instead for troubleshooting
			errors.append(e)	
			
OUT = eOwnerSheets,eOwnerViews,eViews,errors

```

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [August 1, 2022, 3:42am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/16 "2022-08-01T03:42:51Z")

</div>

I got 540 errors with this test. I can only vaguely understand what your doing in the code. But I see there’s a method to get viewports. Will this work when the element is coming from a linked view too?

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

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [August 1, 2022, 3:54am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/17 "2022-08-01T03:54:15Z")

</div>

Ah, are most of these were linked views?

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [August 1, 2022, 3:58am UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/18 "2022-08-01T03:58:16Z")

</div>

yeah unfortunately. To find out where typical details are used in linked projects too. Could be searching through a few projects sometimes. It was working all good till dependent views got thrown into the mix with this one project

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [August 1, 2022, 6:14pm UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/19 "2022-08-01T18:14:15Z")

</div>

Adding references to look in link documents seems to be working, give this a go.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/9/d9c6557f8c1d58c748fbb35900ee8ca0203a627d.png)

```auto
import clr
clr.AddReference("RevitAPI")

from Autodesk.Revit.DB import FilteredElementCollector,BuiltInCategory,Viewport, View

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

## Convert an instance/list to a list
def tolist(obj1):
	if hasattr(obj1," __iter__"): return obj1
	else: return [obj1]
	
def GetOwnerView(item):
	if hasattr(item, "OwnerViewId"): return item.Document.GetElement(item.OwnerViewId)
	else: return None	
	
	## Get an Element Parameter
def getParam(element,param):
	value = []
	try:
		DB = element.GetParameters(param)
		for i in DB:
			if "Double" in str(i.StorageType): 
				# Metric Converstion
				value.append(i.AsDouble()*304.8)
			elif "Integer" in str(i.StorageType):
				value.append(i.AsInteger())
			elif "String" in str(i.StorageType):
				value.append(i.AsString())
			else:
				elemId =i.AsElementId()
				value.append(doc.GetElement(elemId))
	except:
		pass
	return value

# Get All Viewports (Views on Sheets)
doc = DocumentManager.Instance.CurrentDBDocument

# Allow for link docs
linkInst = tolist(IN[1])

LviewNames = []
LviewportIds = []
Lviews = []
LviewIds = []
LviewRefs = []

for l in linkInst:

	Ldoc = l.GetLinkDocument()
	Lviewports = FilteredElementCollector(Ldoc).OfCategory(BuiltInCategory.OST_Viewports).WhereElementIsNotElementType().ToElements()
	
	# Map Viewports to View Names
	for Lviewport in Lviewports:
		LviewId = Lviewport.ViewId
		Lv = Ldoc.GetElement(LviewId)
		Lviews.append(Lv)
		LviewIds.append(LviewId)
		LviewNames.append(Lv.Name)
		LviewportIds.append(Lviewport.Id)
	
		# Construct Viewpoer Ref
		LvpRefNum = str(getParam(Lv, "Detail Number")[0])
		LvpRefSheet = str(getParam(Lv, "Sheet Number")[0])
		LviewRefs.append(LvpRefNum+"-"+LvpRefSheet)

viewports = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Viewports).WhereElementIsNotElementType().ToElements()

viewNames = []
viewportIds = []
views = []
viewIds = []
viewRefs = []

# Map Viewports to View Names
for viewport in viewports:
	viewId = viewport.ViewId
	v = doc.GetElement(viewId)
	views.append(v)
	viewIds.append(viewId)
	viewNames.append(v.Name)
	viewportIds.append(viewport.Id)
	
	# Construct Viewpoer Ref
	vpRefNum = str(getParam(v, "Detail Number")[0])
	vpRefSheet = str(getParam(v, "Sheet Number")[0])
	viewRefs.append(vpRefNum+"-"+vpRefSheet)

# Input views to find which sheet they are placed on
elems = tolist(UnwrapElement(IN[0]))

eOwnerSheets = []
eOwnerViews = []
eViews = []

for e in elems:
	try:
	# Find view in current document
		# Check if elem is a Viewport
		if "Viewport" in str(e.GetType()):
			# Get the owner Sheet
			eOwnerSheet = GetOwnerView(e)
			eOwnerSheets.append(eOwnerSheet)
			
			# Get the associated View
			vid = e.Id
			vIndex = viewportIds.index(vid)
			refView = views[vIndex]
			eViews.append(refView)
			
			# Get the Owner View
			refViewD = str(getParam(refView, "Referencing Detail")[0])
			refViewS = str(getParam(refView, "Referencing Sheet")[0])
			find = refViewD+"-"+refViewS
			
			refOwnerIndex = viewRefs.index(find)
			refOwner = views[refOwnerIndex]
			eOwnerViews.append(refOwner)
				
			
		else:
			# Get the view name
			eName = e.Name
			# Find the same name in the mapped names/viewports lists
			eViewport = viewports[viewNames.index(eName)]
			
			# Get the owner Sheet
			eOwnerSheet = GetOwnerView(eViewport)
			eOwnerSheets.append(eOwnerSheet)
			
			# Get the associated View
			vid = eViewport.Id
			vIndex = viewportIds.index(vid)
			refView = views[vIndex]
			eViews.append(refView)
			
			# Get the Owner View
			refViewD = str(getParam(refView, "Referencing Detail")[0])
			refViewS = str(getParam(refView, "Referencing Sheet")[0])
			find = refViewD+"-"+refViewS
			
			refOwnerIndex = viewRefs.index(find)
			refOwner = views[refOwnerIndex]
			eOwnerViews.append(refOwner)
	except:
		# Try to find view in link docs
		# Check if elem is a Viewport
		if "Viewport" in str(e.GetType()):
			# Get the owner Sheet
			eOwnerSheet = GetOwnerView(e)
			eOwnerSheets.append(eOwnerSheet)
			
			# Get the associated View
			Lvid = e.Id
			LvIndex = LviewportIds.index(Lvid)
			LrefView = Lviews[LvIndex]
			eViews.append(LrefView)
			
			# Get the Owner View
			LrefViewD = str(getParam(LrefView, "Referencing Detail")[0])
			LrefViewS = str(getParam(LrefView, "Referencing Sheet")[0])
			Lfind = LrefViewD+"-"+LrefViewS
			
			LrefOwnerIndex = LviewRefs.index(Lfind)
			LrefOwner = Lviews[LrefOwnerIndex]
			eOwnerViews.append(LrefOwner)
				
			
		else:
			# Get the view name
			eName = e.Name
			# Find the same name in the mapped names/viewports lists
			eViewport = Lviewports[LviewNames.index(eName)]
			
			# Get the owner Sheet
			eOwnerSheet = GetOwnerView(eViewport)
			eOwnerSheets.append(eOwnerSheet)
			
			# Get the associated View
			Lvid = eViewport.Id
			LvIndex = LviewportIds.index(Lvid)
			LrefView = Lviews[LvIndex]
			eViews.append(LrefView)
			
			# Get the Owner View
			LrefViewD = str(getParam(LrefView, "Referencing Detail")[0])
			LrefViewS = str(getParam(LrefView, "Referencing Sheet")[0])
			Lfind = LrefViewD+"-"+LrefViewS
			
			LrefOwnerIndex = LviewRefs.index(Lfind)
			LrefOwner = Lviews[LrefOwnerIndex]
			eOwnerViews.append(LrefOwner)
			
		
OUT = eOwnerSheets,eOwnerViews,eViews

```

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [August 1, 2022, 10:25pm UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/20 "2022-08-01T22:25:09Z")

</div>

I was hoping you’d give this a go! 🙂 I was trying but failing with Genius Loki/clockwork code. Sometimes people didn’t have a project linked in so I used this node that got all links and open documents for them to pick from. So the other projects come through as below. Not sure if there’s a node to get the link instance from something if its just another open document? Or would it be an easy fix?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/1/9111eb82f7697dab3dc9c99a49e148092c6a5816.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/e/4e62bcf0811aea2c5f7fcbd0682cc55f9d30f950.png)  
The code I was trying with which worked for get callouts…

```auto
#Part of script from Clockwork
inputdoc = UnwrapElement(IN[0])
if inputdoc == None:
	doc = DocumentManager.Instance.CurrentDBDocument
elif isinstance (inputdoc, RevitLinkInstance) :
	doc = inputdoc.GetLinkDocument()
elif isinstance (inputdoc, Document) :
	doc = inputdoc
else: doc = None

```

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [August 1, 2022, 10:43pm UTC](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269/21 "2022-08-01T22:43:56Z")

</div>

> [@Ewan\_Opie](#):
>
> ```auto
> for l in linkInst:
> 
> Ldoc = l.GetLinkDocument()
> Lviewports = FilteredElementCollector(Ldoc).OfCategory(BuiltInCategory.OST_Viewports).WhereElementIsNotElementType().ToElements()
> 	
> 
> ```

If you already have a list of LinkDocuments in the project then this part of the code can be adjusted, as this was just converting and loaded LinkInstances to Doc format. Change to the below.

```auto
# Allow for link docs
linkDocs = tolist(IN[1])

LviewNames = []
LviewportIds = []
Lviews = []
LviewIds = []
LviewRefs = []

for Ldoc in linkDocs:

	Lviewports = FilteredElementCollector(Ldoc).OfCategory(BuiltInCategory.OST_Viewports).WhereElementIsNotElementType().ToElements()
	
	

```

[Next page](https://forum.dynamobim.com/t/views-sheet-number-value-not-showing/79269.md?page=2)
