Object property not changing

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

On 04/01/2008 at 16:53, xxxxxxxx wrote:

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

---------
I am trying to write my first script to create tubes and the tube properties don't seem to be changing.

What am I missing?

> _
> StatusSetText("AllocObject");
> var tube,tc;
> var document;
> var rad, rad2;
>
> tube = AllocObject(Otube);
> tube->SetPosition(vector(2.0, 4.0, 56.0));
>
> StatusSetText("Changing Tube Sets");
>
> tc = tube->GetContainer();
> rad = tc->GetData(PRIM_TUBE_ORAD);
> StatusSetText(" ORAD = " + tostring(rad) + ".");
> tc->SetData(PRIM_TUBE_ORAD, 190);
>
> rad2 = tc->GetData(PRIM_TUBE_ORAD);
> StatusSetText(" ORAD = " + tostring(rad) + " to " + tostring(rad2) + ".");
>
> document = GetActiveDocument();
> if (!document->InsertObject(tube, NULL, NULL)) return FALSE;
> EventAdd();
> return TRUE;
> _

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

On 07/01/2008 at 23:58, xxxxxxxx wrote:

You have to use tube- >SetContainer(tc) to change the tube's properties.

cheers,
Matthias