OpenDCL Forums

OpenDCL => Deployment => Topic started by: Hypersonic on November 25, 2009, 03:52:56 AM

Title: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 25, 2009, 03:52:56 AM
I have a bunch of programs set up with an older version of object dcl.  I am running mechanical desktop 2004.
I want to upgrade to autocad 2009 or 2010
The old object dcl dialogs will not run in 2009 so I either have to re-write for the newer object dcl or re-write for open-dcl.....

Could someone explain to me the pro's and cons' of each possibility?
How much work would either method be?  I know those are open ended questions.... but any general idea would help!

Thanks!, Bob.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: owenwengerd on November 25, 2009, 06:51:18 AM
Take a look at the migration guide:
http://opendcl.com/wordpress/?page_id=10 (http://opendcl.com/wordpress/?page_id=10)
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 25, 2009, 08:16:56 AM
This migration guide showed only a couple minor changes as being needed?  Or am I not seeing the whole picture?

If thats all that is necessary, I'll start converting today!

So does this mean I can reuse all my old files for the most part?
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: owenwengerd on November 25, 2009, 09:09:35 AM
Yes, unless you're doing something funky, conversion should only take a few minutes.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: BazzaCAD on November 25, 2009, 11:23:44 AM
If you find any issues that aren't in the Migration Guide, please let us know.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 25, 2009, 02:34:25 PM
Awesome!  I am going to start tonight!  will this open DCL also work with mechanical desktop 2004?

Is there an installation guide?

Thank you so much!
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: owenwengerd on November 25, 2009, 02:48:18 PM
Yes, it will work with Mechanical 2004. There is no installation guide; just install the OpenDCL Studio MSI for your language, then follow the steps in the migration guide. Add a (command "_OPENDCL") to your application's main function to ensure the runtime is loaded, then you're good to go.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 25, 2009, 02:53:46 PM
Thanks, I will give it a try.... feels like Christmas and I got a new bike!
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 25, 2009, 06:13:53 PM
Ugh!  I don't know which version it looks like there are dozens of them....

I am running an English version of Mechanical Desktop 2004

I see newer and older files?  Is ENU english?

Thanks, sorry for not knowing!
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Kerry on November 25, 2009, 06:33:37 PM
Quote
I see newer and older files?  Is ENU english?
yes

QuoteUgh!  I don't know which version it looks like there are dozens of them....
Which version of what ??

If you mean of the StudioEditor I'd use the 5.1.2.3 Stable Version
http://sourceforge.net/projects/opendcl/files/Stable/OpenDCL.Studio.ENU.5.1.2.3.msi/download (http://sourceforge.net/projects/opendcl/files/Stable/OpenDCL.Studio.ENU.5.1.2.3.msi/download)


The Development Build 6.0.0.14 is not yet ready for production work.
http://sourceforge.net/projects/opendcl/files/Development/OpenDCL.Studio.ENU.6.0.0.14.msi/download (http://sourceforge.net/projects/opendcl/files/Development/OpenDCL.Studio.ENU.6.0.0.14.msi/download)


The stable Runtime to install on Users Machines is
http://sourceforge.net/projects/opendcl/files/Stable/OpenDCL.Runtime.5.1.2.3.msi/download (http://sourceforge.net/projects/opendcl/files/Stable/OpenDCL.Runtime.5.1.2.3.msi/download)
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 25, 2009, 06:40:33 PM
Thank you!
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Kerry on November 25, 2009, 06:41:12 PM

You're welcome ;)
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 25, 2009, 07:47:24 PM
Inforapid search and replace is a free downloadable tool to do some of the global search and replace things listed in the migration guide.
Maybe this (or something like it) is already listed somewhere, but if not it might save some people a few hours...
Just a thought
Thanks for all your help!
-
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 25, 2009, 08:02:10 PM
ObjectDCL_LoadArx  <== this should be removed?
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: owenwengerd on November 25, 2009, 08:17:39 PM
If that's your function to load the .arx, then yes, it should be replaced with (command "_OPENDCL").
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 25, 2009, 08:56:31 PM
Thank you Owen, I am making some progress, it appears I have to rename the old .odc files to .odcl, so I have done that to one only right now as I am trying to get one to work.

I have the dialog popping up now, but the buttons don't seem to work, I checked the even button and even re-copied the on-clicked command into my lsp routine.   But it acts like I am not clicking on the button at all....

