OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Peter2 on June 09, 2016, 12:29:40 PM

Title: (command "_opendcl") versus opendcl
Post by: Peter2 on June 09, 2016, 12:29:40 PM
Hi

I have some lisps which contain the line
Code (autolisp) Select
(command "_opendcl")
and it worked for the last two years.

Today, on a foreign PC (AutoCAD Mechanical 2015, German, x64, Opendcl 8.0.5 currently installed) I had problems to load Opendcl.

(command "_opendcl")  -> command was refused by AutoCAD
_opendcl   (entered in commandline) -> unknown command
opendcl (in commandline) -> worked fine

I was in a hurry and could not nail the problem down - can it be explained based on this short information?

Thanks

Peter
Title: Re: (command "_opendcl") versus opendcl
Post by: Fred Tomke on June 09, 2016, 12:59:59 PM
Hi, Peter, works fine for me in Map 2016 x64 DEU:

Code (autolisp) Select

Befehl: (command "_opendcl")
_opendcl
OpenDCL Laufzeitumgebung [8.0.5.0] wurde geladen
Befehl: nil


Just try a repair installation of OpenDCL runtime.

Regards, Fred
Title: Re: (command "_opendcl") versus opendcl
Post by: owenwengerd on June 09, 2016, 09:40:19 PM
I'd guess the demand load registry keys got messed up. If it's the HKCU keys that got messed up, I think those should be recreated on every load. If it's the HKLM keys, then a repair install should fix it. I suppose it's possible that the command was undefined or something, but that seems unlikely.
Title: Re: (command "_opendcl") versus opendcl
Post by: Peter2 on June 09, 2016, 11:31:51 PM
Quote from: Fred Tomke on June 09, 2016, 12:59:59 PM
Just try a repair installation of OpenDCL runtime.
I made a new installation, but nothing changed.

Quote from: owenwengerd on June 09, 2016, 09:40:19 PM
...I think those should be recreated on every load.
You mean it is recreated automatically by the software?
Title: Re: (command "_opendcl") versus opendcl
Post by: Peter2 on June 14, 2016, 03:20:17 AM
Me again. I have the same problem on my own machine (same app). I start AutoCAD, it loads the apps, and I get the message:
Code (autolisp) Select

Regeneriert Modell.
; Fehler: AutoCAD-Befehl zurückgewiesen: "_opendcl"
; Fehler: AutoCAD-Befehl zurückgewiesen: "_opendcl"
; Fehler: AutoCAD-Befehl zurückgewiesen: "_opendcl"
; Fehler: AutoCAD-Befehl zurückgewiesen: "_opendcl"


AutoCAD Menü-Dienstprogramme geladen.*Abbruch*

Befehl:
Befehl:

-->> Then I enter the command manually:

Befehl:
Befehl: _OPENDCL

OpenDCL Runtime [8.0.5.0] loaded

Any quick ideas?

Peter
Title: Re: (command "_opendcl") versus opendcl
Post by: Fred Tomke on June 14, 2016, 04:08:45 AM
Yeaaah! I know this from an other case - it's not OpenDCL related.
Remove all the code inluding (command "_opendcl") and see what AutoCAD wants at this point.
Calling opendcl command is not allowed at this point when you call it from your code.
Regards, Fred
Title: Re: (command "_opendcl") versus opendcl
Post by: Peter2 on June 14, 2016, 04:51:05 AM
Quote from: Fred Tomke on June 14, 2016, 04:08:45 AM
...Calling opendcl command is not allowed at this point when you call it from your code....
Hmmmh - it is in a VLX which is loaded by Autoloader / bundle. So I supposed that Acad is ready for "_opendcl" at this moment ??
Title: Re: (command "_opendcl") versus opendcl
Post by: Peter2 on June 14, 2016, 02:51:12 PM
Interim report:

The problem is caused by the different loading times of different loading commands.

Some of my tools were loaded in "classic style":
a) Cuix -> loads MNL -> contains (load "test.lsp") or
b) appload -> "Startgruppe" (Start group in English?)

These commands run after loading of Opendcl and Doslib, and this is why my commands worked fine.

Now I try to define Bundles for Autoloader, and they load the Lisp/VLX much earlier, when OpenDCL is not yet ready ... >:(

Problem a)
I can not them once when loading the lisp, I have to call them later, when executing a command.

Problem b)
I use also "Option Tabs" by OpenDCL, and here I will have a problem with solution a): If a user starts "_options" he will not see my "Option tabs", because they are not loaded via lisp-load and they are not loaded via command-execution.

Solution a)
Can be solved (time consuming) with adding the load-commands to every user-command.

Solution b)
?????

Any hints for working with bundles and loading DosLib / OpenDCL?
Title: Re: (command "_opendcl") versus opendcl
Post by: Fred Tomke on June 16, 2016, 07:00:45 AM
Hi, Peter,

what do you mean with "when OpenDCL is not yet ready ..."
The command is available even when you start AutoCAD because it is only a command definition in the registry.

I do know that is recommended to use the command. We use the arxload function to load the libraries instead.
Please try calling arxload function instead of calling opendcl command - just for testing!

