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.
Thanks.
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.
Thanks.
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.
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.
Thank you @tt_su , @DanRathbun
After I wrote code in c++ and tried to do my extension, I transform it to ruby API , It’s easier and it has a lot of examples .
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
The web version doesn’t have an API at this point.
thomthom versus tt_su
You need to wear a right hat and your extension will run…
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!