THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/04/2008 at 07:52, xxxxxxxx wrote:
User Information:
Cinema 4D Version:
Platform:
Language(s) :
---------
Hi. I'm a complete newbie at coffee, and so I got a lot of questions, but here is my concrete problem:
I'm trying to write a script in coffee, which creates a cube and then extrudes one polygon. After a few hours of reading and testing I managed to write the following code:
var doc = GetActiveDocument();
if (!doc) return;
var wuerfel = new(PolygonObject);
wuerfel = AllocObject(Ocube);
doc->InsertObject(wuerfel,NULL,NULL);
var datac = new(BaseContainer);
doc->SetActiveObject(wuerfel);
CallCommand(12187); //Polygon-Modus
wuerfel = SendModelingCommand(MCOMMAND_MAKEEDITABLE, doc, wuerfel, datac, MODIFY_ALL);
println(typeof(wuerfel));
CallCommand(13323);
var bc=new(BaseContainer);
bc->SetData(MDATA_EXTRUDE_OFFSET, 5);
SendModelingCommand(ID_MODELING_EXTRUDE_TOOL, doc, wuerfel, bc, MODIFY_POLYGONSELECTION);
GeEventAdd(REDRAW_ALL);
My questions are:
1. I think I made some things to complicated, or just not the best way. I would be pleased if you tell me, which things, as I'm a real newbie and thankful for every advise on that.
2. Creating the cube works fine, making it editable also, but nothing is extrude. What's wrong here?
3. How can I select a single polygon of the cube? I tried SetPolygonSelection on the cube, but either I did something wrong or you have to go another way with a cube.
Thanks so far
Basti