How to export data from SketchUp not from skp file?

The same way as from a file generally.

However there are a few differences. You you link against "sketchup.lib" for an extension working with a “live” model inside SketchUp.

There are also a small set of functions that are exported only by the SketchUp application.

http://extensions.sketchup.com/developer_center/sketchup_c_api/sketchup/application_8h.html

http://extensions.sketchup.com/developer_center/sketchup_c_api/sketchup/sketchup__info_8h.html

Please read …

See examples …