Author Topic: How to load OpenDCL  (Read 26367 times)

0 Members and 1 Guest are viewing this topic.

GDF

  • Water Moccasin
  • Posts: 2081
How to load OpenDCL
« on: July 29, 2008, 11:40:11 AM »
I'm new to OpenDCL, so be kind.

I have OpenDCL loaded into my computer, the latest version. What is the best way to load OpenDCL into AutoCAD?

This works:
I enter OpenDCL at the command line into a new session of AutoCAD. Then any OpenDCL dialogue box will display without errors, and everything works fine.

This does not work:
Dragging the OpenDCL arx file into a new session of AutoCAD, and into a drawing produces an error message.

Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: How to load OpenDCL
« Reply #1 on: July 29, 2008, 01:04:33 PM »
Why D&D doesn't work:

OpenDCL.arx has a subfolder with a language DLL file (this is so we can have multiple languages - ObjectDCL didn't have this).  Most likely the OpenDCL.arx folder isn't in AutoCAD's search path so it can't find the Language DLL OpenDCL is asking for - hence the error.

Make sure if you move OpenDCL.arx to a folder in AutoCAD's search path, maybe a customization folder, move the ENU sub folder as well.

If you want to code the loading in say an .mnl file you can use something like this:

Code: [Select]
;;; ManualLoading.lsp
;;; For OpenDCL Ver 4.0
;;; Edit kwb 20070225 GMT00:00:00
;;; Edit orw 20070518 GMT07:30:xx :: added 64 bit arx file selection
;;;                                       returns "OpenDCL.x64.17.ARX"
;;; Last Edit kwb as suggested by MichaelP 20070608 GMT00:30:xx
;;;                :: change location of dcl_GETVERSIONEX test.
;;

;; This code block loads the OpenDCL.##.arx files if not already loaded
;; Note, Loader will return T if loaded or nil otherwise.
;;
;; If the OpenDCL.##.arx is loaded at startup or demand loaded
;; this routine need never run.
(OR dcl_GETVERSIONEX
    (   (lambda ( / proc_arch arxname arxpath )

            ;;  Determine the appropriate arx module for
            ;;  the processor and the AutoCAD version.

            (setq arxname
                (strcat "OpenDCL"
                    (if
                        (and
                            (setq proc_arch (getenv "PROCESSOR_ARCHITECTURE"))
                            (< 1 (strlen proc_arch))
                            (eq "64" (substr proc_arch (1- (strlen proc_arch))))
                        )
                        ".x64."
                        "."
                    )
                    (substr (getvar "acadver") 1 2)
                    ".arx"
                )
            )           
            ;;  Alert the user of a failure to:
            ;;
            ;;      (A) Find the arxfile, or
            ;;      (B) Load the arxfile.
            ;;
            ;;      and return nil.
            ;;
            ;;  Otherwise just quietly return t.
           
            (cond
                (   (null (setq arxpath (findfile arxname)))
                    (alert (strcat "Couldn't find " arxname ".\nYou may need to add it to an Acad support path"))
                )
                (   (null (arxload arxpath 'nil))
                    (alert (strcat "Failed to load " arxname "."))
                )
                (   t   )
            )
        )
    )
)


Hope this helps.
James Buzbee
Windows 8

GDF

  • Water Moccasin
  • Posts: 2081
Re: How to load OpenDCL
« Reply #2 on: July 29, 2008, 02:33:46 PM »
Thanks for the reply. I do have the arx file in the support path...
What does entering in opendcl at the command line do?

ManualLoading.lsp does not work, I get an error message.
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How to load OpenDCL
« Reply #3 on: July 29, 2008, 06:37:47 PM »
Gary,
What is the error message.

Quote
What does entering in opendcl at the command line do?
the command 'OpenDCL' will demand load the OpenDCL arx.

If the OpenDCL IDE or runtime is installed, the installer makes the changes to the registry to register the command.

If the ARX file is copied to be used from another folder ..
note that the C:\Program Files\Common Files\OpenDCL\ENU\Runtime.Res.dll should be in the same folder as the ARX
[ perhaps having the \ENU folder and contents as a child to the ARX folder will work too.]



Personally, I use this defined in my Library ; and call  (KDUB:checkopendclloaded) at the top of eack file that uses OpenDCL
... but just calling it from [say] a MNL file should be adequate.
Code: [Select]
;;;------------------------------------------------------------------
;;;------------------------------------------------------------------
;; (KDUB:checkopendclloaded)
(defun kdub:checkopendclloaded (/)
  ;; Demand load the OpenDCL.##.ARX.
  ;; This requires the OpenDCL Runtime or Studio to be installed on each PC first.
  ;; OR
  ;; load the ARX if found.
  (cond
    ((= 'exrxsubr (type dcl_getversionex)))
    ((and
       (setq arxname
              (strcat
                "OpenDCL"
                (if
                  (and
                    (setq
                      proc_arch (getenv "PROCESSOR_ARCHITECTURE")
                    )
                    (< 1 (strlen proc_arch))
                    (eq "64"
                        (substr proc_arch (1- (strlen proc_arch)))
                    )
                  )
                   ".x64."
                   "."
                )
                (substr (getvar "acadver") 1 2)
                ".arx"
              )
       )
       (= 2 (boole 1 (getvar "DEMANDLOAD") 2))
       (findfile
         (strcat "c:\\Program Files\\Common Files\\OpenDCL\\" arxname)
       )
       (command "OpenDCL")
     )
     (if (/= 'exrxsubr (type dcl_getversionex))
       (progn
         (alert
           "The OpenDCL Runtime module failed to load. Please repair the OpenDCL installation and try again."
         )
         (exit)
       )
     )
    )
    ((null (setq arxpath (findfile arxname)))
     (alert (strcat "Couldn't find "
                    arxname
                    ".\nYou may need to add it to an Acad support path"
            )
     )
    )
    ((null (arxload arxpath 'nil))
     (alert (strcat "Failed to load " arxname "."))
    )
    (t)
  )
  (princ)
)

edit:
This is an OLD thread and the load method has been refined.
To Quote Owen :
Quote
The moral of the story: if everyone plays nice by installing the runtime .msi file (or the ODCL Studio Editor) , then using (command "_OPENDCL") to ensure it's loaded, there won't be any problems.

So we no longer need to jump through hoops .... :)

« Last Edit: August 12, 2013, 11:07:25 PM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

GDF

  • Water Moccasin
  • Posts: 2081
Re: How to load OpenDCL
« Reply #4 on: July 30, 2008, 09:51:33 AM »
Thanks guys,

Below is the error message I get when runing the James, maualloading.lsp routine; or if I use the different approach of dragging the arx file into autocad drawing file.

I have both the arx and dll in the same folder, within the autocad's search path.

Question: does the runtime.res.dll file require special loading (like in the registry)?

Gary

Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: How to load OpenDCL
« Reply #5 on: July 30, 2008, 10:22:05 AM »
put the language DLL in a sub folder: ENU

James Buzbee
Windows 8

GDF

  • Water Moccasin
  • Posts: 2081
Re: How to load OpenDCL
« Reply #6 on: July 30, 2008, 11:31:44 AM »
put the language DLL in a sub folder: ENU



That did the trick, thanks James!!!
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: How to load OpenDCL
« Reply #7 on: July 30, 2008, 12:08:52 PM »
no problem - hey check out my tutorial series over at "show your stuff".
James Buzbee
Windows 8

GDF

  • Water Moccasin
  • Posts: 2081
Re: How to load OpenDCL
« Reply #8 on: July 30, 2008, 01:53:53 PM »
no problem - hey check out my tutorial series over at "show your stuff".

I saw that, I will play with your examples, and many thanks again.
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

owenwengerd

  • Bull Frog
  • Posts: 451
Re: How to load OpenDCL
« Reply #9 on: August 04, 2008, 01:46:49 PM »
FWIW, there is no reason for the .arx to be on the support path. Dragging the .arx into AutoCAD will work fine if it is dragged from the original installation folder in Common Files. Furthermore, if you are building applications that rely on OpenDCL Runtime, you should be very careful before mucking with the standard installation lest you break other OpenDCL applications on the same computer. This is very important, because there can only be one instance of OpenDCL Runtime loaded in AutoCAD. When multiple applications each attempt to load and use their own private versions of the runtime, chaos will ensue, likely resulting in neither application working correctly.

The moral of the story: if everyone plays nice by installing the runtime .msi file, then using (command "_OPENDCL") to ensure it's loaded, there won't be any problems.

GDF

  • Water Moccasin
  • Posts: 2081
Re: How to load OpenDCL
« Reply #10 on: August 04, 2008, 04:19:08 PM »
Owen

Thanks for the info. Can I place the arx file on the network server? I would like to have the opendcl.arx file and the supporting dll file on a search path on our server, similar to what I do for doslib17.arx file.


Or do I have to install the runtime .msi file, then using (command "_OPENDCL") for each workstation?

Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

owenwengerd

  • Bull Frog
  • Posts: 451
Re: How to load OpenDCL
« Reply #11 on: August 04, 2008, 07:22:54 PM »
Gary:

  I recommend to install it locally on each machine using the .msi file (or better yet, use the .msm merge module and create your own .msi to deploy the runtime along with your lisp and .odcl files). When you install locally, the Windows Installer infrasructure maintains correct reference counts on the files, so that they can be safely shared by multiple applications, and uninstalling your application will remove the files if and only if they are no longer needed.

  Having said that, if you understand the risks and are willing to incur the extra overhead of managing things manually, the runtime files will work fine if they are loaded from a network location.

  I think many network administrators perceive an advantage to having things in a central location simply because they don't know how to deploy new applications to clients in an automated way.  Consider the fact that loading from a network server is almost always slower than loading from a local drive.  Adding more stuff to load off of a network server just slows down the already excruciatingly slow AutoCAD startup process.  Given the potential and actual disadvantages, I think loading anything from a network server (except shared files or data that must be shared in real time) is a bad idea.

  I'm curious to know why you want to load things over the network.  It's always possible that I'm missing something.

GDF

  • Water Moccasin
  • Posts: 2081
Re: How to load OpenDCL
« Reply #12 on: August 05, 2008, 01:16:13 PM »
Owen

Thanks again. I've just always placed my apps and inhousearch_program routines on the network. I am looking for the easiest way to do the same for opendcl. I understand that this maynot be the best or fastest running way.

Is just placing the objectdcl.17.arx file in the search path and the runtime.res.dll file in the enu subfolder all I need to do? The dll file doesnot need to be windows registered with a dllregisteredserver regsur32?

Then all I would need to do is appload the opendcl.17.arx file whenever it is needed if not allready loaded. This is what I do with doslib17.arx file.
That way I would not have to install opendcl upon each cad station.

I hope I am understanding this correctly.

Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: How to load OpenDCL
« Reply #13 on: August 05, 2008, 03:02:45 PM »
Gary,

I have OpenDCL.arx with all my in-house custom stuff too, with the ENU subfolder.  I have a custom .cui file that runs the corresponding .mnl that loads a buch of stuff, including OpenDCL.  What your talking about sounds fine to me.
James Buzbee
Windows 8

owenwengerd

  • Bull Frog
  • Posts: 451
Re: How to load OpenDCL
« Reply #14 on: August 05, 2008, 03:15:48 PM »
The only thing needed is to load the .arx file.  It does not need to be (and should not be) in the AutoCAD support path.