I have no experiences with bundles and doslib.
Please give me an introduction for bundles, that I can have some tests. So maybe we can also build a sample for that.

Regards, Fred
Title: Re: (command "_opendcl") versus opendcl
Post by: Peter2 on June 16, 2016, 02:02:38 PM
Hi Fred

I will give you some infos, but it will take a few days ...
Title: Re: (command "_opendcl") versus opendcl
Post by: Peter2 on June 20, 2016, 08:06:35 AM
Quote from: Fred Tomke on June 16, 2016, 07:00:45 AM
...Please try calling arxload function instead of calling opendcl command - just for testing!...
Fine idea - it seems to work.
The disadvantage is, that I have to handle the version of Acad and OS to load the right Arx - it is an advantage of the Autoloader that this part is done by AutoCAD.


Quote from: Fred Tomke on June 16, 2016, 07:00:45 AM
...Please give me an introduction for bundles, that I can have some tests. ...
An introduction is not so easy - I have 60 A4-pages printed with the infos. But here are some links:

- Search your AutoCAD-help file for "packageContents". You will find everything very detailed
- "AutoCAD DevBlog" http://adndevblog.typepad.com/autocad/ Search for "Autoloader" - you will find a lot a starting and detailed infos, beginning with "Autodesk Autoloader White paper" from 2013: http://adndevblog.typepad.com/autocad/2013/01/autodesk-autoloader-white-paper.html


I attach a simple bundle with a simple lisp (witout the arxload solution) to test and see the behaviour. I also sent it to ADN-Support, maybe they have a solution.

Regards

Peter


EDIT 1:
I played around to merge the loading of OpenDCL-Arx into the bundle. This seem to work too, but ....
... the Component "Modulename" requires that the ARX is inside the Bundle. So you have the files to every bundle you make, you can not use the Arx from their installed place (if they are installed). This is in opposition to Autodesks recommendation to define 3rd party tools as prerequisite and not to include them to the bundle ....
Title: Re: (command "_opendcl") versus opendcl
Post by: Peter2 on June 22, 2016, 08:04:40 AM
Answer from Autodesk:
QuoteNormally, developerââ,¬â,,¢s workaround this issue with loading an ARX from bundle which intern loads all the required modules (which are not in the bundle).

So there are two ways to handle the loading of Arx while loading a bundle (with Lisp):
a) Use your code to "arxload" what you want and what you need.
b) Include all external Arx into your bundle and load them with bundle commands.

Do NOT include a call of demand-loading (of registered commands) in your bundle IF the call is executed during loading the code.
There is no problem if you call the command AFTER the bundle was loaded.
Title: Re: (command "_opendcl") versus opendcl
Post by: owenwengerd on June 23, 2016, 11:20:09 AM
The demandload system looks up the module name to load in the Applications/OpenDCL/Loader registry key. Your startup lisp code can do the same, so that you don't lose the benefit of insulating your app installation from the OpenDCL installation.
Title: Re: (command "_opendcl") versus opendcl
Post by: Peter2 on June 23, 2016, 12:30:42 PM
Hi Owen

can you run my bundle I posted above? I would be curious if it runs or not ...
Title: Re: (command "_opendcl") versus opendcl
Post by: Fred Tomke on June 29, 2016, 12:55:23 PM
Hello, sorry Peter that I didn't phone you last week: time was running too fast. I'm at customer trainings this and next week so I just tested your package but I was not able to place it correctly that it would be loaded automatically. Drag'nDropping the lisp into the drawing was loading the list and some alerts came up. OpenDCL was not loaded.

But I've found out that OpenDCL wasn't registered correctly in AutoCAD 2017: HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R21.0\ACAD-0001:407\Applications\OpenDCL ist missing. That's why opendcl command does not work:
QuoteBefehl: (command "_opendcl")
_opendcl Unbekannter Befehl "OPENDCL". Drücken Sie F1-Taste für Hilfe.
Befehl: nil

In AutoCAD 2016 it works well (HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R20.1\ACAD-F001:407\Applications\OpenDCL exists):
QuoteBefehl: (command "_opendcl")
_opendcl
OpenDCL Laufzeitumgebung [8.0.5.0] wurde geladen

I repaired Studio again and again and even reinstalled it: still the same: key is missing (Infrastructure Design Suite Ultimate).
Regards,
Fred
Title: Re: (command "_opendcl") versus opendcl
Post by: Peter2 on June 29, 2016, 01:10:29 PM
The Test-Bundle should work if you copy it to %appdata%\Autodesk\ApplicationPlugins\arx_call_test.bundle.

The registry value for AutoCAD 2017 are OK for me, e.g.
Code (autolisp) Select
\\\Registry\HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R21.0\ACAD-0001[colon]407\Applications\OpenDCL\Description
Title: Re: (command "_opendcl") versus opendcl
Post by: Fred Tomke on June 29, 2016, 09:05:16 PM
Hello, quite interesting: opendcl command doesn't even work if I create the keys manually. But it appears in the "suggestionlist" of the commandline.
Only copying the bundle there has not effect: won't be loaded in my AutoCAD 2016.
Regards, Fred