'Object is part of a project' debug error

When running my add-in I get the error message ‘ArgumentException is unhandled: Object is part of a project’ in the Visual C# debugger when

myPart.Bodies.Add(myWire); executes.
Can anyone explain what this message means?

Thanks,

Kevin

An object cannot have two parents. You must make sure myWire is “orphaned” before you add it to a part.

BTW, API questions should go in the “Developer Tools” forum.

Thanks Johannes.

Kevin