Any thoughts?
Thanks again!
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: BazzaCAD on November 25, 2009, 09:23:36 PM
Your projects probably have the old (VarName) symbols set.
You could try the NewProjectKey argument in:
(dcl_Project_Load ProjectFilePath [as String] {ForceReload [as Boolean]} {NewProjectKey [as String]})

QuoteIf the optional NewProjectKey is specified, it replaces the project key saved in the project data.

Or you could try Tools-->Clear Lisp Symbol Names, but that may require you to change the Event names in your Lsp.

You might want to post an example if those don't work.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Kerry on November 25, 2009, 09:25:40 PM
Quote from: Hypersonic on November 25, 2009, 07:47:24 PM
Inforapid search and replace is a free downloadable tool to do some of the global search and replace things listed in the migration guide.
Maybe this (or something like it) is already listed somewhere, but if not it might save some people a few hours...
Just a thought
Thanks for all your help!
-

Thanks Hypersonic.

I use UltraEdit UEStudio http://www.ultraedit.com/ (http://www.ultraedit.com/)
good tools make a big difference.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 04:47:04 AM
Ugh, not having much luck......
A simplified lisp file for the form is below, i.e. it just has the call to textbutton5 shown (marked reload library on the form)
and the .odcl file is attached.....  I reset the variable names and copied in the new lisp "command" but it just acts dead...
Both the form show, and form close work though....
Any thoughts?  Thank You!

;debugging_tools_DBForm1
;(load (strcat lsp_dir "debug/debugging_tools"))


(defun c:debugging_tools ()
(princ "\n in debugging_tools ")
(setq compname (getenv "COMPUTERNAME"))

(if (not (or (eq compname "BOBLAPTOP") (eq compname "OTHERBOB")))
   (setq temp (getstring "Say please"))
   (setq temp "buba")
)

(if (eq temp "buba")
(progn
  (setq temp nil);so it is not saved...


(command "_OPENDCL") ; ensure the ObjectDCL.arx file is loaded

(setq project (strcat lsp_dir "debug/debugging_tools"))

(if (eq (getenv "COMPUTERNAME") "BOBLAPTOP")
   (dcl_project_load project T)                ;adding the T forces reload, i.e. for while makeing changes.....
   (dcl_project_load project)                  ;it is recommended to remove for distribution copy.....
)   


(dcl_Form_Show debugging_tools_DBForm1)

;(dcl_Form_Close debugging_tools_DBForm1)


(setq tp_list_file (strcat lsp_dir "debug/test_point_list.txt"))
(setq show_tp_list (get_info tp_list_file "show_tp_list"))

);end progn
);end if

(princ "\n leaving debugging_tools ")
(princ)
);end defun


(defun c:debugging_tools_DBForm1_TextButton5_OnClicked (/)
  (dcl_MessageBox "To Do: code must be added to event handler\r\nc:debugging_tools_DBForm1_TextButton5_OnClicked" "To do")
)
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Kerry on November 26, 2009, 05:17:23 AM

I made some changes ... just to get the form to show and Button5 to work.

I also changed ALL the test Sizes to be in pixels, NOT Scaled to Monitor ' cause the text was too big on my Monitor

Code (autolisp) Select

                                                            ;debugging_tools_DBForm1
                                                            ;(load (strcat lsp_dir "debug/debugging_tools"))

(defun c:doit () (c:debugging_tools))
(defun c:debugging_tools ()
;;;  (princ "\n in debugging_tools ")
;;;  (setq compname (getenv "COMPUTERNAME"))
;;;  (if (not (or (eq compname "BOBLAPTOP") (eq compname "OTHERBOB")))
;;;    (setq temp (getstring "Say please"))
;;;    (setq temp "buba")
;;;  )
;;;  (if (eq temp "buba")
;;;  (if T
;;;    (progn (setq temp nil)                                  ;so it is not saved...
 
  (command "_OPENDCL")                                      ; ensure the ObjectDCL.arx file is loaded
  ;;(setq project (strcat lsp_dir "debug/debugging_tools"))
 
  (setq project (findfile "debugging_tools.odcl"))
;;;           (if (eq (getenv "COMPUTERNAME") "BOBLAPTOP")
 
  (dcl_project_load project t)                              ;adding the T forces reload, i.e. for while makeing changes.....
;;;             (dcl_project_load project )                     ;it is recommended to remove for distribution copy.....
;;;           )
 
  (dcl_form_show debugging_tools_dbform1)                   ;(dcl_Form_Close debugging_tools_DBForm1)
;;;           (setq tp_list_file (strcat lsp_dir "debug/test_point_list.txt"))
;;;           (setq show_tp_list (get_info tp_list_file "show_tp_list"))
;;;    )                                                       ;end progn
;;;  )                                                         ;end if
  (princ "\n leaving debugging_tools ")
  (princ)
)                                                           ;end defun


(defun c:debugging_tools_dbform1_textbutton5_onclicked (/)
  (dcl_messagebox
    "To Do: code must be added to event handler\r\nc:debugging_tools_DBForm1_TextButton5_OnClicked"
    "To do"
  )
)
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 05:22:48 AM
Kerry you are awesome!  that is incredible, now I just have to figure out what you did! :)
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 05:38:48 AM
Oh bugger...... still stuck, I copy your exact code into my routine, and it still does not run.... dialog comes up, button is dead.......

