Notifications
Clear all

[Closed] Display System units in UI

I have created a script which is creating a series of objects and I when I click and drag I can create them over an area.
This is all fine and dandy, but the units displayed in the spinners are irrelevant to the unit scale I am working in. For example today I am working in decimal inches. Tomorrow I might be working in feet.

Is there any way to either set the unit display for each spinner or for the scripted plug-in overall?

I have tried several variants of the following with no luck.

parameters main rollout:params
 	(
 		length type:#float default:0 ui:spn_length units:#Dec_In
 		width type:#float default:0 ui:spn_width
 		thickness type:#float default:1 ui:spn_thickness
 		height type:#float default:0 ui:spn_height
 	)
 	
 	rollout params "LidBox Parameters"
 	(
 		spinner spn_length "Length" range:[0,100000,0] 
 		spinner spn_width "Width" range:[0,100000,0] units:#Dec_In
 		spinner spn_height "Height" range:[0,100000,0]
 		spinner spn_thickness "Thickness" range:[0.01,100000,1]
 		
 	 )

I have borrowed some code from one of Bobo’s podcasts for autodesk to illustrate my attempts.

Does anyone know how to achieve this? Or is my question just confusing?

2 Replies

spinner sp “Value: ” type:#worldunits

Thanks Denis, couldn’t seem to find that in the help. Hence my failing example which the help seemed to imply would work.