# Lesson 2:Import .IGES .STEP files while using VTK visualization ,simple example.

**URL:** https://discourse.vtk.org/t/lesson-2-import-iges-step-files-while-using-vtk-visualization-simple-example/7991
**Category:** Development
**Tags:** code
**Created:** [March 6, 2022, 5:05pm UTC](https://discourse.vtk.org/t/lesson-2-import-iges-step-files-while-using-vtk-visualization-simple-example/7991 "2022-03-06T17:05:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![anon41080341](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@anon41080341](https://discourse.vtk.org/u/anon41080341)
#### Post date: [March 6, 2022, 5:05pm UTC](https://discourse.vtk.org/t/lesson-2-import-iges-step-files-while-using-vtk-visualization-simple-example/7991/1 "2022-03-06T17:05:44Z")

</div>

Dear @cory.quammen  
Is this the Proper way to publish Code ?  
Thank You. 🙏

In this example, I am adding Import .Iges file and .Step File to this YouTube Video Example  
[[Lesson 2: Bring OpenCascade and VTK together - YouTube](https://www.youtube.com/watch?v=kZpr4ocnavA&list=PL_WFkJrQIY2iVVchOPhl77xl432jeNYfQ&index=16&ab_channel=Quaoar%27sWorkshop)]

add this to includes

```auto
#include <IGESControl_Reader.hxx>
#include <STEPCAFControl_Reader.hxx>

```

add this to main

```auto

//STEP
STEPControl_Reader readerSTEP;
IFSelect_ReturnStatus statSTEP = readerSTEP.ReadFile("C:\\WorkSpace\\prism.step");
IFSelect_PrintCount modeSTEP = IFSelect_ListByItem;
readerSTEP.PrintCheckLoad(Standard_False, modeSTEP);
TopoDS_Shape shapeSTEP = readerSTEP.OneShape();

//IGES
IGESControl_Reader ReaderIGES;
IFSelect_ReturnStatus statIGES = ReaderIGES.ReadFile("C:\\WorkSpace\\prism.igs");
IFSelect_PrintCount modeIGES = IFSelect_ListByItem;
ReaderIGES.PrintCheckLoad(Standard_True, modeIGES);
ReaderIGES.TransferRoots();
TopoDS_Shape shapeIGES = ReaderIGES.OneShape();

```

fix in the correct line in main

```auto
vtkNew<IVtkTools_ShapeDataSource> occSource;
occSource->SetShape(new IVtkOCC_Shape(shapeIGES));//shapeSTEP //shapeIGES

```

good luck!

---

<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 6, 2022, 10:59pm UTC](https://discourse.vtk.org/t/lesson-2-import-iges-step-files-while-using-vtk-visualization-simple-example/7991/2 "2022-03-06T22:59:38Z")

</div>

Hello @anon41080341.

What is the question here ?

---

<div class="post-metadata">

### Author: ![anon41080341](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@anon41080341](https://discourse.vtk.org/u/anon41080341)
#### Post date: [March 7, 2022, 2:00pm UTC](https://discourse.vtk.org/t/lesson-2-import-iges-step-files-while-using-vtk-visualization-simple-example/7991/3 "2022-03-07T14:00:58Z")

</div>

Hi @mwestphal.  
The question is What Groups/TAGS is proper to release this nice small code.  
tnx.

---

<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 7, 2022, 2:02pm UTC](https://discourse.vtk.org/t/lesson-2-import-iges-step-files-while-using-vtk-visualization-simple-example/7991/4 "2022-03-07T14:02:25Z")

</div>

I just created a code tag 🙂

---

<div class="post-metadata">

### Author: ![anon41080341](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@anon41080341](https://discourse.vtk.org/u/anon41080341)
#### Post date: [March 31, 2022, 11:04am UTC](https://discourse.vtk.org/t/lesson-2-import-iges-step-files-while-using-vtk-visualization-simple-example/7991/5 "2022-03-31T11:04:23Z")

</div>

Dear @cory.quammen @mwestphal  
I know this is the wrong place to send mail.  
But, the truth is, that I could not find where to send regular mail, on this Platform.

As you can see, In my Uploaded code, I have connected VTK to one of the Newest and clearest,  
Open Cascade on YouTube.

Plus, How to Import .IGES .STEP files,  
So an engineer can start work **Directly** on complex Mesh, at the same level as Solid Works!

Here in Lesson2 from YouTube.  
[[Lesson 2:Import .IGES .STEP files while using VTK visualization ,simple example.](https://discourse.vtk.org/t/lesson-2-import-iges-step-files-while-using-vtk-visualization-simple-example/7991)]

Lesson 17  
[[Lesson 17.1: Point Membership Classification with OpenCascade + VTK](https://discourse.vtk.org/t/lesson-17-1-point-membership-classification-with-opencascade-vtk/8009)]

A problem that I solved and have a solution and will upload the solution.  
[[Cascade appanding -TopoDS\_Shape- to -vtkAppendPolyData- or -vtkCleanPolyData- or simply convert -TopoDS\_Shape- to -vtkPolyData- NOT WORKING - #3 by anon41080341](https://discourse.vtk.org/t/cascade-appanding-topods-shape-to-vtkappendpolydata-or-vtkcleanpolydata-or-simply-convert-topods-shape-to-vtkpolydata-not-working/7967/3)]
