Author Topic: What would it take to convert from object dcl to open dcl?  (Read 48111 times)

Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #45 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)

Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #46 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")

Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #47 on: November 26, 2009, 06:32:37 PM »

(command "redefine" "fillet")

(command "ambrowser" "off")

These return: invalid AutoCAD command: nil

Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #48 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?

Kerry

  • Mesozoic Relic
  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 433
  • class keyThumper<T>
Re: What would it take to convert from object dcl to open dcl?
« Reply #49 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

Quote
Modeless 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'
Quote
One 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.
« Last Edit: November 26, 2009, 08:47:35 PM by Kerry Brown »
Perfection is not optional.
My other home is TheSwamp

Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #50 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!

Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #51 on: November 27, 2009, 05:09:06 AM »
Yep, changed the actual button property to asynchronous and it works!! Thank you!

owenwengerd

  • Administrator
  • Hero Member
  • *****
  • Posts: 3059
    • Outside The Box
Re: What would it take to convert from object dcl to open dcl?
« Reply #52 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.

Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #53 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...


Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #54 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.

owenwengerd

  • Administrator
  • Hero Member
  • *****
  • Posts: 3059
    • Outside The Box
Re: What would it take to convert from object dcl to open dcl?
« Reply #55 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.

Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #56 on: November 28, 2009, 08:18:39 AM »
O.K. will do!