Author Topic: [navigation] XDRX API sub-forum navigation post (2024.05.01)  (Read 2929 times)

0 Members and 1 Guest are viewing this topic.

xdcad

  • Swamp Rat
  • Posts: 504
[navigation] XDRX API sub-forum navigation post (2024.05.01)
« on: December 20, 2023, 02:17:05 AM »
2024.04.23 Provide API compressed package version, no exe installation required

The latest version is 2024.05.08

=====================

https://github.com/xdcad/XDrx-API-zip

https://sourceforge.net/projects/xdrx-api-zip/

Dual version link:

https://github.com/xdcad


=====================

# XDrx-API-zip
Autolisp development library written in ObjectARX (ZIP Version)


1.Installation help:


===================================================

1. Unzip the file to the specified directory

2. Depending on your AutoCAD version, the 32-bit version of AutoCAD corresponds to x86, and the 64-bit version of AutoCAD corresponds to x64. Find the corresponding ARX file
     For example: the corresponding arx file for AutoCAD 2025 is: xdrx.2025.x64.arx
     
3. Use the mouse to drag the file install.lsp to the ACAD window,
                                  Select the specified ARX file in the SYS directory,
                                  After confirmation, if prompted when loading, choose to load.

4. Finished. This process only needs to be performed once, and XDrx API will be automatically loaded when AUTOCAD is started later


===================================================

2.UnInstallation help:

        Use the mouse to drag the file uninstall.lsp to the ACAD window.
        Finished.

===================================================
« Last Edit: May 01, 2024, 01:20:25 AM by xdcad »
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net



V@no

  • Newt
  • Posts: 25
  • AutoCAD 2023
Re: [navigation] XDRX API sub-forum navigation post
« Reply #3 on: April 26, 2024, 09:36:13 PM »
Getting error when trying follow the installation instructions
Quote
Command: (ARXLOAD "E:/Program Files/AutoCAD 2023/XDrx-API/SYS/XDRx.2023.x64.arx")
e:\program files\autocad 2023\xdrx-api\sys\xdrx.2023.x64.arx cannot find a dll or other file that it needs.
; error: ARXLOAD failed

xdcad

  • Swamp Rat
  • Posts: 504
Re: [navigation] XDRX API sub-forum navigation post
« Reply #4 on: April 26, 2024, 09:47:16 PM »
Getting error when trying follow the installation instructions
Quote
Command: (ARXLOAD "E:/Program Files/AutoCAD 2023/XDrx-API/SYS/XDRx.2023.x64.arx")
e:\program files\autocad 2023\xdrx-api\sys\xdrx.2023.x64.arx cannot find a dll or other file that it needs.
; error: ARXLOAD failed

This may happen with some versions,
try, Manually copy XDrx.x64.dll and XDrx.x86.dll in  sys directory,
to AutoCAD Install Directory
« Last Edit: April 27, 2024, 02:05:54 AM by xdcad »
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8753
  • AKA Daniel
Re: [navigation] XDRX API sub-forum navigation post
« Reply #5 on: April 26, 2024, 09:52:38 PM »
"try, Manually copy XDrx.x64.dll in the sys directory to c:\windows\system32"
Yuk!

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8753
  • AKA Daniel
Re: [navigation] XDRX API sub-forum navigation post
« Reply #6 on: April 26, 2024, 10:03:06 PM »
You should create a loader module that sets up the environment and loads dependencies
Like this.
https://github.com/CEXT-Dan/PyRx/blob/main/PyRxLoader/acrxEntryPoint.cpp
I use an .INI file as a fallback   

xdcad

  • Swamp Rat
  • Posts: 504
Re: [navigation] XDRX API sub-forum navigation post
« Reply #7 on: April 26, 2024, 11:25:35 PM »
You should create a loader module that sets up the environment and loads dependencies
Like this.
https://github.com/CEXT-Dan/PyRx/blob/main/PyRxLoader/acrxEntryPoint.cpp
I use an .INI file as a fallback

The same directory as ARX has been specified to load the DLL, but some versions of ARX still do not load, prompting that it cannot be found.

Is there any other good way?

Code: [Select]
#ifdef _WIN64
LoadDLL(_T("XDrx.x64.dll"),true);
#else
LoadDLL(_T("XDrx.x86.dll"), true);
#endif

