I am currently looking at writing a function to create our folder structure within the Plant 3D project.
I have looked at the PnPProjectFolder object but am unable to determine how to create a new project folder.
I do not understand how I obtain a folderGUID or the best way to discover if the folder exists. (I can loop through the ProjectItems collection).
We need to add 30 folders, including sub-folders, setting their paths as we are not using virtual folders.
I am not at a stage where I have any code worth publishing here.
I would appreciate and guidance on this.
Solved! Go to Solution.
Let me possibly save you some work.
If you make a template project, build your folder structure under the template. Then, when you create a new project in Project Manager, use the "Copy settings form existing proect" radio button.
This will buid the project strucure under the new project.
This is how we deploy all our customisation / configuration changes in a consisytent manner for all clients.
I hope this helps.
Technical Specialist - Plant
I have looked at this method and found that I can achieve what I require.
The trick for me was to specify the same folder for the P&ID drawings and the Plant 3D model drawings, then the project folders were built on top of that, as I required them.
I would still like to know how to achieve this programatically as the API does imply it can be done.
The PnpProjectFolder class only creates the Virtual entries in the project database, not the physical entries on disk - to do that you need to use the normal Microsoft APIs.
I hope this explains.
Unfortunately I need more information
Public Sub AddMyFolder()
Dim oPrjPiping As Project = DirectCast(PlantApplication.CurrentProject.ProjectParts("Piping"), _
Dim MyFolder As New PnPProjectFolder
Dim FldrName As String = "C:\CAD_Dwg"
MyFolder.Name = "CAD_DWG"
MyFolder.AbsoluteFolderPath = FldrName
Dim FldrGuid As String = oPrjPiping.CreateFolder("Plant 3D Drawings", MyFolder)
Can you advise where I am going wrong?
In this FldrGuid = “”
I think if you pass null to CreateFolder it will do the magic for you...
string FldrGuid = oPrjPiping.CreateFolder(null, MyFolder);
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register