How did you tweak the text size? I am having the same problem on my end.  Thank you!
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Kerry on November 26, 2009, 05:43:09 AM
As you have a few to revise .. try this

It will Change the font to "MS Shell Dlg"
and the Size to be in Pixels rather than By Monitor Size

Note that I've changed the original ODCL file Name before running the Lisp.

Code (autolisp) Select

;; CodeHimBelongs kdub
;;
(defun setOdclFont-msShellDlg (odclfile    password
                              newodclpath /
                              project     props
                              fontsize
                             )
 (setq project (dcl_project_load odclfile))
 (if (not project)
   (exit)
 )
 (foreach form (dcl_project_getforms project)
   (foreach control (dcl_form_getcontrols form)
     (progn
       (setq props (dcl_control_getproperties control))
       (if (member "FontSize" props)
         (progn (setq
                  fontsize (dcl_control_getproperty control
                                                    "FontSize"
                           )
                )
                (if (> fontsize 0)
                  (dcl_control_setproperty control
                                           "FontSize"
                                           (- 0 fontsize)
                  )
                )
         )
       )
       (if (member "Font" props)
         (dcl_control_setproperty control
                                  "Font"
                                  "MS Shell Dlg"
         )
       )
;;;        (if (member "FontSize" props)
;;;          (dcl_control_setproperty control "FontSize" -10)
;;;        )
     )
   )
 )
 (dcl_project_saveas project newodclpath password)
)



Code (autolisp) Select

(setq odclfile    (findfile "debugging_tools_original.odcl")
     password    nil
     newodclpath "K:\\kdubpro\\debugging_tools.odcl"
)

(setOdclFont-msShellDlg  odclfile nil newodclpath)
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Kerry on November 26, 2009, 05:48:44 AM
Quote from: Hypersonic on November 26, 2009, 05:38:48 AM
Oh bugger...... still stuck, I copy your exact code into my routine, and it still does not run.... dialog comes up, button is dead.......

How did you tweak the text size? I am having the same problem on my end.  Thank you!

Open the ODCL in the editor
Select TextButton5
Select the Event Tab

Unselect, then Re-select the Clicked option.

Make sure theEvent function name in your code is the same as you Event function name in the Event pane

If you change them ; Unselect, then Re-select the Clicked option.

SAVE the ODCL.


For instance
TextButton7 Click event is currently
c:DBForm1_TextButton7_OnClicked
when you unselect and re-select the option the Function name becomes
c:debugging_tools_DBForm1_TextButton7_OnClicked
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 05:56:15 AM
Yes I have tried that a bunch of times.... no luck. ugh.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Kerry on November 26, 2009, 05:59:43 AM

Warning : this is edited with 6.0.0.14 , so be sure to backup your current file.

Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 06:13:08 AM
I downloaded that, and I know its your file, because the text is fixed...... checked the call to the button, pasted the call into my routine.
It did match the old call, but still same exact thing..... button is dead.......
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 06:19:35 AM
screen shot attached......showing clicked button settings....
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 06:25:56 AM
Perhaps an issue with useing 5.1.2.3  ??  I tried adding a button and it showed up on the editor etc. but then it sort of wouldn't select etc.... Maybe I need the version you are using?  I am not sure that makes sense being as I am upgrading from objectDCL 3.x ??

Thanks, B.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Kerry on November 26, 2009, 06:27:48 AM
Can you re-post the ODCL and LSP for Owen please.

He may be able to "Spy" it.

Please Confirm which Version you are using.


