/// <summary> /// Constructs a new content of the specified type and add it to the persistent content list. /// This function cannot be used to create temporary content that you delete after use. /// Content created by this function is owned by RDK and appears in the content editor. /// To create a temporary content which is owned by you, call RhRdkContentFactories().NewContentFromType(). /// </summary> /// <param name="type">is the type of the content to add.</param> /// <param name="parent">Parent is the parent content. If not NULL, this must be an RDK-owned content that is /// in the persistent content list (either top-level or child). The new content then becomes its child. /// If NULL, the new content is added to the top-level content list instead.</param> /// <param name="childSlotName">ChildSlotName is the unique child identifier to use for the new content when creating it as a child of pParent (i.e., when pParent is not NULL)</param> /// <param name="flags">Options for the tab.</param> /// <param name="doc">The current Rhino document.</param> /// <returns>A new persistent render content.</returns> public static RenderContent Create(Type type, RenderContent parent, String childSlotName, ShowContentChooserFlags flags, RhinoDoc doc) { return Create(type.GUID, parent, childSlotName, flags, doc); }
/// <summary> /// Constructs a new content of the specified type and add it to the persistent content list. /// This function cannot be used to create temporary content that you delete after use. /// Content created by this function is owned by RDK and appears in the content editor. /// To create a temporary content which is owned by you, call RhRdkContentFactories().NewContentFromType(). /// </summary> /// <param name="type">is the type of the content to add.</param> /// <param name="parent">Parent is the parent content. If not NULL, this must be an RDK-owned content that is /// in the persistent content list (either top-level or child). The new content then becomes its child. /// If NULL, the new content is added to the top-level content list instead.</param> /// <param name="childSlotName">ChildSlotName is the unique child identifier to use for the new content when creating it as a child of pParent (i.e., when pParent is not NULL)</param> /// <param name="flags">Options for the tab.</param> /// <param name="doc">The current Rhino document.</param> /// <returns>A new persistent render content.</returns> public static RenderContent Create(Guid type, RenderContent parent, String childSlotName, ShowContentChooserFlags flags, RhinoDoc doc) { IntPtr pContent = UnsafeNativeMethods.Rdk_Globals_CreateContentByType(type, parent.ConstPointer(), childSlotName, (int)flags, doc.m_docId); return pContent == IntPtr.Zero ? null : FromPointer(pContent); }
/// <summary> /// Constructs a new content of the specified type and add it to the persistent content list. /// This function cannot be used to create temporary content that you delete after use. /// Content created by this function is owned by RDK and appears in the content editor. /// To create a temporary content which is owned by you, call RhRdkContentFactories().NewContentFromType(). /// </summary> /// <param name="type">Is the type of the content to add.</param> /// <param name="flags">Options for the tab.</param> /// <param name="doc">The current Rhino document.</param> /// <returns>A new persistent render content.</returns> public static RenderContent Create(Guid type, ShowContentChooserFlags flags, RhinoDoc doc) { IntPtr pContent = UnsafeNativeMethods.Rdk_Globals_CreateContentByType(type, IntPtr.Zero, String.Empty, (int)flags, doc.m_docId); return pContent == IntPtr.Zero ? null : FromPointer(pContent); }
/// <summary> /// Constructs a new content of the specified type and add it to the persistent content list. /// This function cannot be used to create temporary content that you delete after use. /// Content created by this function is owned by RDK and appears in the content editor. /// To create a temporary content which is owned by you, call RhRdkContentFactories().NewContentFromType(). /// </summary> /// <param name="type">Is the type of the content to add.</param> /// <param name="flags">Options for the tab.</param> /// <param name="doc">The current Rhino document.</param> /// <returns>A new persistent render content.</returns> public static RenderContent Create(Type type, ShowContentChooserFlags flags, RhinoDoc doc) { return Create(type.GUID, flags, doc); }
/// <summary> /// Shows the content chooser to allow the user to select a new or existing content. /// </summary> /// <param name="defaultType">The content type that will be initially selected in the 'New' tab.</param> /// <param name="defaultInstanceId">The content instance that will be initially selected in the 'Existing' tab.</param> /// <param name="kinds">Which content kinds will be displayed.</param> /// <param name="instanceIdOut">The UUID of the chosen item. Depending on eRhRdkSccResult, this can be the type id of a content type or the instance id of an existing content.</param> /// <param name="flags">Tabs specifications.</param> /// <param name="doc">A Rhino document.</param> /// <returns>The result.</returns> public static ShowContentChooserResults ShowContentChooser(Guid defaultType, Guid defaultInstanceId, RenderContentKind kinds, ref Guid instanceIdOut, ShowContentChooserFlags flags, RhinoDoc doc) { return (ShowContentChooserResults)UnsafeNativeMethods.Rdk_Globals_ShowContentChooser(defaultType, defaultInstanceId, RenderContent.KindString(kinds), ref instanceIdOut, (int)flags, doc.m_docId); }