
//Remo: 24.11.2013
{
	BaseDocument *doc = GetActiveDocument();	if(!doc)  return false;
	BaseObject *obj = doc->GetActiveObject();	
	if(!obj) obj = doc->GetFirstObject();
	if(!obj) return false;

	if(obj->IsInstanceOf(Opolygon)){
		PolygonObject* pob = ToPoly(obj);
		const LONG pcnt = pob->GetPointCount();
		const Vector *padr = pob->GetPointR();

		BaseObject *nop = BaseObject::Alloc(Onull); if(!nop)  return false;
		doc->InsertObject(nop,NULL,NULL);
		nop->SetName("NULL "+pob->GetName());

		for(LONG i=0; i<pcnt; ++i)
		{
			BaseObject *sop = BaseObject::Alloc(Osphere);  if(!sop)  return false;
			sop->InsertUnder(nop);

			sop->SetRelPos(padr[i]);
			sop->SetParameter(DescID(PRIM_SPHERE_RAD),GeData(10.0),DESCFLAGS_SET_0);
			sop->SetParameter(DescID(PRIM_SPHERE_TYPE),GeData(4),DESCFLAGS_SET_0);
			sop->SetName("Sphere_"+LongToString(i));
		}
		EventAdd();
	}
}