Just an aside : off topic.
If you drag the Control Tab/Z-Order Pane from under the Properties Pane to under the Project Pabe on the Left
... you'll have more room for the Properties
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Kerry on November 26, 2009, 06:31:33 AM
Quote from: Hypersonic on November 26, 2009, 06:25:56 AM
Perhaps an issue with useing 5.1.2.3  ??  I tried adding a button and it showed up on the editor etc. but then it sort of wouldn't select etc.... Maybe I need the version you are using?  I am not sure that makes sense being as I am upgrading from objectDCL 3.x ??

Thanks, B.

You could try 6.0.0.14 to see ... but as I mentioned there are a few issues for some of us with some of the controls ... mainly Tab control.

You may be better guided by Owen.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 06:34:09 AM
I will try that.....thanks!
Title: Re: What would it take to convert from object dcl to open dc
Post by: BazzaCAD on November 26, 2009, 07:01:05 AM
do you have .odcl's in more then 1 support path? maybe it's loading an older version.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 07:16:46 AM
I will check, although I am explicitely telling it where to look.  I just tried 6.0.0.14 created an entirely new dialog etc. and have the same problem - dead button.  I must be doing something wrong.  Do I need to download the run-time thing?  I thought I read it was inside the editor....?
Maybe I just have not installed everything I need to?
Thanks again!
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: owenwengerd on November 26, 2009, 07:34:37 AM
I wonder if you're unintentionally loading the wrong lisp file. Like Kerry said, if you can attach the .odcl and .lsp along with instructions to reproduce the problem, I can check it here to see what's going on.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 07:43:16 AM


Note: lisp file is called debugging_tools, odcl file is debugging_test.odcl  - didn't want to overwrite the "non working" original...
Thank you for your help.... the dialog appears frozen on the screen when it pops up too.... maybe something to do with my "old" mechanical desktop??

Thanks, bob.
simple odcl file attached.


(defun c:testit () (c:debugging_tools)) 



(defun c:debugging_tools () 


(notify "in updated debugging_tools going to open debugging_test form.....")


(command "_OPENDCL")                                      ; ensure the ObjectDCL.arx file is loaded 


(setq project (strcat lsp_dir "debug/debugging_test.odcl"))

  (dcl_project_load project T)                              ;adding the T forces reload, i.e. for while makeing changes..... 

(dcl_Form_Show debugging_test_Form1)



  (princ "\n leaving debugging_tools ") 
  (princ) 
)                                                           ;end defun 

 

(defun c:debugging_test_Form1_TextButton1_OnClicked (/)
  (dcl_MessageBox "To Do: code must be added to event handler\r\nc:debugging_test_Form1_TextButton1_OnClicked" "To do")
)
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: owenwengerd on November 26, 2009, 08:01:32 AM
Your code works fine for me in AutoCAD 2004, so the problem is likely in the process somewhere. Have you tried loading the _masterdemo sample to see if it works as expected?
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 08:27:27 AM
No, I have not tried the master demo, where could I find that?

Thanks, this is a real stumper!
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: owenwengerd on November 26, 2009, 08:46:39 AM
Look in <Program Files>\OpenDCL Studio\Samples. Just drag and drop _Masterdemo.lsp into your AutoCAD document window.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 09:34:56 AM
uninstalled everything, reinstalled. Master demo works greate, buttons function just fine.....

Mine= still no good....
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 09:52:18 AM
Created a new dialog, trying to start with the basics,
made a routine to load the project and show a form.... that worked, and the form can be draged around the screen and the x in the upper right corner closes it..... as soon as I add a button to it, the form will open, but then it is locked up, won't move around and won't close with the x button..... but if will close with a form close button.

Any thoughts....
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: owenwengerd on November 26, 2009, 10:33:27 AM
Are you loading any other this party applications? Are you possibly loading an older version of ObjectDCL that is interfering?
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 11:24:32 AM
I renamed the directory of the old objectdcl_arx, and checked the appload to make sure it was not loaded......
I am not sure how else to check....

Here is what I have loaded.....

