How to create a HISMC with Python

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!

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!

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