# Custom properties window

**URL:** <https://discourse.mcneel.com/t/custom-properties-window/11106>\
**Category:** Rhino Developer\
**Created:** [August 23, 2014, 10:04am UTC](https://discourse.mcneel.com/t/custom-properties-window/11106 "2014-08-23T10:04:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![karol\_wierzbicki](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/karol_wierzbicki/32/164716_2.png) [@karol\_wierzbicki](https://discourse.mcneel.com/u/karol_wierzbicki)\
**Post date:** [August 23, 2014, 10:04am UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/1 "2014-08-23T10:04:34Z")

</div>

Hi,

Is it possible to customize properties tab? I need to display user strings whenever I select the object.

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/685184_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [August 25, 2014, 3:50pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/3 "2014-08-25T15:50:27Z")

</div>

Yes, it is possible to provide your own custom object properties pages.

From a RhinoCommon plug-in project, you will need to override the `ObjectPropertiesPages` virtual function, found on your plug-in object, and return one or more `ObjectPropertiesPage` objects.

Let me know if you need to see a sample…

---

<div class="post-metadata">

**Author:** ![karol\_wierzbicki](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/karol_wierzbicki/32/164716_2.png) [@karol\_wierzbicki](https://discourse.mcneel.com/u/karol_wierzbicki)\
**Post date:** [August 25, 2014, 4:14pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/4 "2014-08-25T16:14:22Z")

</div>

I would appreciate a simple example.  
I will also need to use ComboBox, so if this also needs any special approach, It would be nice to see it. But with comboBox I hope I should manage by myself.

* * *

OK, I’m nearly there. Now I try to initialize this control, but I’m not sure what I need to provide to Initialize method? What kind of Rhino Object?

InitializeControls(RhinoObject rhObj);

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [August 27, 2014, 7:04am UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/5 "2014-08-27T07:04:02Z")

</div>

I have also been trying to get this to work (sorry for hijacking the topic 😄) and have run into this problem:

Upon selecting an object in Rhino, I get a call to the overridden `ShouldDisplay` method. The `RhinoObject` that is received there is always `null`. So I cannot decide in this method whether the custom object properties page should be shown.

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/685184_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [August 27, 2014, 7:50pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/6 "2014-08-27T19:50:33Z")

</div>

After making a run, clearly there isn’t enough exposed to properly add a page to the Object Properties panel. I’ll work with @stevebaer to see if we can get what we need in a future Rhino release.

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/685184_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [August 27, 2014, 7:58pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/7 "2014-08-27T19:58:51Z")

</div>

Here is the tracking item:

[http://mcneel.myjetbrains.com/youtrack/issue/RH-28555](http://mcneel.myjetbrains.com/youtrack/issue/RH-28555)

---

<div class="post-metadata">

**Author:** ![karol\_wierzbicki](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/karol_wierzbicki/32/164716_2.png) [@karol\_wierzbicki](https://discourse.mcneel.com/u/karol_wierzbicki)\
**Post date:** [August 28, 2014, 5:42am UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/8 "2014-08-28T05:42:53Z")

</div>

How can I register and get to this link?

---

<div class="post-metadata">

**Author:** ![dveenendaal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dveenendaal/32/60943_2.png) [@dveenendaal](https://discourse.mcneel.com/u/dveenendaal)\
**Post date:** [September 17, 2015, 3:01pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/9 "2015-09-17T15:01:19Z")

</div>

How far did you get with this? The comments below don’t really close the discussion.

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [September 17, 2015, 5:35pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/10 "2015-09-17T17:35:32Z")

</div>

The work item on the bug tracker s still open, so I don’t think it has been fixed…

---

<div class="post-metadata">

**Author:** ![Jess](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jess/32/769577_2.png) [@Jess](https://discourse.mcneel.com/u/Jess)\
**Post date:** [September 18, 2015, 2:20pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/11 "2015-09-18T14:20:03Z")

</div>

There is a Sample which seems to work: [https://github.com/dalefugier/SampleCsObjectProperties](https://github.com/dalefugier/SampleCsObjectProperties)  
It is showing up on circles.

---

<div class="post-metadata">

**Author:** ![stevebaer](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/stevebaer/32/473567_2.png) [@stevebaer](https://discourse.mcneel.com/u/stevebaer)\
**Post date:** [September 18, 2015, 2:55pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/12 "2015-09-18T14:55:25Z")

</div>

Use an object iterator with a filter for the object types that you care about to get the selected objects in InitializeControls. This will work as good if not better than the C++ functions that are not wrapped.

---

<div class="post-metadata">

**Author:** ![dveenendaal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dveenendaal/32/60943_2.png) [@dveenendaal](https://discourse.mcneel.com/u/dveenendaal)\
**Post date:** [September 22, 2015, 2:51pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/13 "2015-09-22T14:51:26Z")

</div>

Would it be possible to achieve this entirely through Rhino.Python?

---

<div class="post-metadata">

**Author:** ![stevebaer](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/stevebaer/32/473567_2.png) [@stevebaer](https://discourse.mcneel.com/u/stevebaer)\
**Post date:** [September 22, 2015, 3:12pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/14 "2015-09-22T15:12:30Z")

</div>

No, not at this time. These panels need to be associated with a compiled plug-in

---

<div class="post-metadata">

**Author:** ![clement](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/clement/32/759176_2.png) [@clement](https://discourse.mcneel.com/u/clement)\
**Post date:** [September 22, 2015, 4:14pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/15 "2015-09-22T16:14:33Z")

</div>

@stevebaer, recently i´ve stumbled across [this](https://msdn.microsoft.com/en-us/library/aa302326.aspx) example using a PropertyGrid in a WinForm dialog which seems to work through Rhino Python. Below is a stripped down example:

```auto
import System
from System.Drawing import *
from System.ComponentModel import *
from System.Windows.Forms import *
    
class OptionsDialog(System.Windows.Forms.Form):
    def __init__ (self):
        OptionsPropertyGrid = PropertyGrid()
        OptionsPropertyGrid.Size = Size(280, 260)
        self.Controls.Add(OptionsPropertyGrid)
        self.Text = "Options"
        appset = AppSettings()
        OptionsPropertyGrid.SelectedObject = appset
    
class AppSettings():
    def __init__ (self):
        #[CategoryAttribute("MySettings"), DefaultValueAttribute(True)]
        self.SaveOnClose = True
    
d = OptionsDialog()
if d.ShowDialog() == DialogResult.Cancel:
    print "saveOnClose =", d.Controls[0].SelectedObjects[0].SaveOnClose
d.Dispose()

```

I´ve found a way to track `PropertyValueChanged` events to make it work in SemiModal way and to return results when the window is closed as shown above.

However setting simple things like `CathegoryAttribute()` or `DefaultValueAttribute()` are still a mystery. (see the comment in the code above). Can you please help with this and show an example how the `AppSettings()` class above has to look like ?

thank you,  
c.

---

<div class="post-metadata">

**Author:** ![1056960357](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/1056960357/32/656508_2.png) [@1056960357](https://discourse.mcneel.com/u/1056960357)\
**Post date:** [September 29, 2019, 6:07am UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/16 "2019-09-29T06:07:28Z")

</div>

Hi @Jess the link [https://github.com/dalefugier/SampleCsObjectProperties](https://github.com/dalefugier/SampleCsObjectProperties) is unusable,

---

<div class="post-metadata">

**Author:** ![Jess](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jess/32/769577_2.png) [@Jess](https://discourse.mcneel.com/u/Jess)\
**Post date:** [September 29, 2019, 9:10am UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/17 "2019-09-29T09:10:06Z")

</div>

Hi, this thread is probably outdated. Better start a new topic…

---

<div class="post-metadata">

**Author:** ![jeffoulet](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeffoulet/32/499869_2.png) [@jeffoulet](https://discourse.mcneel.com/u/jeffoulet)\
**Post date:** [September 29, 2019, 11:59am UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/18 "2019-09-29T11:59:09Z")

</div>

Hi,  
It has been moved here: [https://github.com/mcneel/rhino-developer-samples/tree/6/rhinocommon/cs/SampleCsWinForms](https://github.com/mcneel/rhino-developer-samples/tree/6/rhinocommon/cs/SampleCsWinForms)

Sample for ObjectPropertiesPage form is here: [https://github.com/mcneel/rhino-developer-samples/blob/6/rhinocommon/cs/SampleCsWinForms/Forms/SampleCsObjectPropertiesPage.cs](https://github.com/mcneel/rhino-developer-samples/blob/6/rhinocommon/cs/SampleCsWinForms/Forms/SampleCsObjectPropertiesPage.cs)

---

<div class="post-metadata">

**Author:** ![1056960357](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/1056960357/32/656508_2.png) [@1056960357](https://discourse.mcneel.com/u/1056960357)\
**Post date:** [September 30, 2019, 1:48am UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/19 "2019-09-30T01:48:02Z")

</div>

@jeffoulet Thanks, It is helpfully for me

---

<div class="post-metadata">

**Author:** ![o.a.telemakov](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/o.a.telemakov/32/545429_2.png) [@o.a.telemakov](https://discourse.mcneel.com/u/o.a.telemakov)\
**Post date:** [March 29, 2024, 7:45pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/20 "2024-03-29T19:45:10Z")

</div>

I’m trying to write a script in Rhino 7, in EditPythonScript, that would set up my page  
to the Properties panel.  
But I can’t use the PlugIn.ObjectPropertiesPages function  
Is this even possible or not?

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/685184_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [March 29, 2024, 8:56pm UTC](https://discourse.mcneel.com/t/custom-properties-window/11106/21 "2024-03-29T20:56:12Z")

</div>

> [@o.a.telemakov](#):
>
> Is this even possible or not?

From a Python script, no. You’ll need to write a plug-in for this.

– Dale

[Next page](https://discourse.mcneel.com/t/custom-properties-window/11106.md?page=2)
