Author Topic: Back to DCL - Oh the Irony  (Read 3638 times)

0 Members and 1 Guest are viewing this topic.

jbuzbee

  • Swamp Rat
  • Posts: 851
Back to DCL - Oh the Irony
« on: April 13, 2012, 10:53:27 AM »
So I've officially been out of the game for a few years and a good friend of mine is upgrading to 2013.  I know I could direct him to OpenDCL and download blah blah - but he won't do it.  He likes turn key.  So there's one of my tools that I need to convert the GUI back to plain ole DCL (luckily, it's a simple modal dialog with a list box and a couple of buttons).

If I remember correctly there was a file, Base.dcl, that had some good examples I can pull from.  If anyone here has anything they would care to offer I would deeply appreciate it.

Stay tuned - I'll post questions in the thread.

Thanks - oh and let the heckling begin :-D
James Buzbee
Windows 8

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: Back to DCL - Oh the Irony
« Reply #1 on: April 13, 2012, 11:00:50 AM »
Oh the irony......

Well James, it's like riding a bicycle with no seat, it will come back to you but it will be a bit painful.  :laugh:

Seriously, what does the OpenDCL dialog look like?  Maybe we can throw it together for you rather quickly.
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

Lee Mac

  • Seagull
  • Posts: 12928
  • London, England

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

BlackBox

  • King Gator
  • Posts: 3770
"How we think determines what we do, and what we do determines what we get."

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Back to DCL - Oh the Irony
« Reply #5 on: April 14, 2012, 06:07:41 AM »
That's just awesome  :lmao: ... now that's what one calls IRONY! Wish I saw this yesterday, would have made an extremely strenuous day bearable!

Edit: BTW, does your friend not want OpenDCL due to having to install the runtime? Would he be willing to accept ARXs in your addon? It is possible to package OpenDCL together with your own code - you need not "install" it per se. There are some samples of loading the correct ARX for the acad version through lisp - just need to make sure you include the licensing stuff. I know the old CDGPurge used to do it this way - you didn't need to install OpenDCL/ObjectDCL seperately - it was included in the CDG package.

The reason I'm adding this, is there's quite a change in the actions between Open/ObjectDCL and DCL. The previous 2 uses a defun declared as a command/arx-callable-defun for each action (or rather event), while DCL adds actions as strings to be read & evaluated as lisp statements. It might mean much more than a conversion, possibly a total re-write.
« Last Edit: April 14, 2012, 06:16:18 AM by irneb »
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Back to DCL - Oh the Irony
« Reply #7 on: April 16, 2012, 01:08:37 PM »
Thanks for all the ribbing: makes this place still feel like home!!

The main reason for the initial post is I'm not doing this anymore so I needed a way my freind could carry on using a few of my tools without haveing to upgrade OPenDCL.  However I've discovered a few more serious problems so he might be out of luck.

Thanks again guys!
James Buzbee
Windows 8

d2010

  • Bull Frog
  • Posts: 326
Re: Back to DCL - Oh the Irony
« Reply #8 on: April 18, 2012, 02:51:51 AM »
Automatic convert DCL to LISP & strcat.. and huge , highe of file.DCL
Embedding DCL into LISP  source
http://lisp2arx.3xforum.ro/
 8-) HERE DCL FILE.. 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-)
