Hi @florescu.d95. That error basically means that it was not able to use one of the inputs you supplied into that AddCustomContentCenterPart method, for one reason or another. The first possibility that come to mind is that there is already a component present in the assembly with that same exact name, and it will not allow two components to have exactly the same name. That is why it always puts something like ":1" after the component name when they are added manually. I believe that when adding components into an assembly by code, it lacks the user interaction required for the automatic rename utility catch and react to, so it does not rename stuff created that way. Another theory is that a model file with the same path and name as that line of code generates may already exist, and it may not want to overwrite that existing file. Or, perhaps the simple act of overwriting an existing file is not the problem, but maybe it will not allow you to overwrite the file if a reference to that file is currently being held in Inventor's session memory for some reason. If that file was just created during your current session of Inventor, and maybe even while the same assembly was still open, then it is possible that a reference to that may still exist in Inventor's session memory. If that is the case, then one other thing comes to mind that may be able to help.
ThisApplication.Documents.CloseAll(True)
The 'True' in that line specifies that it should only clear out all of the unreferenced documents being held in Inventor's session memory, and not to close any documents that are still being actively referenced by open assemblies or drawings. This is a good tool to help performance when looping through many file/document references. It is often used together with the Document.ReleaseReference method, which is used to get rid of references to documents that were opened invisibly (in the background), and are not being used by anything else.
Not sure if any of these may be the cause, or if any of these suggestions may help, but just throwing out some stuff that comes to mind, in case it may help.
Wesley Crihfield

(Not an Autodesk Employee)