# How to make all functions in a submodule of an external module visible?

**URL:** <https://discourse.julialang.org/t/how-to-make-all-functions-in-a-submodule-of-an-external-module-visible/4106>\
**Category:** New to Julia\
**Created:** [June 6, 2017, 1:57pm UTC](https://discourse.julialang.org/t/how-to-make-all-functions-in-a-submodule-of-an-external-module-visible/4106 "2017-06-06T13:57:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [June 6, 2017, 1:57pm UTC](https://discourse.julialang.org/t/how-to-make-all-functions-in-a-submodule-of-an-external-module-visible/4106/1 "2017-06-06T13:57:51Z")

</div>

How can I avoid writing the whole module path of a function/type in a submodule when I want to use it in my module?

```julia
julia> using WriteVTK.VTKCellTypes

julia> VTKCellType
ERROR: UndefVarError: VTKCellType not defined

julia> WriteVTK.VTKCellTypes.VTKCellType
WriteVTK.VTKCellTypes.VTKCellType

```

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 6, 2017, 2:15pm UTC](https://discourse.julialang.org/t/how-to-make-all-functions-in-a-submodule-of-an-external-module-visible/4106/2 "2017-06-06T14:15:37Z")

</div>

Do you mean `export`?

```julia
julia> module Foo
         module Bar
            export VTK
            struct VTK end
         end
       end
Foo

julia> using Foo.Bar

julia> VTK
Foo.Bar.VTK

```

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [June 6, 2017, 2:35pm UTC](https://discourse.julialang.org/t/how-to-make-all-functions-in-a-submodule-of-an-external-module-visible/4106/3 "2017-06-06T14:35:03Z")

</div>

Well, I am not the one who wrote the original module, so ideally I want to just use the submodule, which doesn’t have export in it. I could copy and paste the file and modify it in my program, but I don’t want to take credit for that code.

---

<div class="post-metadata">

**Author:** ![ohsonice](https://avatars.discourse-cdn.com/v4/letter/o/d6d6ee/32.png) [@ohsonice](https://discourse.julialang.org/u/ohsonice)\
**Post date:** [June 6, 2017, 2:46pm UTC](https://discourse.julialang.org/t/how-to-make-all-functions-in-a-submodule-of-an-external-module-visible/4106/4 "2017-06-06T14:46:09Z")

</div>

Looks like there is an `export` in the original code (alternatively you could “fork” the repository and still retain original credits).

[https://github.com/jipolanco/WriteVTK.jl/blob/master/src/WriteVTK.jl](https://github.com/jipolanco/WriteVTK.jl/blob/master/src/WriteVTK.jl)

Try something like:

```julia
import WriteVTK: VTKCellTypes

```

or if you want all exported function/types than use:

```julia
importall WriteVTK

```

Edited to Add: Actually, you should just be able to say `using WriteVTK` and everything that is exported should be available (which includes `VTKCellTypes` and `VTKCellType`).

ETA2: Just tried this on my machine and it doesn’t work. `WriteVTK` has an `export VTKCellType` statement but that type is never defined in that module. It honestly seems like that the behavior that you’re looking for is the expected behavior… maybe open a Pull Request or Issue on github?
