ObjectPropertiesPage

References
public abstract class ObjectPropertiesPage
Base class used to add object property user interface panels

Properties

AllObjectsMustBeSupported

#Since v6.7
Returns false which only requires a single item of SupportedTypes to be selected. Override if you wish to change the above behavior.
[CLSCompliant(false)] public virtual bool AllObjectsMustBeSupported { get; }

EnglishPageTitle

#Since v5.0
English string used to describe this page
public abstract string EnglishPageTitle { get; }

Icon

#Since v5.0
(OBSOLETE - Override PageIcon instead) Icon to display in the object properties tab control
public virtual Icon Icon { get; }
obsoleteOverride PageIcon instead

Index

#Since v7.0
The page navigation control adds buttons in the order the pages are processed, override this method and return a sort index to move the button to the beginning of the list. By default this returns -1 which puts the button at the end of the list.
public virtual int Index { get; }

LocalPageTitle

#Since v5.0
Localized page description string, returns the EnglishPageTitle by default.
public virtual string LocalPageTitle { get; }

PageControl

#Since v5.0
The control that represents this page. Rhino Windows supports classes that implement the IWin32Windows interface, are derived from System.Windows.FrameworkElement or Eto.Forms.Control. Mac Rhino supports controls that are derived from NSview or Eto.Forms.Control.
public virtual object PageControl { get; }

PageIconEmbeddedResourceString

#Since v6.4
Resource string for a embedded icon resource in the assembly containing the page instance. If this returns a valid resource and Rhino can load the icon the loaded icon will get used directly otherwise; the PageIcon method will get called.
public virtual string PageIconEmbeddedResourceString { get; }
The page icon embedded resource string.

PageType

#Since v5.11
Override this and return the page you want to replace a specific object properties page.
public virtual PropertyPageType PageType { get; }

SelectedObjects

#Since v5.11
Return a list of Rhino objects to be processed by this object properties page
public RhinoObject[] SelectedObjects { get; }

SupportedTypes

#Since v6.0
Override to specify which objects this page supports
[CLSCompliant(false)] public virtual ObjectType SupportedTypes { get; }

SupportsSubObjects

#Since v6.0
If your object properties page supports sub-object selection, you should override this method and return true. This is ignored for view pages. The default implementation returns false.
public virtual bool SupportsSubObjects { get; }

Methods

AnySelectedObject<T>

#Since v6.0
Return true if any of the selected objects match the given type
public bool AnySelectedObject<T>()

AnySelectedObject<T>

#Since v6.7
Return true if any of the selected objects match the given type
public bool AnySelectedObject<T>(
allMustMatch
If true then every selected object must match the object type otherwise; only a single object has to be of the specified type
)

GetSelectedObjects

#Since v6.0
Get selected objects that match a given filter
[CLSCompliant(false)] public RhinoObject[] GetSelectedObjects(
ObjectType
filter
)

GetSelectedObjects<T>

#Since v6.0
Get selected objects of a given type
public T[] GetSelectedObjects<T>()

InitializeControls

#Since v5.0 Obsolete v6.0
Called on the active page after the selected objects list has changed to notify the page to initialize its content to reflect the new object list.
public virtual void InitializeControls()
obsoleteInitializeControls is obsolete, override UpdatePage instead

ModifyPage

#Since v6.0
Call this method when the page is ready to modify the selected objects list. Rhino will suspend UpdatePageNotfictaion, call the passed action then restore UpdatePageNotfictaion.
public void ModifyPage(
callbackAction
Called when it is safe to modify objects.
)

OnActivate

#Since v5.0
Called when this page is activated/deactivated.
public virtual bool OnActivate(
active
If true then this page is on top otherwise it is about to be hidden.
)
If true then the page is hidden and the requested page is not activated otherwise will not allow you to change the current page. Default returns true. The return value is currently ignored.

OnCreateParent

#Since v5.0
Called when the parent container is initially created.
public virtual void OnCreateParent(
nint
hwndParent
)

OnHelp

#Since v5.0
Called when the F1 key or help button is pressed, override to display plug-in specific help for this page.
public virtual void OnHelp()

OnSizeParent

#Since v5.0
Called when the parent containers client rectangle size has changed and the PageControl has been resized.
public virtual void OnSizeParent(
width,
height
)

PageIcon

#Since v6.0
Icon to display in the object properties tab control. Will not get called if PageIconEmbeddedResourceString is overridden and provides a string for a successfully loaded icon resource.
public virtual Icon PageIcon(
sizeInPixels
The requested icon size in pixels, DPI scaling has been applied. The default value is 24 X DPI scale.
)

RunScript

#Since v6.0
This method is called when scripting the Rhino Properties command and choosing this page.
public virtual Result RunScript(
e
Provides access to the selected object list and document.
)

RunScript

#Since v6.0 Obsolete v6.0
This method is called when scripting the Rhino Properties command and choosing this page.
public virtual Result RunScript(
doc,
Active RhinoDoc
objectList
List of objects selected by the Properties command.
)
obsoleteRunScript(RhinoDoc doc, RhinoObject[] objectList) is obsolete, override RunScript(ObjectPropertiesPageEventArgs e) instead

ShouldDisplay

#Since v6.0
Called when the selected objects list changes, return true if the object list contains one or more object the page can modify.
public virtual bool ShouldDisplay()

ShouldDisplay

#Since v5.0 Obsolete v6.0
Called when the selected objects list changes, return true if the object list contains one or more object the page can modify.
public virtual bool ShouldDisplay()
obsoleteShouldDisplay(RhinoObject rhObj) is obsolete, override ShouldDisplay(ObjectPropertiesPageEventArgs e) instead

UpdatePage

#Since v6.0
Called on the active page after the selected objects list has changed to notify the page to initialize its content to reflect the new object list.
public virtual void UpdatePage()