# Slicer 4.10.2 Model Imports

**URL:** <https://discourse.slicer.org/t/slicer-4-10-2-model-imports/24460>\
**Category:** Support\
**Tags:** python\
**Created:** [July 22, 2022, 8:33pm UTC](https://discourse.slicer.org/t/slicer-4-10-2-model-imports/24460 "2022-07-22T20:33:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristophG123](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/christophg123/32/15483_2.png) [@ChristophG123](https://discourse.slicer.org/u/ChristophG123)\
**Post date:** [July 22, 2022, 8:33pm UTC](https://discourse.slicer.org/t/slicer-4-10-2-model-imports/24460/1 "2022-07-22T20:33:37Z")

</div>

I’m trying to import stl files from my PC on Slicer 4.10.2 because I’m modifying an old module that doesn’t work on newer versions of Slicer. However, it seems like the code I normally use on Slicer 5.1.0 doesn’t work for this, and I was wondering what the correct commands are. Here is what I have:

```auto
    self.stylusModel = slicer.util.loadModel('C:/calibrationClarius/Current_Models/stylusV2')
    self.stylusModelDisplayNode = self.stylusModel.GetDisplayNode()
    self.stylusModelDisplayNode.SetColor(0, 0.5, 0.1)

```

And here is the error on the Slicer python console:

```auto
File "C:/calibrationClarius/leahCalibModified/Calibration/Calibration.py", line 47, in __init__
    self.stylusModelDisplayNode = self.stylusModel.GetDisplayNode()
AttributeError: 'bool' object has no attribute 'GetDisplayNode'

```

Furthermore, I was wondering where I could find an old Script repository for code that works on 4.10.2 I can refer to in the future. Thanks

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 22, 2022, 11:29pm UTC](https://discourse.slicer.org/t/slicer-4-10-2-model-imports/24460/2 "2022-07-22T23:29:38Z")

</div>

In older versions of `loadModel` you needed to provide an extra boolean parameter `returnNode=True` as [described here](https://discourse.slicer.org/t/simplifying-slicer-util-load-functions/7270).

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 23, 2022, 5:22am UTC](https://discourse.slicer.org/t/slicer-4-10-2-model-imports/24460/3 "2022-07-23T05:22:12Z")

</div>

> [@ChristophG123](#):
>
> I’m modifying an old module that doesn’t work on newer versions of Slicer.

I would recommend to update the module instead of downgrade Slicer. Check out the [migration guide](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide/Slicer) for description of API changes and how to update old code. You can ask on this forum if you cannot figure out how to update any specific part in your module.
