I will assume that your tablet is capitalizing all lines.
Variables should not be constants. (In Ruby constants begin with a capital letter.)
(1) So, you cannot call
Enumerable#grep() upon nothing. It must be called upon a collection object whose class has mixed in the
Enumerable library module.
(2) There is no master collection of just
Sketchup::SectionPlane instance objects. They are a
Sketchup::Drawingelement subclass, and as this they can be a member of any
Entities collection. This means either the model’s top level collection of entities, or of the entities collection of definitions (as images, groups and component instances do not themselves “own” entities.)
So, a., either iterate the DefinitionsList collecting the section planes,…
cutplanes = model.entities.grep(Sketchup::SectionPlane)
cutplanes.concat( cdef.entities.grep(Sketchup::SectionPlane) )
or b., collect all section planes in the ObjectSpace, and filter out those that do not belong to the active model:
cutplanes = 
cutplanes << obj if obj.model == Sketchup::active_model