I need select all blocks in layout.
Please be more specific about what you want to accomplish. Somehow I get the impression that merely "selecting" the BlockReferences, that is, creating a selection set for further user interaction, is not what you're really after.
If you want to iterate through the objects contained in the Layout and do specific things depending on object type or whatever, see the
Layout.BlockTableRecordId property. You can open that BlockTableRecord like any other BTR and loop through its contents.