Using multiple SendModelingCommand()'s?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/03/2009 at 18:52, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   10.5 
Platform:   Windows  ;   
Language(s) :   C.O.F.F.E.E  ;

---------
Hi wise guys,

after searching hours for this problem, I couldn't find any solution. Maybe you can help.
I tried to create a OCube-Object, make it editable and then subdivide it. First two points work fine, but I can't subdivide it with a further SendModelingCommand() in the same routine. The odd thing on this is, that there is no error message, everything seems to work fine.

> \> RockGenPlugin::Execute(doc) \> { \>         var RockObject = AllocObject(Ocube); \>         var RockPhongTag = AllocTag(TPhong); \>         var bc = new(BaseContainer); \> \>         RockObject->SetName("RockGenObject"); \>         doc->InsertObject(RockObject,NULL,NULL); \>         RockObject->InsertTag(RockPhongTag,NULL); \> \>         RockPhongTag#PHONGTAG_PHONG_ANGLELIMIT = TRUE; \>         RockPhongTag#PHONGTAG_PHONG_ANGLE = PI\*80/180; \>         RockPhongTag#PHONGTAG_PHONG_USEEDGES = TRUE; \> \>         SendModelingCommand(MCOMMAND_MAKEEDITABLE, doc, RockObject, bc, MODIFY_ALL);     // works fine. \> \>         bc->SetData(MDATA_SUBDIVIDE_HYPER, TRUE); \>         bc->SetData(MDATA_SUBDIVIDE_ANGLE, PI); \>         bc->SetData(MDATA_SUBDIVIDE_SUB, 1); \> \>         SendModelingCommand(MCOMMAND_SUBDIVIDE, doc, RockObject, bc, MODIFY_ALL);        // doesn't work, but raises no error. \> \>         DrawViews(DA_FORCEFULLREDRAW); \>         var d = new(RockGenDialog); \>         d->Open(-1,-1); \>         return TRUE; \> } \> \>

In another routine (e.g. a dialog::command routine) it works...

And there is another question: Why isn't it possible to run multiple Modeling commands in a queue? Maybe like this:

> \> SendModelingCommand(MCOMMAND_MAKEEDITABLE|MCOMMAND_SUBDIVIDE|MCOMMAND_MELT, doc, op, bc, MODIFY_ALL); \>

Would be a nice feature... 😉

Oh, and please don't bully me for that dirty code, errorcatchers and so on will definitely be added. 😉

greeting, Robert

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 14/03/2009 at 12:22, xxxxxxxx wrote:

never mind, got it... 🙂

I just forgot to assign the object to a new variable like this:

> var dummy = doc->FindObject("RockGenObject");

But is this the optimal way?

regards, Robert

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 14/03/2009 at 15:42, xxxxxxxx wrote:

have you seen this part in the sdk doc

"If a document is provided, an undo is automatically added. If doc is NULL, no undo is added, so one can collect multiple SendModelingCommand() calls "

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 14/03/2009 at 17:46, xxxxxxxx wrote:

Darn, that worked too... Thanks for that... 😉