# How to create a HISMC with Python

**URL:** <https://forums.unrealengine.com/t/how-to-create-a-hismc-with-python/477209>\
**Category:** Editor Scripting\
**Tags:** Python, Hierarchical-Instanced-Static-Mesh, hism, unreal-engine, question\
**Created:** [January 13, 2021, 9:32pm UTC](https://forums.unrealengine.com/t/how-to-create-a-hismc-with-python/477209 "2021-01-13T21:32:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_0261357b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0261357b](https://forums.unrealengine.com/u/anonymous_user_0261357b)\
**Post date:** [January 13, 2021, 9:32pm UTC](https://forums.unrealengine.com/t/how-to-create-a-hismc-with-python/477209/1 "2021-01-13T21:32:40Z")

</div>

I’ve got a basic level of Python Scripting knowledge, but I’m finding the documentation on how to use python functions challenging to understand and would appreciate some help.

I need to use a Python script to create a HierarchicalInstancedStaticMeshComponent , assign a static mesh, and then define the transform for an array of elements. I’ll be reading in a series text files that contain the locations/rotations/scale of the elements. Each text file equates to a new HISMC. I can code the part where I open the files and parse the data, but I don’t understand quite how to create the HISMC Actor and how then modify its settings.

Thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0261357b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0261357b](https://forums.unrealengine.com/u/anonymous_user_0261357b)\
**Post date:** [January 14, 2021, 1:19am UTC](https://forums.unrealengine.com/t/how-to-create-a-hismc-with-python/477209/2 "2021-01-14T01:19:21Z")

</div>

I’m stumbling through the documentation, and I’m assuming that I need to use the `unreal.EditorLevelLibrary.spawn_actor_from_class()` function to spawn a HISMC. To make it work, the first parameter is a `Class`. I’m having trouble finding the `class` for the HISMC. `unreal.HierarchicalInstancedStaticMeshComponent.static_class()` appears to be a `class` according to the following code:

```
LogPython: print(str(unreal.HierarchicalInstancedStaticMeshComponent.static_class()))
LogPython: <Object '/Script/Engine.HierarchicalInstancedStaticMeshComponent' (0x0000015BB6C4D800) Class 'Class'>

```

But the `spawn_actor_from_class()` claims it’s an `actor_class`.

```
LogPython: unreal.EditorLevelLibrary.spawn_actor_from_class(unreal.HierarchicalInstancedStaticMeshComponent.static_class(), unreal.Vector(), unreal.Rotator() )
LogPython: Error: Traceback (most recent call last):
LogPython: Error: File "<string>", line 1, in <module>
LogPython: Error: TypeError: EditorLevelLibrary: Failed to convert parameter 'actor_class' when calling function 'EditorLevelLibrary.SpawnActorFromClass' on 'Default__EditorLevelLibrary'
LogPython: Error: TypeError: NativizeProperty: Cannot nativize 'Class' as 'ActorClass' (ClassProperty)
LogPython: Error: TypeError: NativizeClass: Cannot nativize 'Class' as 'Class' (allowed Class type: 'Actor')

```

Help please!

---

<div class="post-metadata">

**Author:** ![NGaming\_Ale](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NGaming\_Ale](https://forums.unrealengine.com/u/NGaming_Ale)\
**Post date:** [September 22, 2021, 12:50pm UTC](https://forums.unrealengine.com/t/how-to-create-a-hismc-with-python/477209/3 "2021-09-22T12:50:58Z")

</div>

I have the same problem, did you find any solution?
