# Paraview is not saving stl file with SaveData

**URL:** https://discourse.vtk.org/t/paraview-is-not-saving-stl-file-with-savedata/5445
**Category:** Support
**Created:** [March 26, 2021, 4:05am UTC](https://discourse.vtk.org/t/paraview-is-not-saving-stl-file-with-savedata/5445 "2021-03-26T04:05:16Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rasunag27](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rasunag27/32/3160_2.png) [@rasunag27](https://discourse.vtk.org/u/rasunag27)
#### Post date: [March 26, 2021, 4:05am UTC](https://discourse.vtk.org/t/paraview-is-not-saving-stl-file-with-savedata/5445/1 "2021-03-26T04:05:16Z")

</div>

Dear All,

I used one stl file to split the stl using Paraview. I traced the method using python trace in paraview.

Now, I used the code in python to run it. It runs perfectly, but it does not save the splitted mesh as needed. The code is used as per the trace obtained from paraview. Below is the snipped of the code where SaveData is used to save the file. How to save stl file?

```
import sys #sys- append path
import numpy as np

ParaViewBuildPath = "/home/ParaView-5.7.0/"
sys.path.append(ParaViewBuildPath + "lib/") 
sys.path.append(ParaViewBuildPath + "lib/python3.7/site-packages")
sys.path.append(ParaViewBuildPath + "lib/python3.7/site-packages/vtkmodules")

from paraview.simple import *   
# find source
mesh176_rightstl = FindSource('mesh176_right.stl')
generateSurfaceNormals1 = GenerateSurfaceNormals(Input=mesh176_rightstl)
# Properties modified on generateSurfaceNormals1
generateSurfaceNormals1.FeatureAngle = 15.0
# create a new 'Connectivity'
connectivity1 = Connectivity(Input=generateSurfaceNormals1)

# create a new 'Threshold'
threshold1 = Threshold(Input=connectivity1)
#threshold1.Scalars = ['POINTS', 'RegionId']

# Properties modified on threshold1
 threshold1.ThresholdRange = [10.0, 982.0]

 # create a new 'Extract Surface'
 extractSurface1 = ExtractSurface(Input=threshold1)

 # save data
 SaveData('surf176.stl', proxy=extractSurface1, FileType='Ascii')

```

Please change the build path accordingly, in case of running. It also was giving me an error which says:

**vtkDemandDrivenPipeline:713 ERR| vtkPVCompositeDataPipeline (0x5635376a06d0): Input port 0 of algorithm vtkPPolyDataNormals(0x5635376998d0) has 0 connections but is not optional.**

How to eliminate this?

Any leads will be appreciated.

Regards,  
Sunag R A.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [March 26, 2021, 12:42pm UTC](https://discourse.vtk.org/t/paraview-is-not-saving-stl-file-with-savedata/5445/2 "2021-03-26T12:42:55Z")

</div>

This is appropriate for [discourse.paraview.org](http://discourse.paraview.org), but I’ll answer it here. It looks like your `mesh176_rightstl` source is not being found. Make sure it is not `None` - you can call `print(mesh176_rightstl`).

---

<div class="post-metadata">

### Author: ![rasunag27](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rasunag27/32/3160_2.png) [@rasunag27](https://discourse.vtk.org/u/rasunag27)
#### Post date: [March 29, 2021, 3:58am UTC](https://discourse.vtk.org/t/paraview-is-not-saving-stl-file-with-savedata/5445/3 "2021-03-29T03:58:35Z")

</div>

Dear Cory,

Thank you very much for the reply. I did add this question in [discourse.paraview.org](http://discourse.paraview.org), but no response. Well, apart from that, I do have a file named ‘mesh176\_right.stl’. I have also attached the file along with this response. I still have the same issue.

print(mesh176\_right.stl) shows the directory where the file is located.

Issue: **vtkDemandDrivenPipeline:713 ERR| vtkPVCompositeDataPipeline (0x5635376a06d0): Input port 0 of algorithm vtkPPolyDataNormals(0x5635376998d0) has 0 connections but is not optional.**

Mesh link: [Mesh](https://drive.google.com/file/d/1WhcohfL7Dcl91eUIePLDn4ZYaTJ4sCE0/view?usp=sharing)

Regards,  
Sunag R A.

---

<div class="post-metadata">

### Author: ![rasunag27](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rasunag27/32/3160_2.png) [@rasunag27](https://discourse.vtk.org/u/rasunag27)
#### Post date: [March 30, 2021, 5:25am UTC](https://discourse.vtk.org/t/paraview-is-not-saving-stl-file-with-savedata/5445/4 "2021-03-30T05:25:19Z")

</div>

Dear Cory,

Thank you very much for the reply.

print(mesh176\_rightstl) shows ‘None’.

I changed the directory, now the error is not there, but still the file is not saving.!! I tried with basic work example as

s = Sphere()  
SaveData( ‘sphere.stl’, proxy = s, FileType=‘Ascii’)

This works and saves the stl file. But not the one I needed.

Mesh link: [Mesh](https://drive.google.com/file/d/1WhcohfL7Dcl91eUIePLDn4ZYaTJ4sCE0/view?usp=sharing)

Regards,  
Sunag R A.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [March 30, 2021, 7:19am UTC](https://discourse.vtk.org/t/paraview-is-not-saving-stl-file-with-savedata/5445/5 "2021-03-30T07:19:37Z")

</div>

> [@rasunag27](#):
>
> I did add this question in [discourse.paraview.org](http://discourse.paraview.org), but no response.

Yet, I did answer to you. Closing this. Please discuss on here:  
[https://discourse.paraview.org/t/stl-file-is-not-saving-using-savedata-in-python/6770](https://discourse.paraview.org/t/stl-file-is-not-saving-using-savedata-in-python/6770)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [March 30, 2021, 7:19am UTC](https://discourse.vtk.org/t/paraview-is-not-saving-stl-file-with-savedata/5445/6 "2021-03-30T07:19:41Z")

</div>