Code - C++: [Select]
  1. void LoadDLL(ACHAR* pszDllFilename, bool load)
  2. {
  3.         ACHAR szPath[210] = ACRX_T("");
  4.         ::GetModuleFileName(_hdllInstance, szPath, MAX_PATH);
  5.         ACHAR* pCursor;
  6.         for (pCursor = szPath; *pCursor != ACRX_T('\0'); pCursor++)
  7.         {
  8.                 if (*pCursor == ACRX_T('\\'))
  9.                         *pCursor = ACRX_T('/');
  10.         }
  11.         int idxSearch = lstrlen(szPath) - 1;
  12.         for (; idxSearch >= 0; idxSearch--)
  13.         {
  14.                 if (szPath[idxSearch] == ACRX_T('/') ||
  15.                         szPath[idxSearch] == ACRX_T(':'))
  16.                         break;
  17.         }
  18.         idxSearch++;
  19.         if (pszDllFilename)
  20.                 lstrcpy(szPath + idxSearch, pszDllFilename);
  21.         //adsout << _T("\nname=") << szPath;
  22.         ACHAR result[256];
  23.         if (acedFindFile(szPath, result) == RTNORM)
  24.         {
  25.                 if (load)
  26.                 {
  27.                         LoadLibrary(szPath);
  28.                         //acrxDynamicLinker->loadModule(szPath, 1);
  29.                 }
  30.                 else {
  31.                         FreeLibrary(::GetModuleHandle(pszDllFilename));
  32.                         //acrxDynamicLinker->unloadModule(pszDllFilename,false);
  33.                 }
  34.         }
  35.         return;
  36. }
  37.  

The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8753
  • AKA Daniel
Re: [navigation] XDRX API sub-forum navigation post
« Reply #8 on: April 27, 2024, 12:05:22 AM »
Maybe add your path to %PATH% with SetEnvironmentVariable before you load XDrx.x64.dll
But you absolutely should not advise people to start moving DLLs into c:\windows\system32


xdcad

  • Swamp Rat
  • Posts: 504
Re: [navigation] XDRX API sub-forum navigation post
« Reply #9 on: April 27, 2024, 02:12:41 AM »
Maybe add your path to %PATH% with SetEnvironmentVariable before you load XDrx.x64.dll
But you absolutely should not advise people to start moving DLLs into c:\windows\system32

What needs to be solved now is the non-EXE installation version.
Set support paths and trust paths. Just load it successfully once.

Is there a way to drag and drop a LISP to load, and then get the path in LISP? It would be easier if we got the path
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net

V@no

  • Newt
  • Posts: 25
  • AutoCAD 2023
Re: [navigation] XDRX API sub-forum navigation post
« Reply #10 on: April 27, 2024, 09:26:32 AM »
And just while we are on the subject. If this modifies any system registry, environmental PATH, or copies any files beyond its folder, please provide detailed uninstall instructions.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8753
  • AKA Daniel
Re: [navigation] XDRX API sub-forum navigation post
« Reply #11 on: April 27, 2024, 09:37:15 AM »
And just while we are on the subject. If this modifies any system registry, environmental PATH, or copies any files beyond its folder, please provide detailed uninstall instructions.

FYI, my recommendation “path to %PATH% with SetEnvironmentVariable” doesn’t stick
It’s just for the process

https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setenvironmentvariable
Quote
SetEnvironmentVariable
Sets the contents of the specified environment variable for the current process
This function has no effect on the system environment variables or the environment variables of other processes.



xdcad

  • Swamp Rat
  • Posts: 504
Re: [navigation] XDRX API sub-forum navigation post
« Reply #12 on: April 27, 2024, 11:25:39 AM »
And just while we are on the subject. If this modifies any system registry, environmental PATH, or copies any files beyond its folder, please provide detailed uninstall instructions.

The special situation you encountered,
Under normal circumstances, there is no need to copy any files to other places.

Only path and trustedpath paths are set

The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net

V@no

  • Newt
  • Posts: 25
  • AutoCAD 2023
Re: [navigation] XDRX API sub-forum navigation post
« Reply #13 on: April 27, 2024, 11:44:50 AM »
Ok, so I got it working by adding path to XDRX-API/SYS folder to "Support File Search Path" in AutoCAD options.