Loaded Runtime Extension Programs:

    acadm.arx  - MDI Aware.
    acadmmx.arx  - MDI Aware.
    acapp.arx  - MDI Aware.
    acbr16.dbx  - MDI Aware.
    acdblclkedit.arx  - MDI Aware.
    acdblclkeditpe.arx  - MDI Aware.
    acdim.arx  - MDI Aware.
    aceplotx.arx  - MDI Aware.
    acetlodr.arx  - MDI Aware.
    achapi16.dbx  - MDI Aware.
    achlnkui.arx  - MDI Aware.
    acidropmgr.arx  - MDI Aware.
    aclayerp.arx  - MDI Aware.
    acme.arx  - MDI Aware.
    acmsymbb.arx  - MDI Aware.
    acsign.arx  - MDI Aware.
    acspacetrans.arx  - MDI Aware.
    acstd.arx  - MDI Aware.
    actp.arx  - MDI Aware.
    ad.arx  - MDI Aware.
    am_asmui.arx  - MDI Aware.
Press ENTER to continue:
    amdt_attributes.arx  - MDI Aware.
    amdt_browser.arx  - MDI Aware.
    amdt_designer.arx  - MDI Aware.
    amdt_stdimp.arx  - MDI Aware.
    amdt_transmittal.arx  - MDI Aware.
    amg3.arx  - MDI Aware.
    amg3d2d.arx  - MDI Aware.
    amgdim.arx  - MDI Aware.
    amglay.arx  - MDI Aware.
    amgtitle.arx  - MDI Aware.
    amgutil.arx  - MDI Aware.
    appload.arx  - MDI Aware.
    asrf.arx  - MDI Aware.
    assembly.arx  - MDI Aware.
    cit.arx  - MDI Aware.
    desktop.arx  - MDI Aware.
    dm.arx  - MDI Aware.
    doslib16.arx  - MDI Aware.
    dxgui.arx  - MDI Aware.
    g3vace.arx  - MDI Aware.
    g3vamcmd.arx  - MDI Aware.
    ge_acad.arx  - MDI Aware.
    ge_load.arx  - MDI Aware.
Press ENTER to continue:
    genbh15.arx  - MDI Aware.
    grefacad.arx  - MDI Aware.
    grefad.arx  - MDI Aware.
    grefsurf.arx  - MDI Aware.
    ivcomp.arx  - MDI Aware.
    mapiad.arx  - MDI Aware.
    mapiam.arx  - MDI Aware.
    mapidm.arx  - MDI Aware.
    mapisurf.arx  - MDI Aware.
    mapisys.arx  - MDI Aware.
    mcadapi.arx  - MDI Aware.
    mcadcom.arx  - MDI Aware.
    oleaprot.arx  - MDI Aware.
    opendcl.16.arx  - MDI Aware.
    quikpik.16.arx  - MDI Aware.
    vl.arx  - MDI Aware.
    whohas.arx  - MDI Aware.
    wscommcntraccon.arx  - MDI Aware.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 12:12:29 PM
I think I got it! Quikpik has some "lock floating windows" functions. I turned off and the buttons began working... yooo hooo!

Thank you for all your help..... I will start more thorought testing later.

I really appreciate all you folks giving me a hand!

Best regards, Bob.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: owenwengerd on November 26, 2009, 12:41:31 PM
Interesting, I'll have to investigate that.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 03:18:11 PM
"lock floating windows" - on attached screen shot, apparently was the culprit! 
I never would have seen that coming..... Thanks for pointing me in the right direction  8)
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 06:30:00 PM

Would any of the new open dcl stuff prevent the following from working?  I have a bunch of these types of statements in a lisp routine
to set start up varialbes etc. and all of a sudden they are all failing.... ?

(command "redefine" "fillet")

(command "ambrowser" "off")
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 06:32:37 PM

(command "redefine" "fillet")

(command "ambrowser" "off")

These return: invalid AutoCAD command: nil
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 26, 2009, 06:40:07 PM
O.k. ugh , I have a lisp routine like this:

(defun c:load_library ()
(setq from_load_library T)
  (LOAD "C:/BOB/LSP/LIBRARY")
)

I can type in load_library at the command prompt and all the (command XXXX) commands in the library file work fine....

