Is it possible to use relative path in AutoCAD script

Is it possible to use relative path in AutoCAD script

soonhui
Advisor Advisor
639 Views
6 Replies
Message 1 of 7

Is it possible to use relative path in AutoCAD script

soonhui
Advisor
Advisor

I have an AutoCAD script, AutoNetLoad2023.scr, which is located at 

 

C:\Users\User\Documents\Civil3DIntegrator\Test

 

The content of the script is as per below:

 

netload "C:\Users\User\Documents\Civil3DIntegrator\Test\bin\Debug\2023\Civil3DIntegratorTest.dll"
RunCADtests

 

Note that the Civil3DIntegratorTest.dll is located a few directories below the location of the AutoNetLoad2023.scr.

 

I wonder is it possible to modify the content of the script so that I can somehow specify the relative path of Civil3DIntegratorTest.dll ( to the AutoNetLoad2023.scr script), instead of absolute path?

##########

Ngu Soon Hui

##########

I'm the Benevolent Dictator for Life for MiTS Software. Read more here


I also setup Civil WHIZ in order to share what I learnt about Civil 3D
0 Likes
640 Views
6 Replies
Replies (6)
Message 2 of 7

_gile
Consultant
Consultant

Hi,

Did you try like this?

netload ".\bin\Debug\2023\Civil3DIntegratorTest.dll"
RunCADtests

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 7

soonhui
Advisor
Advisor

@_gile , I tried, no, it doesn't work.

 

netload "..\bin\Debug\2023\Civil3DIntegratorTest.dll"
RunCADtests

 Also not working

##########

Ngu Soon Hui

##########

I'm the Benevolent Dictator for Life for MiTS Software. Read more here


I also setup Civil WHIZ in order to share what I learnt about Civil 3D
0 Likes
Message 4 of 7

soonhui
Advisor
Advisor

Even if I wrote my scr as lsp file as such:

 

 

(command "netload" "..\\bin\\Debug\\2023\\Civil3DIntegrator.dll") 

 

 

It also doesn't work, the F2 only tells me Unable to load ..\bin\Debug\2023\Civil3DIntegrator.dll assembly 

 

I've no idea why. 

##########

Ngu Soon Hui

##########

I'm the Benevolent Dictator for Life for MiTS Software. Read more here


I also setup Civil WHIZ in order to share what I learnt about Civil 3D
0 Likes
Message 5 of 7

_gile
Consultant
Consultant

Try:

(command "netload" ".\\bin\\Debug\\2023\\Civil3DIntegrator.dll") 


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 6 of 7

_gile
Consultant
Consultant

Another thing: the path have to be relative to directory the script is called from.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 7 of 7

soonhui
Advisor
Advisor

@_gile , no, this command also doesn't work. Lisp also doesn't know how to interpret relative path.

##########

Ngu Soon Hui

##########

I'm the Benevolent Dictator for Life for MiTS Software. Read more here


I also setup Civil WHIZ in order to share what I learnt about Civil 3D
0 Likes