Skip to main content
All CollectionsManuals, Tutorials, How to... FAQ'sFAQ's Frequently Asked Questions
How to check via LISP, if a .NET application is already loaded
How to check via LISP, if a .NET application is already loaded

LISP, LISP Reference, Learning Content, .NET, NETLOAD, C#

Christian Kramer avatar
Written by Christian Kramer
Updated over 5 years ago

Via LISP you have only the option to load your .NET application the NETLOAD command. When you load it automatically then you need to load it only once and not in every drawing instance. Otherwise you get an NETLOAD error, that the application is already loaded. Below a piece of code, which you can add to your C#-sources. Via it you can check the status, if your application is loaded or not.

Attached a C# example (LispUtility.zip) for ARES Commander 2018 SP2 and following versions, which explains how you can check via LISP, if you .NET application is already loaded. It can be added to the project of the CSharp-Examples in the ARES Commander 2018 SDK or later.

: (IsAssemblyLoaded "LispUtility.dll")
1

: (IsAssemblyLoaded "MyApp.dll")
0

The function you must add to your application e.g. MyApp.dll and then you can check it from LISP with the following line:

(if (= (IsAssemblyLoaded "MyApp.dll") 0)(command "netload" "MyApp.dll"))

Download the Archive-file from here.

Did this answer your question?