# Question about this gGraph

**URL:** <https://forum.dynamobim.com/t/question-about-this-ggraph/91246>\
**Category:** Uncategorized\
**Created:** [June 28, 2023, 7:08pm UTC](https://forum.dynamobim.com/t/question-about-this-ggraph/91246 "2023-06-28T19:08:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike.carson](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mike.carson](https://forum.dynamobim.com/u/mike.carson)\
**Post date:** [June 28, 2023, 7:08pm UTC](https://forum.dynamobim.com/t/question-about-this-ggraph/91246/1 "2023-06-28T19:08:45Z")

</div>

If I have a drawing with model space and two layouts each with one viewport, why do i get this result  
I was expecting two viewports.

 ![get viewports_2023-06-28_12-04-28](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/a/0a3960febdf03fb07156e7eae7f793bb6783a652.png)

---

<div class="post-metadata">

**Author:** ![patrick.ericson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/patrick.ericson/32/121411_2.png) [@patrick.ericson](https://forum.dynamobim.com/u/patrick.ericson)\
**Post date:** [June 28, 2023, 8:33pm UTC](https://forum.dynamobim.com/t/question-about-this-ggraph/91246/2 "2023-06-28T20:33:15Z")

</div>

I did some testings and it works fine for me when I have two layouts with one viewport in each layout and when I delete the viewport in one of them I get the same result as you.

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

I found out that I had to close the script and close dynamo to update the graph correct if I did any changes and added some viewports to the second layout as shown in the screenshot below

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

---

<div class="post-metadata">

**Author:** ![mike.carson](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mike.carson](https://forum.dynamobim.com/u/mike.carson)\
**Post date:** [June 28, 2023, 9:08pm UTC](https://forum.dynamobim.com/t/question-about-this-ggraph/91246/3 "2023-06-28T21:08:52Z")

</div>

I tried closing the script and reopening as you suggested. similar results. here is what i am really trying to-do. the Drawing has 16 layouts as shown c2000 has one viewport c20012-c2016 have a plan and profile viewports. I an the last is modelspace. Iwas expecting the getviewport node output to be layout index and 0 Viewport  
1 Viewport  
for each Layout

this is what is returned

[get viewports.dyn](https://forum.dynamobim.com/uploads/short-url/1gx1ya5B0kknUTU53rqwCZ79o51.dyn) (7.8 KB)

 ![get viewports_2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/e/4e3d546b96739fb157f63e16ff5327899e4868a2.png)

---

<div class="post-metadata">

**Author:** ![patrick.ericson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/patrick.ericson/32/121411_2.png) [@patrick.ericson](https://forum.dynamobim.com/u/patrick.ericson)\
**Post date:** [June 28, 2023, 9:17pm UTC](https://forum.dynamobim.com/t/question-about-this-ggraph/91246/4 "2023-06-28T21:17:29Z")

</div>

Hmm, are you able to send the drawing definition file without xrefs?

---

<div class="post-metadata">

**Author:** ![mike.carson](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mike.carson](https://forum.dynamobim.com/u/mike.carson)\
**Post date:** [June 28, 2023, 9:30pm UTC](https://forum.dynamobim.com/t/question-about-this-ggraph/91246/5 "2023-06-28T21:30:18Z")

</div>

[get viewports test.dwg](https://forum.dynamobim.com/uploads/short-url/nfsM8QxouDJSkgjxSocW19dahyI.dwg) (936.8 KB)

results from latest run

 ![get viewports_3](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/5/05060e0dd6d1ff36450b1f62ec4cd126a74073fa.png)

---

<div class="post-metadata">

**Author:** ![patrick.ericson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/patrick.ericson/32/121411_2.png) [@patrick.ericson](https://forum.dynamobim.com/u/patrick.ericson)\
**Post date:** [June 28, 2023, 9:37pm UTC](https://forum.dynamobim.com/t/question-about-this-ggraph/91246/6 "2023-06-28T21:37:52Z")

</div>

Isn’t that result correct?

---

<div class="post-metadata">

**Author:** ![mike.carson](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mike.carson](https://forum.dynamobim.com/u/mike.carson)\
**Post date:** [June 28, 2023, 9:44pm UTC](https://forum.dynamobim.com/t/question-about-this-ggraph/91246/7 "2023-06-28T21:44:33Z")

</div>

Each layout has two viewports  
0 List  
returns 3 has 2  
1 List  
returns 3 has 2  
2 list  
Returns 2 which is correct the last one is modelspace an looks correct

---

<div class="post-metadata">

**Author:** ![mike.carson](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mike.carson](https://forum.dynamobim.com/u/mike.carson)\
**Post date:** [June 28, 2023, 9:54pm UTC](https://forum.dynamobim.com/t/question-about-this-ggraph/91246/8 "2023-06-28T21:54:10Z")

</div>

Another odd thing  
i copied to more layouts in the drawing, they are recognized as layouts , return empty list even after closing the script and dynamo. btw the no data binding retained is enabled.
