I am trying to figure out how to access via VB.NET the "Selection List" setup for both the PnID and P3D, buried in the Project Properties / Setup. The only reference I can find is in the chm Plant SDK 2015: Developer Help, under Plant Project / Se Up Selection Lists and reads:
quote
As part of project setup tasks, developers can set up new selection lists or change the values of existing lists.
The new or modified selection lists populate the Class Property Settings data, where the properties of each class (specific component or line) are defined.
Those properties are included in the component behavior when it is placed from the tool palette onto a drawing.
end quote
However, no examples are given. Any one have a bit of code that will point me in the right direction?
Solved! Go to Solution.
Solved by dave.wolfe. Go to Solution.
Here's a short sample that shows how to access (C#).
if (PlantApplication.CurrentProject == null) return; (PipingProject)PlantApplication.CurrentProject.ProjectParts["Piping"]; Project pnid = PlantApplication.CurrentProject.ProjectParts["PnID"]; PnPDatabaseMode current = pnid.Mode; try { pnid.Mode = PnPDatabaseMode.Exclusive; } catch { throw new System.Exception("Unable to modify project setup while other users are in the project."); } string picklistname = "Pipe_Specs"; PnPPicklist specList = pnid.Picklists.Add(picklistname, picklistname); foreach (var s in specs) { specList.Add(s, string.Empty); } pnid.Save();
Thanks Dave. I was thinking I needed to check into PickList since my searching through the Object Browser for SelectionList was going nowhere. I will run your example through a C#2VB Converter and head in that direction. Thanks again.