Desenare 2D Modelare 3D BIM Mechanical

CAD Managers’ Corner – LISP Concepts for Easy Migration

De The Bricsys Team 7 min 7 octombrie 2019
LISP Concepts for Easy Migration

In our last post, we talked about automatically loading a standardized profile at BricsCAD® startup so all users would see the same CUI interface and have the same configuration folders for external files and peripherals like printers/plotters. Whilst this is certainly a good start to achieving overall consistency, there are other issues that can come into play – particularly if you are migrating users from other CAD systems to BricsCAD.

When users have worked with another CAD system for many years, their entire base of experience is centred on the command vocabulary and function of that other system and, as we all know, change can be hard.  So it turns out that making BricsCAD function as much like the old system our users already know is a great way to improve user satisfaction, raise productivity, and shorten training times for BricsCAD implementation.

In this installment, we’ll explore how you can use some LISP code to tailor BricsCAD to your users’ liking while achieving a standardized environment that is easy to maintain over time. Let’s see how.

The Concept

If you are implementing BricsCAD for users migrating from a popular system like AutoCAD®, it is desirable to make the BricsCAD command vocabulary as compatible with it as possible and LISP is a great way to accomplish this task.  But before we dive into any code, let’s outline the concept of what we’ll be doing:

Standardize loading. Here we’ll use the ON_START.LSP file to control the BricsCAD startup.

Standardize the LISP environment in a network folder. Here we’ll establish a standardized network location that contains any LISP files and resources our users will need (while also applying protective permissions to discourage tampering).

Standardize the command vocabulary. Here we’ll use some LISP to make BricsCAD’s command set feel like what users would expect from their old CAD system.

Add useful functions. Here we can use LISP to add useful functions like keystroke shortcuts for additional productivity.

The true beauty of this approach is that any custom code you create will be in a single network location that serves all, whilst making maintenance easy for you.

Be sure ON_START.LSP Exists

When BricsCAD starts up it automatically looks for an AutoLISP file called ON_START.LSP and executes any code it finds in the file, so you need to be sure it exists and that BricsCAD can find it. All you must do is place the ON_START.LSP file in BricsCAD’s support directory – you can manage this using the SETTINGS command and looking under Program Options / Files.

Settings-Dialog-Support-Path 2

Now simply exit BricsCAD and restart and the ON_START.LSP file will be loaded in and executed.

Add Code for Network Location

In the ON_START.LSP place code that will instruct BricsCAD where it should load all your custom code. For argument’s sake, we’ll say that the file we should use is as follows:


This code would now be placed in the ON_START.LSP file:

