# 'Viewer' object has no attribute 'add'

**URL:** https://forum.compas-framework.org/t/viewer-object-has-no-attribute-add/1013
**Category:** compas
**Created:** [April 8, 2025, 3:30pm UTC](https://forum.compas-framework.org/t/viewer-object-has-no-attribute-add/1013 "2025-04-08T15:30:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Daiva](https://avatars.discourse-cdn.com/v4/letter/d/d26b3c/32.png) [@Daiva](https://forum.compas-framework.org/u/Daiva)
#### Post date: [April 8, 2025, 3:30pm UTC](https://forum.compas-framework.org/t/viewer-object-has-no-attribute-add/1013/1 "2025-04-08T15:30:46Z")

</div>

System info:

- Windows 10
- python 3.12.9
- compas 2.10.0
- compas-ifc 1.5.0
- compas-viewer 1.4.0
- compas\_occ 1.2.1

I am testing compas for the first time, based on the tutorials found here: [tutorials/IFC/README.md at main · compas-dev/tutorials · GitHub](https://github.com/compas-dev/tutorials/blob/main/IFC/README.md)

This is my script:

```auto
path = 'model.ifc'
model = Model(path)

spaces = model.get_entities_by_type("IfcSpace")

viewer = Viewer(width=1200, height=600)

for entity in spaces:
	viewer.add(entity.body_with_opening, name=entity.name)

viewer.show()

```

I get the following AttributeError: ‘Viewer’ object has no attribute ‘add’

Could anyone tell me what i am doing wrong? Thank You in advance.

---

<div class="post-metadata">

### Author: ![chenkasirer](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/chenkasirer/32/549_2.png) [@chenkasirer](https://forum.compas-framework.org/u/chenkasirer)
#### Post date: [April 14, 2025, 12:34pm UTC](https://forum.compas-framework.org/t/viewer-object-has-no-attribute-add/1013/2 "2025-04-14T12:34:25Z")

</div>

Hey @Daiva

Could you try `viewer.scene.add(...)` instead?  
I suspect the example code my be a little outdated.

Please let me know if that does it.

Chen

---

<div class="post-metadata">

### Author: ![Daiva](https://avatars.discourse-cdn.com/v4/letter/d/d26b3c/32.png) [@Daiva](https://forum.compas-framework.org/u/Daiva)
#### Post date: [April 16, 2025, 1:02pm UTC](https://forum.compas-framework.org/t/viewer-object-has-no-attribute-add/1013/3 "2025-04-16T13:02:22Z")

</div>

Hi @chenkasirer,  
thank you for the tip, ir worked!

However now i am facing a new issue: [Issue with IFC Model Placement - compas](https://forum.compas-framework.org/t/issue-with-ifc-model-placement/1022)