But if I have a dialog box open (i.e. the newly converted one) and call the (c:load_library) from the button then the above described (command XXXXX  commands no longer work...

So it has something to do with Open dcl, perhaps there is a some setting that is being affected?
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Kerry on November 26, 2009, 08:42:15 PM
Firstly,
When asking, provide as much info as possible.

The form is modeless, yes ?

What is the Event Invoke property set to ?  
Should (preferably)  be 1 - Asynchronous

QuoteModeless dialog event handlers are normally invoked in the AutoCAD application context instead of the document context. AutoLISP code running in the application context cannot call document-dependent functions like the (command) function. To deal with this problem, the control's 'Event Invoke' property may be used to trigger the event handler asynchronously in the document context, thus allowing calls to (command) to succeed. Alternatively, the event handler may be executed synchronously, but instead of calling document-dependent functions within the handler function, it can simply trigger a new command to execute in the document context via the (dcl_SendString) function.

It's always a good idea to post code and ODCL.
Sometimes when attempting to build a sample to show the problem the solution will become evident because you have to re-think your code setout.

Have you 'talked to a Teddy Bear'
QuoteOne of the first things I learned as a new programmer was the technique known as "teddy bear programming". A story goes something like this: a university help desk center kept a teddy bear, and before students were allowed to bring their problem to a human, they had to first explain it out loud to a teddy bear. The idea is that by the time they finished telling the bear, over half of them had solved their own problem.
Explaining your problem out loud is often enough to shake things loose in your brain, expose bad assumptions, and cause you to see things in a new way.

... but a rubber duck works well too :)

.. enough levity :
I dont have acadm 2004 to test, but I have ACADM 2007 and 2010 here, so I'll at least be able to say "works for me" or "yes, there's a problem".


PS: I know you've posted parts of the project previously, but I know from my own playing around that sometimes I change a setting or do something that has unexpected ramifications ... having  a current source copy gives anyone reviewing the code a better chance of seeing the problem/solution.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 27, 2009, 05:01:37 AM
Thanks Kerry, I checked and it was set to synchronous.... I think this is a new property relative to my old objectDCL code.....
Thank you for the input.... I am also tracking my changes as I saw something about "let me know if there are other required changes " to incorporate in a migration tool..... The migration tool is what finally convinced me to make the swithch... as it looked fairly straightforward.  So maybe it will help others too.

I really appreciate all your help!
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 27, 2009, 05:09:06 AM
Yep, changed the actual button property to asynchronous and it works!! Thank you!
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: owenwengerd on November 27, 2009, 08:15:24 AM
The Event Invoke property is not new, but the original ObjectDCL code often ignored it. That may be the case here.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 28, 2009, 07:10:31 AM
To the best of my knowledge, I have completed a full conversion of 28 separate applications from ObjectDCL to OpenDCL grand total time invested: about 10-20 hours tops.....

here are some other issues I ran into that others might encounter.... Some are probably already listed in the migration guide, some are due to poor programing on my part.  Just thought I would share.

Overall, it was an easy upgrade!



replace (ObjectDCL_LoadArx)
with (command "_OPENDCL")


;some cases occuring like this.... I think primarily because I was messing with the variable names in old objectDcl

old: (defun c:DBForm1_TextButton1_OnClicked
new: (defun c:debugging_tools_DBForm1_TextButton5_OnClicked (/)

change all files from .odc to .odcl




(dcl_Control_SetRowHeader Untitled_Form1_Grid1 NewValue [as Boolean]) ; old style used 0 or 1 now use nil or T

::::::::::::::::::::::::::::::


(dcl_Grid_AddColumns Layer_Control_LC_Main_Grid1 NewColumns [as List of Lists as ((Caption [as String] {Justification [as Integer]} {ColumnWidth [as Long]} {ColumnImageIndex [as Integer]}) ...)])

Old                              New
(list 1 "Description" 1 200) ==> (list "Description" 1 200)





dcl_control_setenabled functionality has changed.... again boolean instead of 0 or 1



   (dcl_Control_SetValue Shoulder_Punch_Sp_DclForm1_CheckBox1 nil); value needs to be 0 or 1 instead of nil or T


used to be able to use a: dcl_control_setcaption and if the form was not active, it would not error out, now
you need to check to see if the form is active,otherwise it will return an error...

Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 28, 2009, 07:23:22 AM


I just want to thank Owen, Kerry, and Barry for all your incredible help!  You really made the transition easy and fast.
I have been wanting to do it for a couple years now, and now I am up and running.

Also, I would like to make a donation if you could tell me the where and how of it.

Thanks, Bob.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: owenwengerd on November 28, 2009, 08:15:55 AM
I've been slowly working on creating a legal entity that can accept donations and manage project development, unfortunately other things keep taking priority. Until I get my act together, just donate your feedback and help make the product better.
Title: Re: What would it take to convert from object dcl to open dcl?
Post by: Hypersonic on November 28, 2009, 08:18:39 AM
O.K. will do!