Small Fish Posted November 30, 2009 Posted November 30, 2009 Hi does anyone have any simple examples of objectdcl in action? I tried the link below supplied on the objectdcl web site but I get the old '404 Not found' message. http://www.objectdcl.com/knowledgebase/knowledgebase.html thanks Quote
JohnM Posted November 30, 2009 Posted November 30, 2009 What exactly are you looking for? If you downloaded the opendcl studio there are examples included. I have been using openDCL from the beginning and love it. I would be glad to help out Quote
Small Fish Posted November 30, 2009 Author Posted November 30, 2009 I am not sure what the difference between objectdcl and opendcl? I looked at the opendcl site but I still can not find any simple examples. Can you show me a simple example? Quote
JohnM Posted November 30, 2009 Posted November 30, 2009 Here is a littler background on both programs. ObjectDCL started out with this one guy in Canada several years back and it cost about $300.00 +/- (I bought it but forgot exactly how much it cost). A couple of years ago he had become ill and was not able to continue developing the program. He posted the program as an open source project so that other programmers could further develop the program. An open source program is free to the public to do with what they want. One company named DuctiSoft took the code and developed it and now sells it for a price and they also secured the original name of the software. Another group of developers took the code and continued developing it and named it OpenDCL and distributes the code or the packaged program to the public for FREE. I prefer the free one but there are a few issues with it that I can go into detail later on if necessary. I would suggest downloading the current stable version of OpenDCL. Here is a link to the download http://sourceforge.net/projects/opendcl/files/Development/OpenDCL.Studio.ENU.6.0.0.15.msi/download You might have to click the direct link or mirror link if the download does not happen. Save the download to a folder then run it to install OpenDCL studio. This will install the main environment and the runtime files on your computer. After installation navigate to C:\Program Files\OpenDCL Studio\ENU\Samples There you will find a ReadMe txt file (read it) and a lot of examples. OpenDCL (and objectDCL) requires that the computer running any programs that you create have the runtime ARX file installed. So if you create a program that you want to distribute you have to make sure to package the runtime files and language folder with it. When you install the opendcl studio the runtime file are installed on you computer located at c:\program files\common files\opendcl . Also the different language files are installed. The examples included are just as good as anything I could show you. Give it a shot and if you want to proceed I will be happy to assist you in getting organized and set you on the right path. It all looks scary at first but after you get familiar with the procedure you will like it. Here is a quick rundown on how it basically works. In the studio make a form then place 2 buttons on it. All objects forms and buttons or other tools have properties and events A Properties example would be like the text displayed on the button and the event example would be the ON_Click for the button. If the user clicks the button what code do you want to perform So in your lisp code you would first make sure the runtime.ARX file is loaded then make sure the project is loaded then call the event to show the form with 2 buttons. Lets say one button would execute this lisp command (alert “Hello World”) so when the user clicks the button the AutoCAD message box appears. The other button would be assigned to Close the form so the user could exit the program. Quote
Small Fish Posted December 1, 2009 Author Posted December 1, 2009 Thanks John for the detailed explanation, and the basics on how to use it. I played with it about 5-6 years ago(when Chad was in charge) but I gave up because of the lack of documentation or examples. Meanwhile plain old dcl has done more or less what I want. So now I thought I might re visit this software. Unfortunately at the moment I can not run it because of admin rights. I will get IT dept to make it work. Quote
Small Fish Posted December 1, 2009 Author Posted December 1, 2009 Downloaded opendcl and had a go at the tutorials. I'll admit it looks a bit difficult to understand. Making up a dialog box looks not too hard, but I don't understand how to link the dialog box to the code? I wonder if you or someone else could convert the simple below code, so it runs with opendcl please? I reckon if someone could just get me started I could hopefully work the rest out. (defun C:AreaSq (/ areaunits ss n attlst lstpnt inspnt areametres areametresmm oldcmd olddzi oldlay oldosm outent rtosnum) (AreaSqdcl) (setq OldDzi (getvar "DIMZIN");save all used sysvars OldCmd (getvar "CMDDIA") );setq (setvar "CMDECHO" 0);supress command prompts (if (= (logand (getvar "UNDOCTL") 4) 4);if UNDO-mode 'Auto', then (command "_.UNDO" "_GROUP");start UNDO-group );if (setvar "DIMZIN" (boole 4 8 OldDzi));set zero-supression (setvar "TOOLTIPS" 1) (setq DwgUnits (getvar "INSUNITS" ) AreaUnits 0 ss (ssget '((0 . "HATCH,CIRCLE,ELLIPSE,SPLINE,POLYLINE,LWPOLYLINE")))) (if ss (progn (setq n (1- (sslength ss))) (while (>= n 0) (command "_.AREA" "_OBJECT" (ssname ss n)) (setq AreaUnits (+ AreaUnits (getvar "AREA")) n (1- n)) );while (if (= SquareUnit "squaremetres" ) (progn (setq rtosNum (atoi DeciPlaces ) AreaMetres (rtos AreaUnits 2 RtosNum) );setq (alert(strcat"\n" "Area = " AreaMetres "m²")) );progn );if (if (= SquareUnit "squaremillimetres" ) (progn (setq rtosNum (atoi DeciPlaces ) AreaMetresmm (rtos (* AreaUnits 1000) 2 RtosNum) );setq (alert(strcat"\n" "Area = " AreaMetresmm "mm²")) );progn );if );progn (alert "\nNo Polylines selected!") );if (setvar "DIMZIN" OldDzi) (if (= (logand (getvar "UNDOCTL") 4) 4) (command "_.UNDO" "_END" "_.UNDO" "_MARK" );command );if (setvar "CMDECHO" OldCmd) (princ) );defun ;------------- ; DCL Function ;------------- (defun AreaSqdcl (/ ReturnValue SquareUnitTile) (defun CheckOnClose (/ ) (cond ((not (setq SquareUnitTile (get_tile "SquareUnit")));if no buttons filled (mode_tile "SquareUnit" 2) ) (T (setq SquareUnit (substr SquareUnitTile 1) DeciPlaces (nth (read (get_tile "DeciPlaces"))DeciPlacesList) );setq (done_dialog 1) );T );cond );defun CheckOnClose (if (> (setq DLGID (load_dialog "AreaSq.dcl")) 0) (progn (new_dialog "AreaSq" DLGID) (setq DeciPlacesList '("None" "1" "2" "3" )) (start_list "DeciPlaces") (mapcar 'add_list DeciPlacesList) (end_list) (if (member DeciPlaces DeciPlacesList);see if the global variable is an available option in the list (set_tile "DeciPlaces" (rtos (vl-position DeciPlaces DeciPlacesList) 2 0));if it is, set it as default (set_tile "DeciPlaces" "1");if not, set the default to item 2 in list) );if (action_tile "DeciPlaces" "(ErrorDLG 0)") (action_tile "accept" "(CheckOnClose)") (action_tile "cancel" "(exit)") (setq ReturnValue(start_dialog)) (unload_dialog DLGID) );progn (not (princ "\nNo DCL")) );if ReturnValue );defun AreaSqdcl (defun ErrorDLG (pErr) (cond ((= pErr 0) (set_tile "error" "")) );cond );defun dcl_settings : default_dcl_settings { audit_level = 3 ; } AreaSq : dialog { key = "Display" ; label = "Area of an entity" ; :boxed_radio_row { fixed_width = true ; key = "SquareUnit"; :radio_button { label = "Square metres " ; key = "squaremetres" ; value = "1"; } :radio_button { label = "Square millimetres " ; key = "squaremillimetres" ; } }//End radio row :boxed_column { width = 1 ; :popup_list { label = "Number of Decimal Places "; key = "DeciPlaces" ; }//popup list }//boxed column errtile ; ok_cancel ; }//dialog Quote
anduc Posted December 4, 2009 Posted December 4, 2009 Hi Small Fish, You can take a look on the "OnLine HELP" under the "support" section of ObjectDCL website. There is all documentation you need. Don't be shy to contact DuctiSoft directly by e-mail. Quote
BazzaCAD Posted December 7, 2009 Posted December 7, 2009 Downloaded opendcl and had a go at the tutorials. I'll admit it looks a bit difficult to understand. Making up a dialog box looks not too hard, but I don't understand how to link the dialog box to the code?I wonder if you or someone else could convert the simple below code, so it runs with opendcl please? I reckon if someone could just get me started I could hopefully work the rest out. Hi Small Fish, Just check out the OpenDCL beginners tutorial & you'll learn how to create the dialog boxes & link them to your code very quickly. Go to OpenDCL & click the "Tutorials" tab on top. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.