If you are new to c# and looking for the actual control for a “property panel” style control (assuming you are using WinForms) you’ll want to check out the PropertyGrid in the Controls ToolBox when you are making your form (it may not show up under the Common Controls section, but shows up under All Windows Forms). I’m quite fond of them, and have used them in my own Rhino Docking Panels. You end up writing a lot of wrapper “Properties”, but for me it’s less overhead and headache than having to code 30 edit boxes…
Thanks in advance for any help. I’ve been looking with no success about how to develop a panel with a “dynamic” update based on user selection in Rhino.
At present the data is stored as usertext, and I’d like to be able to “disable” the displayed value if it differs when multiple objects are selected. Something like the display color. If the sample also showed a pick list like this, it would be great.
For anyone looking to still build against an older rhcommon dll but support this, I found using reflection I could invoke the SelectedObjects property using this code in the SampleCsObjectPropertiesPage class
RhinoObject robjs = this.GetType().GetProperty(“SelectedObjects”).GetValue(this, null) as RhinoObject;
foreach (RhinoObject rh_obj in robjs)
Thanks for the reply. In an ideal world, yes I would only build against latest release. But I have some clients who never move from SR0. Not necessarily the end users, but typically the IT support in charge of deployments (usually in large firms). Users don’t have admin permissions on their computer. Whilst it should be obvious that fixes and improvements are there to be gained, it’s not as easy as observing that. So if I try to enforce latest build I’m going to loose clients and users. I actually only recently stopped supporting v4.0 (although I was enforcing a service release on this, v4SR0 was too many years ago).
This isn’t necessarily a problem for me, this is the first time where I’ve found a property in a new release that I really wanted to use. Especially given that it seems it’s only one property, Using reflection I’ll be able to disable the panel on incompatible installations, and support the feature in those that do.
(I hope I’m at the right place for my question :] )
In your helpfull plugin sample “SampleCsObjectProperties” you’re displaying the radius of a circle in an custom property panel.
Would it be for example possible, as the panel close (i.e. when the object is deselected), to store the displayed radius as the object name itself?
The final goal would to be able to display/modify custom objects UserText’s from a custom Panel. I’m quite a newbie in C# programming, I already (& roughly) achieved to display a UserText value, but I don’t get how to update it as the panel close.
public override void InitializeControls(RhinoObject rhObj)
foreach (var rh_obj in SelectedObjects)
if (null != rh_obj)
if (null != rh_obj.Attributes.GetUserStrings())