(if (findfile "x:\lisp\standards.lsp")
(load "x:\lisp\standards.lsp")
(prompt “\nBricsCAD startup routine loaded.”)

This code has several advantages:

  • It tests for the presence of the network file and only loads the file if it is found – thus preventing errors for unplugged laptop users where the network directory can’t be found.
  • A diagnostic prompt is issued so a quick inspection of the command line will show if the ON_START.LSP file has been loaded.
  • Using this methodology, the ON_START.LSP file will never need to be edited again so long as the X:\LISP\STANDARDS.LSP file is maintained.

    Now save the ON_START.LSP file, restart BricsCAD and make sure the file loads by looking for the BricsCAD startup routine loaded message at the command line.

Create the STANDARDS.LSP File to Define Commands and Shortcuts

Now it is time to create the X:\LISP\STANDARDS.LSP file and put some code in it. But what code is that?

Consider these practical examples:

Example 1:

Several prior AutoCAD® users noticed that BricsCAD doesn’t have an ORBIT command but does have a command called RTROT that works in much the same manner.  These users are very used to typing in ORBIT and have even created some CUI based macros they wish to use, so not having an ORBIT command is a pain.

How can we make these users happy? We give them an ORBIT command by putting the following code in the X:\LISP\STANDARDS.LSP file:

(defun C:ORBIT ()
(command “RTROT”)

This code does the following:

  • It defines a command function called ORBIT that invokes the BricsCAD RTROT command. This function can be used at the command line or within macros as needed.
  • It provides the AutoCAD® user with a command environment that feels comfortable to them. They simply think they are using the ORBIT command.
  • Since the code is in the centrally located STANDARDS.LSP file all users will also see the new ORBIT function.

After the next startup of BricsCAD your users will be able to type ORBIT as if it was a native BricsCAD command.

Example 2:

A prior AutoCAD® user has noticed that BricsCAD’s LAYER command brings up the unified Drawing Settings panel rather than a simple list of layers as they are used to. Since the Drawing Settings can’t be used transparently like the AutoCAD® user is used to it causes them some confusion. However, the BricsCAD command LAYERSPANELOPEN works just like the layer command in AutoCAD® does.

How can we make this user happy? We redefine the LAYER command to act like AutoCAD®.

This code would now be placed in the STANDARDS.LSP file:

(command “undefine” “layer”)
(defun C:LAYER ()

This code does the following:

  • It undefines the LAYER command as BricsCAD knows it.
  • It substitutes a new LAYER command into the BricsCAD command vocabulary.
  • When LAYER is entered the LAYERSPANELOPEN command is invoked.

    Now the AutoCAD® user feels right at home and never needs to know the LAYERSPANELOPEN command even exists.

Example 3:

A user said their last CAD system had an NP command that brings up Notepad for quick file editing.

How can we make this user happy? We simply add an NP command to BricsCAD that calls the standard Windows Notepad.exe file.

This code would now be placed in the STANDARDS.LSP file:

(defun c:np ()
(startapp “notepad.exe”)

The only thing to mention in this example is use of the STARTAPP function which allows the calling of external programs from LISP routines.

Note: No path is required in this case because NOTEPAD.EXE is a system level command that Windows already has registered.

The Sky is the Limit

How much do you care to do with your STANDARDS.LSP file? Only you can answer that question but now you know how the approach works, you can start exploring what you’d like to do.

Now that we’ve installed BricsCAD, got the correct configuration and profile information in place, and now have the command vocabulary set to emulate other programs we should be able to move forward with training. Head to the next blog in the series to learn more.

Ready to try BricsCAD?

Easy to try, easy to buy, easy to own. That’s BricsCAD. Try all of our products, for free for 30 days at Freedom of choice, plus perpetual (permanent) product licenses that work with all languages, in all places. You’ll love what we’ve built for you with the BricsCAD V21 product family.

19 martie 2024 9 min

Ce este nou în BricsCAD® V24.2

BricsCAD® V24.2 este plin de caracteristici noi și îmbunătățite pentru desenul 2D, modelarea 3D, civil, topografie, BIM și fluxuri de lucru mecanice. Cu această versiune, echipa Bricsys a inclus mai multe caracteristici noi și îmbunătățiri pentru a vă ajuta să accelerați timpul de livrare și pentru a vă oferi o experiență CAD familiară. Așadar, haideți să ne aruncăm și să explorăm noutățile din BricsCAD V24.2!

10 martie 2024 6 min

Calea către automatizarea Scan to BIM cu BricsCAD® BIM V24

Noile instrumente de automatizare incluse în BricsCAD® BIM V24 fac procesul Scanare-către-BIM mai ușor și mai eficient! Dacă doriți o captură rapidă și precisă a realității obiectelor existente, aceste instrumente vor fi o completare excelentă a arsenalului dumneavoastră. Am adăugat instrumente precum Clasificator Nor Puncte, Detectare Camere Nor Puncte, Potrivire Camere Nor Puncte și Calcul Normal pentru norii de puncte structurați, pentru a vă ajuta să creați gemeni digitali pentru preluarea cantităților, să creați planuri de construcție precise și pentru gestionarea instalațiilor.

3 martie 2024 7 min

Desenați managementul sănătății cu BricsCAD® V24

Când lucrați la un model 3D, este esențial să vă asigurați că modelele dvs. sunt optimizate pentru performanță și eficiență mai bune! Acest lucru este ușor de realizat cu ajutorul instrumentelor de gestionare a stării de sănătate a desenelor din BricsCAD. Citiți mai departe pentru a afla cum puteți optimiza modelele 3D de mari dimensiuni și reduce dimensiunea fișierelor în BricsCAD V24.

Urmărește-ne pe rețelele sociale