(5-0) Adding variables to Blueprints with python scripting and UE5

I’m new to unreal and had a question about Unreal 5.

I have an Editor Utility Widget and I’m trying to create an interface with it and populate it with data in a python script. I’m using a Scroll Box (after struggling quite a bit with a ListView widget) and want to dynamically add text to the Scroll Box.

I found a way to add a component with in older version of unreal, but can’t figure out how to do this in Unreal 5. Anyone have an ideas?

OLD WAY :

add directional light component

directLightComponent = ue.add_component_to_blueprint(bp,DirectionalLightComponent, “Directional_light”)

NEW WAY: ??

unreal.BlueprintInterfaceFactory(outer=None , name=‘None’ ) ??

unreal.BlueprintEditorLibrary

In my case I want to add text.

interface_factory = unreal.BlueprintInterfaceFactory(asset_loader, unreal.Text)

Unreal version 5.0.0-16682836
UE5 (5-0)

I found that you can use unreal.BlueprintEditorLibrary.add_member_variable to add the variables.
The problem is about the third parameter of the function, you need to provide a EdGraphPinType object.
But the construction interface for EdGraphPinType didn’t accept any parameter. You can use unreal.BlueprintEditorLibrary.get_basic_type_by_name to get the EdGraphPinType object for basic types like int, float, but for other built-in classes, I didn’t find any working interface. Interfaces like get_class_reference_type, get_object_reference_type, get_struct_type didn’t work.
Here I would like to ask for help if anyone who know how to add other type variables, please tell me.

And in the end, the previous API was just fine, why change it? I didn’t see any reason for bringing in the EdGraphPinType struct, maybe it’s because the underlying c++ code structure changed and there’s some design consideration in there, but please, could you just do something for the easy of use for the scripts.

update: get_class_reference_type can work for some types. But for types that inherit from StructBase, nothing found yet.