TRoot.CreateFromClassName

Function CreateFromClassName(ClassName: String): TPyramid
This is the means of adding a new Pyramid that does not belong to any world.

In scripts you must dispose of the object manually (by calling the .Free method). This object does not belong to any world, so there is no parent list to keep track of its lifespan. In OLE Automation, the object will be freed naturally when its reference count reaches zero.

Example: var T: TPyramid; begin if Root.ClassExists('TDoor') then begin T := Root.CreateFromClassName('TDoor'); T.Name := 'Door' + IntToStr(T.ID); end; end; Note: CreateFromClassName is not case-sensitive.