THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/02/2009 at 08:13, xxxxxxxx wrote:
User Information:
Cinema 4D Version:
Platform:
Language(s) :
---------
Hi,
i want to save a single object into a new document, using this code:
> <code>
> fn.SetDirectory(Filename(path));
> fn.SetFile(object->GetName());
> fn.SetSuffix("c4d");
> //GePrint("saving "+object->GetName()+" to "+fn.GetFileString());
> AutoAlloc<BaseDocument> saveDoc;
> BaseObject* clone = (BaseObject* )object->GetClone(COPY_NO_ANIMATION,NULL);
> saveDoc->InsertObject(clone,NULL,NULL);
> saveDoc->SetDocumentName(fn.GetFileString());
> fn.FileSelect(FSTYPE_SCENES, GE_SAVE);
> if(SaveDocument(saveDoc,fn,SAVEFLAG_SHOWERROR, FORMAT_C4DEXPORT)) {
> GePrint("TRUE - SUCCESS");
> }
> else {
> GePrint("FALSE - FAILED");
> }
> </code>
i get the 'save as' dialog, but when i press 'save', it always returns false.. Does anybody know what is wrong with the code ?
thanks,
Daniel