How can I dynamically show objects properties in the UI with python? I'd like to work on an Addon project to build facades from imported Curves.

How can I dynamically display in the UI e.g. the spline's number of a curve and how many points it contains?
I've tried with an update selected_object method inside and outside the drawing function of my class but I'm not sure at all about that...



To me, it's a far fetch, I'm not looking for solutions, more for directions. Ultimately, I'd like to be able to select and sort for example "window" type splines and "wall" type splines before generating a meshed solid with window frames out of it.
Assuming you are already in the panels draw function and you have curve assigned.

tot_splines = len(curve.splines)
layout.label(text="Number of curves %d" % tot_splines)

tot_points = sum(len(s.bezier_points) (if s.type == 'BEZIER') else len(s.points)
                 for s in C.object.data.splines)
layout.label(text="Number of points %d" % tot_points)


However I'm not sure why you would want this, seeing as how the info window shows this already.