This must be simple (right?), but I can’t seem to find how to print a debug string using the C++ SDK.
RhinoApp().Print() should do it
What I mean is that in RhinoCommon there is a property HostUtils.SendDebugToCommandLine
that controls if messages sent with HostUtils.DebugString
are visible or not.
When I use RhinoApp().Print(...)
they are always visible. Or am I missing something?
There is no equivalent to that in the C++ SDK; the logic for this is completely written in RhinoCommon. You would have to make up your own function with a toggle to allow messages to pass through to the command line or not.
Ok, thanks for your quick answer.
For future reference, put this in stdafx.h and use DebugPrint
to print stuff in Debug mode only.
#ifdef _DEBUG
#define DebugPrint RhinoApp().Print
#else
#define DebugPrint
#endif
When a trackbar is moved I’m trying to replace a Surface with another one created by code with a net of curves but the slide loses the focus and it goes to the command line. I tried to use the SendDebugToCommandLine but it didn´t work. Do you know any way of maintain the focus at the slide? When the object affected is a curve then all works fine.
I have no idea, sorry
I have no idea what this means. We will need a lot more information on what you are doing (or trying to do) before we can be very helpful.
Thanks,
– Dale
Hi again,
Sorry I will try to explain it better.
When the slide is moved a curve is recalculated and because of that a surface is re-constructed. I replace the surface and when I put the redraw( ) then the “commad line” puts the message: Creating meshes…
At this point the focus is not on the trakbar, so I can not slide the trackbar.
I attach an image to show this example.
Thanks
When you are moving the slider, you should by dynamically drawing the curve and resulting surface in a conduit. Only when you user lets up on the slider should you be committing the changes to the document.
Does this help?
Yes, this helps me.
Thank you very much.