THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/06/2012 at 20:26, xxxxxxxx wrote:
Hello helpful cafe-ers!
Long time lurker, first time caller, and I'm really sorry if this is a dumb question or posted incorrectly; just let me know if I'm doing something wrong.
Right, so, here's basically what I want to do:
from c4d import documents
def main() :
c4d.CallCommand(100004766) ##Select All in Object Manager
c4d.CallCommand(16768) ##Connect and Delete
So simple! Right? And, indeed, when I execute it everything works how I expect. All of the objects in the object manager (that I've made polygon objects) are selected, connected, and deleted. Now, when I add this before the two callcommands:
path = '[insert file path here]'
It'll load the file just fine, but won't run the commands. Furthermore, by way of testing things I would make code like this, for example:
path = 'C:\\Users\\Dr. Doom\\Desktop\\RBDTestTarget\\RBDST_25.c4d'
target = c4d.documents.BaseDocument()
target = c4d.documents.GetFirstDocument()
And the cube would be inserted. If I traded the insert cube line with the callcommand()'s, however, they wouldn't work : \
What am I not understanding about loading files and callcommands that's got me hung up? I've also tried using LoadDocument with the objects flag, and a few other things, but no joy.
Thanks so much for your help!
Sorry for the post length.