/// <summary> /// Constructs a new content chosen by the user 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. /// </summary> /// <param name="defaultType">The default content type.</param> /// <param name="defaultInstance">The default selected content instance.</param> /// <param name="kinds">Determines which content kinds are allowed to be chosen from the dialog.</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 CreateContentByUser(Guid defaultType, Guid defaultInstance, RenderContentKind kinds, ChooseContentFlags flags, RhinoDoc doc) { IntPtr pContent = UnsafeNativeMethods.Rdk_Globals_CreateContentByUser(defaultType, defaultInstance, RenderContent.KindString(kinds), (int)flags, doc.m_docId); return pContent == IntPtr.Zero ? null : RenderContent.FromPointer(pContent); }
/// <summary> /// Allows the user to choose a content by displaying the Content Chooser dialog. /// The dialog will have OK, Cancel and Help buttons, and optional New and Edit buttons. /// </summary> /// <param name="instanceId">Sets the initially selected content and receives the instance id of the chosen content.</param> /// <param name="kinds">Specifies the kind(s) of content that should be displayed in the chooser.</param> /// <param name="flags">Specifies flags controlling the browser.</param> /// <param name="doc">A Rhino document.</param> /// <returns>true if the operation succeeded.</returns> public static bool ChooseContent(ref Guid instanceId, RenderContentKind kinds, ChooseContentFlags flags, RhinoDoc doc) { return 1 == UnsafeNativeMethods.Rdk_Globals_ChooseContentEx(ref instanceId, RenderContent.KindString(kinds), (int)flags, doc.m_docId); }