# 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.

• The number of points (verts) and how many are selected is shown in the info area above the 3D View in Edit-mode. Not sure how you define "number of a curve"? Spline index? It's not really useful, is it?! – CoDEmanX Jan 9 '14 at 20:26
• It was a combination of modal Operators and RNA properties I wanted to find, really, but I have a lot to read in before I can handle those smoothly. Thanks to you all anyway. – jimflim Jan 10 '14 at 9:10

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.

• Sorry, I wasn't clear enough. What's most important to me is not the information about the spline itself, but that its property shows upon selection of the active spline while the addon is running... – jimflim Jan 10 '14 at 8:20