How can I run my file .cpp c++ file as a cron job when I alter my skp file?

Hello guys,

I have .cpp file to do some conditions on components that will be put on my .skp file.
I need to run it every second or every move for any component or add a new component to my skp file.


On what platform?

What “move”? Is this when using SketchUp? Do you want to compile a CPP file based on user action within SketchUp?

I think if you elaborate more in your scenario and context you’ll find more response to your question.

1 Like

Use observers, not a timer.

Your extension will need to automatically attach observers like this template …

Template moved to …

Then when a component or group instance is moved, the onChangeEntity callback method in the EntitySpy will get called.

Where you see my "# do something ..." comments is where you would call your C side functions using the object converter listed here: SketchUp C API: SketchUpAPI/application/ruby_api.h File Reference.

1 Like

Thank you @tt_su , @DanRathbun

After I wrote code in c++ and tried to do my extension, I transform it to ruby API :sweat_smile: , It’s easier and it has a lot of examples :smile: .

That is what I need to do and I did it, Thanks a lot.

But now I need to use my extension in the web version, I will ask in a new topic (2)

The web version doesn’t have an API at this point.

1 Like

thomthom versus tt_su



:smiley: You need to wear a right hat and your extension will run… :wink:


Solid Inspector² from Thomas has been “natively” implemented to web version.
There are a different hats (thomthom versus tt_su) in his avatar. I wanted to point out that he is now a member of the SU team (wearing other hat), not only an extension developer.


Members who are not very good at English do not understand such jokes. They can easily become confused.

EDIT: @dezmo Thanks for adding the explanation!


Thank you very much @dezmo @DanRathbun @tt_su

1 Like