Code: [Select]
(setq t025 ""
t025 (strcat t025  "showurls : dialog {\n label = \"SHOWURLS - Show objects with attached URLs\";\n fixed_width=true;\n width=82;\n : list_box {\n key = \"lst_hdr\";\n tabs=\"58 72\";\n height = 2;\n fixed_height = true;\n tab_truncate = true;\n");;
t025 (strcat t025  " }\n : list_box {\n multiple_select=true;\n key=\"url_list\";\n tabs=\"58 72\";\n tab_truncate = true;\n is_default=true;\n }\n : row {\n : spacer {}\n : button {\n fixed_width=true;\n width=11;\n key=\"accept\";\n label= \"Show URL\";\n");;
t025 (strcat t025  " mnemonic = \"S\";\n }\n : button {\n fixed_width=true;\n width=11;\n key=\"edit\";\n label= \"Edit\";\n mnemonic = \"E\";\n is_default = true;\n }\n : button {\n fixed_width=true;\n width=11;\n key=\"replace\";\n label= ");;
t025 (strcat t025  "\"Replace\";\n mnemonic = \"R\";\n }\n : button {\n fixed_width=true;\n width=11;\n is_cancel=true;\n key=\"cancel\";\n label= \"Close\";\n mnemonic = \"C\";\n }\n : button {\n fixed_width=true;\n width=11;\n key=\"help\";\n label= ");;
t025 (strcat t025  "\"&Help\";\n is_help=true;\n }\n : spacer {}\n } \n : text_part {\n key=\"error\";\n label=\"\";\n }\n}\nchurl : dialog {\n key = \"title\";\n label = \"Change URL for All Selected Items\";\n initial_focus = \"url\";\n : edit_box ");;
t025 (strcat t025  "{\n label = \"URL:\";\n key = \"url\";\n edit_width = 50;\n edit_limit = 250;\n allow_accept = true;\n }\n ok_cancel_err;\n}\nrepurl : dialog {\n key = \"title\";\n label = \"Replace URL text\";\n initial_focus = \"find\";\n : ");;
t025 (strcat t025  "edit_box {\n label = \"Find what:\";\n key = \"find\";\n edit_width = 50;\n edit_limit = 250;\n }\n : edit_box {\n label = \"Replace with:\";\n key = \"replace\";\n edit_width = 50;\n edit_limit = 250;\n allow_accept = true;\n }\n");;
t025 (strcat t025  " ok_cancel_err;\n}\nlayeroff : dialog {\n label = \"SHOWURLS Warning\";\n children_alignment = centered;\n initial_focus = \"accept\";\n : text { label = \"The current layer is OFF!\";}\n : text { label = \"It must be ON to show URLs!\";}\n");;
t025 (strcat t025  " : text { label = \"\";}\n : text { label = \"Turn the current layer ON?\";}\n yes_no;\n}\nyes_button : retirement_button {\n label = \"  Yes  \";\n key = \"accept\";\n is_default = true;\n}\nno_button : retirement_button ");;
t025 (strcat t025  "{\n label = \"   No  \";\n key = \"cancel\";\n is_cancel = true;\n}\nyes_no : column {\n : row {\n fixed_width = true;\n alignment = centered;\n yes_button;\n : spacer { width = 2;}\n no_button;\n }\n}\n"))
;(str_princ (list ))
8-) HERE DCL FILE.. 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-) 8-)
Code: [Select]
showurls : dialog {
  label = "SHOWURLS - Show objects with attached URLs";
  fixed_width=true;
  width=82;
  : list_box {
    key = "lst_hdr";
    tabs="58 72";
    height = 2;
    fixed_height = true;
    tab_truncate = true;
  }
  : list_box {
    multiple_select=true;
    key="url_list";
    tabs="58 72";
    tab_truncate = true;
    is_default=true;
  }
  : row {
    : spacer {}
    : button {
      fixed_width=true;
      width=11;
      key="accept";
      label= "Show URL";
      mnemonic = "S";
    }
    : button {
      fixed_width=true;
      width=11;
      key="edit";
      label= "Edit";
      mnemonic = "E";
      is_default = true;
    }
    : button {
      fixed_width=true;
      width=11;
      key="replace";
      label= "Replace";
      mnemonic = "R";
    }
    : button {
      fixed_width=true;
      width=11;
      is_cancel=true;
      key="cancel";
      label= "Close";
      mnemonic = "C";
    }
    : button {
      fixed_width=true;
      width=11;
      key="help";
      label= "&Help";
      is_help=true;
    }
    : spacer {}
  } // row
  : text_part {
    key="error";
    label="";
  }
}

churl : dialog {
  key = "title";
  label = "Change URL for All Selected Items";
  initial_focus = "url";
  : edit_box {
    label = "URL:";
    key = "url";
    edit_width = 50;
    edit_limit = 250;
    allow_accept = true;
  }
  ok_cancel_err;
}

repurl : dialog {
  key = "title";
  label = "Replace URL text";
  initial_focus = "find";
  : edit_box {
    label = "Find what:";
    key = "find";
    edit_width = 50;
    edit_limit = 250;
  }
  : edit_box {
    label = "Replace with:";
    key = "replace";
    edit_width = 50;
    edit_limit = 250;
    allow_accept = true;
  }
  ok_cancel_err;
}

layeroff : dialog {
  label = "SHOWURLS Warning";
  children_alignment = centered;
  initial_focus = "accept";
  : text { label = "The current layer is OFF!";}
  : text { label = "It must be ON to show URLs!";}
  : text { label = "";}
  : text { label = "Turn the current layer ON?";}
  yes_no;
}

yes_button : retirement_button {
  label           = "  Yes  ";
  key             = "accept";
  is_default      = true;
}

no_button : retirement_button {
  label           = "   No  ";
  key             = "cancel";
  is_cancel       = true;
}

yes_no : column {
  : row {
    fixed_width = true;
    alignment = centered;
    yes_button;
    : spacer { width = 2;}
    no_button;
  }
}


CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Back to DCL - Oh the Irony
« Reply #9 on: April 19, 2012, 09:50:52 AM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

GDF

  • Water Moccasin
  • Posts: 2084
Re: Back to DCL - Oh the Irony
« Reply #10 on: April 19, 2012, 03:48:07 PM »
Or, if you have complicated dcl files that use repeating widgets among multiply routines, you can consider this approach:


//To load master widgets used by Arch Program© for AutoCAD®
@include "..\\ARCH.dcl"


All my interlocked dcl files use the ARCH.dcl much like AutoCAD's base.dcl file:
see enclosed examples.
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64