im trying to figure out if im doing something wrong or if the api call just doesnt work.
i have a WorkArea in projectwise. this workarea has a configuration Settings Block (CSB) assigned to the workspace level.
im using the aaApi_CopyProjectWithHierarchy api call and the api call is returning true and the workarea and all sub-folders are copied but when i look at the properties for the newly copied workarea there is no CSB set for the workspace level like the source workarea has.
here is my code
int count2 = 0; bool result = PWWrappers.aaApi_CopyProjectWithHierarchy(templateWorkSetID, parentWorkSetID, PWConstants.ProjectCopyFlags.AAPRO_ARRAY_COPY_CONFBLOCKS, 0, (IntPtr)null, (IntPtr)null, ref count2);
my wrapper looks like this
[DllImport("dmscli.dll", CharSet = CharSet.Unicode)] public static extern bool aaApi_CopyProjectWithHierarchy(int lSourceProjectId, int lTargetProjectId, PWConstants.ProjectCopyFlags ulRootFlags, PWConstants.ProjectCopyFlags ulHierarchyFlags, IntPtr fpCallBack, IntPtr aaUserParam, ref int lplCount); .. [Flags] public enum ProjectCopyFlags : uint { AAPRO_ARRAY_ATTRIBUTES = 16, //Document attributes will be copied. AAPRO_ARRAY_TAKE_OWNERSHIP = 64, //The current user will be the project manager for all copied projects. AAPRO_ARRAY_ALLOW_COPY_ALL = 128, //If this flag is set the source project can be passed as 0 to copy all projects. AAPRO_ARRAY_FOR_COPY = 268435456, //Fills attributes for copy only. //AAPRO_ARRAY_NO_SELF_COPY = 0x40000000L, //If target project is a subfolder of the template project, it will not be copied. AAPRO_ARRAY_COPY_WORKFLOW = 4096, // The workflow is copied from source projects to the new projects. AAPRO_ARRAY_COPY_ACCESS = 8192, //The access control is copied from source projects to the new projects. AAPRO_ARRAY_COPY_MANAGER = 16384, //If set then the manager is copied from source projects to the new projects. AAPRO_ARRAY_COPY_STORAGE = 32768, //The storage is copied from source projects to new projects. AAPRO_ARRAY_COPY_ENV = 65536, AAPRO_ARRAY_COPY_VERSIONS = 131072, AAPRO_ARRAY_COMPONENTS = 262144, AAPRO_ARRAY_COPY_SAVED_SRC = 524288, AAPRO_ARRAY_COPY_RESOURCES = 1048576, AAPRO_ARRAY_COPY_CONFBLOCKS = 2097152, AAPRO_ARRAY_COPY_CONTENTS = 4194304, //Don't create the project, just copy contents to the existing project. AAPRO_ARRAY_COPY_WS_PROFL = 8388608 }
Don't know why its not working.
i have also tried it with these flags with didn't work either
[Flags] public enum ProjectCopyFlags : ulong { AAPRO_ARRAY_ATTRIBUTES = 0x00000010L, //Document attributes will be copied. AAPRO_ARRAY_TAKE_OWNERSHIP = 0x00000040L, //The current user will be the project manager for all copied projects. AAPRO_ARRAY_ALLOW_COPY_ALL = 0x00000080L, //If this flag is set the source project can be passed as 0 to copy all projects. AAPRO_ARRAY_FOR_COPY = 0x10000000L, //Fills attributes for copy only. AAPRO_ARRAY_NO_SELF_COPY = 0x40000000L, //If target project is a subfolder of the template project, it will not be copied. AAPRO_ARRAY_COPY_WORKFLOW = 0x00001000L, // The workflow is copied from source projects to the new projects. AAPRO_ARRAY_COPY_ACCESS = 0x00002000L, //The access control is copied from source projects to the new projects. AAPRO_ARRAY_COPY_MANAGER = 0x00004000L, //If set then the manager is copied from source projects to the new projects. AAPRO_ARRAY_COPY_STORAGE = 0x00008000L, //The storage is copied from source projects to new projects. AAPRO_ARRAY_COPY_ENV = 0x00010000L, AAPRO_ARRAY_COPY_VERSIONS = 0x00020000L, AAPRO_ARRAY_COMPONENTS = 0x00040000L, AAPRO_ARRAY_COPY_SAVED_SRC = 0x00080000L, AAPRO_ARRAY_COPY_RESOURCES = 0x00100000L, AAPRO_ARRAY_COPY_CONFBLOCKS = 0x00200000L, AAPRO_ARRAY_COPY_CONTENTS = 0x00400000L, //Don't create the project, just copy contents to the existing project. AAPRO_ARRAY_COPY_WS_PROFL = 0x00800000L }
anyone ever get this to work??