You would have to make a Ruby C call to SketchUp’s Ruby API Model#active_path
method.
Then somehow pass the Ruby array back to the C side. (But the Ruby ↔ C conversion functions also are 2020.2+)
See the PDF book on Extending Ruby in C, last listed book in the downloadable books list.