Return SU_ERROR_NO_DATA when call SUApplicationGetActiveModel in Sketchup 2022

Sketchup Version : 22.0.354
Windows Version : win10
SDK Version : 2022.0.354

C/C++ code


#include <ruby.h>
#include <SketchUpAPI/sketchup.h>
#include <SketchUpAPI/application/ruby_api.h>

VALUE async_edge_data(int argc, VALUE* argv, VALUE self) {
	SUModelRef model = SU_INVALID;
	SUResult res = SUApplicationGetActiveModel(&model);
	return rb_int2inum(res);
}
VALUE example= rb_define_module("Example");
rb_define_module_function(example, "async_edge_data", VALUEFUNC(async_edge_data), -1);

Ruby code

Example.async_edge_data
=>9