Any info about DCL_Technology for SU used in RPTOOLS
-
@unknownuser said:
Hi all!
It is very cool , RPTOOLS uses dcl file to show dialog in SketchUp.
Any info about using DCL in SU_Ruby ?Thanks!
DCL - based loosely on a Dialog Control Language first used with AutoCAD 15 or so years ago - makes it easy to create dialog boxes for SketchUp ruby.
The basic interface is through global variables. For example, if you want to make a dialog control which sets a distance to use for something, you use a value box which looks like the X box below:
You use this code in the DCL:
value_box { label = "X;"; global_variable = rrptools_stretch_new_width; format = "D"; command = rb_stretch_selection("X"); }
The value in the box is automatically stored in a global variable named 'rrptools_stretch_new_width', the value box automatically displays the value in the format of the SketchUp model (inches, mm, etc.), and the ruby command 'rb_stretch_selection("X")' is automatically executed whenever the value is changed. (You do not need to execute a ruby command every time a value is changed. You can wait until the user taps OK. But sometimes you want to do something for each change or up and down tick).
The up and down sliders are automatically created for each value box.
The ruby command would look something like this:
def rb_stretch_selection(swhat) if (swhat == "X") rrptools_stretch_new_width = get_global_double("rrptools_stretch_new_width) # do something with rrptools_stretch_new_width end#if end#def
Unfortunately DCL only works with Windows currently. We hope to create a MAC version, but have not started work on it yet. Let us know if you want more information on the RPS DCL Development Kit.
We have used WebDialogs for some of our applications, hoping to port them to the Mac more easily. And WebDialogs might be best for most SketchUp developers. The RPS DCL development Kit includes a C++ DLL which allows you to access the dialogs and global variables from C-code as well. However, the cost may be to high for many projects.
-
Thank you very much for the info, AI!
Is it possible to show me a little demo rb_file about how to use RpTools.dll to load a dcl file?
Pardon me,if you feel my request is unreasonable,for I want to know more about it eagerly.
-
@wikii said:
Thank you very much for the info, AI!
Is it possible to show me a little demo rb_file about how to use RpTools.dll to load a dcl file?
Pardon me,if you feel my request is unreasonable,for I want to know more about it eagerly.
I put some samples on the Render Plus Forum if you want to try some things out:
Advertisement