# Error using MarkupsToModel Logic

**URL:** https://discourse.slicer.org/t/error-using-markupstomodel-logic/42562
**Category:** Development
**Created:** [April 14, 2025, 4:52pm UTC](https://discourse.slicer.org/t/error-using-markupstomodel-logic/42562 "2025-04-14T16:52:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bloem1412](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bloem1412/32/79979_2.png) [@bloem1412](https://discourse.slicer.org/u/bloem1412)
#### Post date: [April 14, 2025, 4:52pm UTC](https://discourse.slicer.org/t/error-using-markupstomodel-logic/42562/1 "2025-04-14T16:52:18Z")

</div>

Operating system: Windows 10  
Slicer version: 5.8.0  
I’m using the MarkupsToModel logic in my own module to make a closed surface model of a list of fiducials. My code has the desired effect, when I click the button in my module, a closed surface of the fiducials is created and visible.  
Even though it is functioning, I get an error in the console:  
[VTK] No output model node provided to UpdateOutputModel. No operation performed.  
I tried to define the output model node more explicitely, but to no effect.  
Is there a way to prevent this error or should I just ignore it since it doesn’t seem to affect the function?

My code:

```python
# Create a new model node for the output
outputModelNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLModelNode", outputModelName)
outputModelNode.CreateDefaultDisplayNodes()            
# Create a new MarkupsToModel node
markupsToModelNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLMarkupsToModelNode")
# Set the input node (annotationNode)
         markupsToModelNode.SetAndObserveInputNodeID(self._parameterNode.annotationNode.GetID())
markupsToModelNode.SetAndObserveOutputModelNodeID(outputModelNode.GetID())
# Ensure the model is visible in 3D
outputModelNode.GetDisplayNode().SetVisibility(True)

markupsToModelLogic = slicer.modules.markupstomodel.logic()
         markupsToModelNode.SetModelType(slicer.vtkMRMLMarkupsToModelNode.ClosedSurface) 
markupsToModelNode.SetAutoUpdateOutput(False) # Automatically update the model
            
# Trigger the model creation
markupsToModelLogic.UpdateOutputModel(markupsToModelNode)

```
