In update 15, we have made some changes to PickList APIs.
Native side:
Added APIs:
/// Set the name of this PickList. /// User needs to ensure there isn't a PickList with the same name in the PickListLibrary. /// PickListLibrary's method GetPickListByName can check if a PickList exists. /// @param[in] name The new name. DGNPLATFORM_EXPORT void SetName(WStringCR name); /// Sort PickListValues. /// @param[in] ascending Sort values by ascending or descending order. DGNPLATFORM_EXPORT void SortValues ( bool ascending );
/// Save PickListLibrary to dgn file. /// @param[in] dgnFile The dgn file which the PickListLibrary is saved to. /// @param[in] pickListLib The PickListLibrary which is being saved. /// @param[in] pickListChangeIds The Ids for PickList changes. This vector doesn't contain PickListValue changes /// @param[in] pickListValueChangeIds The Ids for PickListValue changes. /// The inner vector should only contains 2 numbers, /// the first is PickListId, the second is PickListValue Id /// @param[in] isUpdateRelatedObjects If update related objects. /// @returns true if the PickListLibrary will be successfully saved to dgn file. DGNPLATFORM_EXPORT static bool SavePickListLibToDgnWithChanges ( DgnFileP dgnFile, PickListLibrary& pickListLib, std::vector<UInt32>& pickListChangeIds, std::vector<std::vector<UInt32>>& pickListValueChangeIds, bool isUpdateRelatedObjects = false ); /// Unfortunately, we didn't release an SDK example for method SavePickListLibToDgnWithChanges, we'll add it in next update.
Removed APIs:
/// Add the given dgnlib file into list. /// @param[in] dgnFile The given dgnlib file. /// @returns true if the given dgnlib file was added into the list. DGNPLATFORM_EXPORT static bool AddDgnLib(DgnFileP dgnLib); /// The reason for remove this API is that user don’t need to add DgnLibs through PickListLibrary by hand.
Managed side:
Added comments:
/// <summary> The name of PickList. /// User needs to ensure there isn't a PickList with same name in the PickListLibrary. /// PickListLibrary's method GetPickListByName can check if a PickList exists.</summary> property String^ Name { String^ get(); void set(String^); }
Added method:
/// <summary> Sort PickListValues. </summary> /// <param name="ascending">Sort values by ascending or descending</param> void SortValues ( bool ascending );
/// <summary> Get the PickList by Id. </summary> /// <param name="id">The id of the PickList to be got</param> /// <returns>The reference of the PickList to be got.</returns> PickList^ GetPickListById ( UInt32 id ); /// <summary>Save PickListLibrary to dgn file with PickList and PickListValue changes.</summary> /// <param name = "dgnFile">The dgn file which the PickListLibrary is saved to.</param> /// <param name = "pickListLib">The PickListLibrary which is being saved.</param> /// <param name = "isUpdateRelatedObjects">If update related objects.</param> /// <param name = "pickListChangedIds">The Ids for PickList changes.</param> /// <param name = "pickListValueChangedIds">The Ids for PickListValue changes. /// The inner vector should only contains 2 numbers, /// the first is PickListId, the second is PickListValue Id</param> /// <returns>true if the PickListLibrary will be successfully saved to dgn file.</returns> static bool SavePickListLibToDgnWithChanges ( DgnFile^ dgnFile, PickListLibrary^ pickListLib, bool isUpdateRelatedObjects, List<UInt32>^ pickListChangedIds, List<List<UInt32>^>^ pickListValueChangedIds ); /// Unfortunately, we didn't release an SDK example for method SavePickListLibToDgnWithChanges, we'll add it in next update.
Removed API:
/// <summary>Add the given dgnlib file into list.</summary> /// <param name = "dgnLib">The given dgnlib file.</param> /// <returns>true if the given dgnlib file was added into the list.</returns> static bool AddDgnLib(DgnFile^ dgnLib); /// The reason for removing this API is that user don’t need to add DgnLibs through PickListLibrary by hand.