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:
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:
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