검색

2D 도면 3D 모델링 BIM Mechanical

CAD Managers’ Corner – LISP Concepts for Easy Migration

By The Bricsys Team 7 min 2019년 10월 7일
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:

X:\LISP\STANDARDS.LSP

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”)
(princ)
)

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 ()
(command “LAYERSPANELOPEN”)
(princ)
)

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”)
(princ)
)

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 www.bricsys.com. 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.

2024년 11월 6일 4 min

On-site document management made easy with Bricsys® 24/7 & LB Aproplan

The construction industry faces several challenges regarding document management. To deliver projects on time and within budget, project managers must easily maintain document version control, manage user access to documents, and streamline approval processes. Poor document management inevitably leads to complications, delays, efficiency loss and increased costs down the line.

2024년 9월 17일 3 min

브릭스캐드에서 선 유형 사용자 지정

BricsCAD에서 사용자 지정 선 유형을 만들면 도면의 디테일과 선명도를 크게 향상시킬 수 있습니다. 복잡한 엔지니어링 계획이든 단순한 레이아웃 디자인이든, 자신만의 라인 유형을 만드는 방법을 이해하면 프로젝트에 전문성을 부여할 수 있습니다. 이 단계별 가이드를 따라 BricsCAD에서 간단한 선 유형과 복잡한 선 유형을 만드는 방법을 배우세요.

2024년 9월 10일 2 min

토목 및 측량 워크플로우를 위한 BricsCAD 파트너 앱

브릭시스는 전문 측량 및 토목 앱 개발자가 BricsCAD 사용자에게 강력하고 효율적인 워크플로우를 제공하는 전문 토목 및 측량 도구를 개발할 수 있도록 탄탄한 기반을 제공합니다. 다양한 개발자 파트너가 BricsCAD V24의 토목 및 측량 워크플로우를 보완하기 위해 어떤 업데이트와 개선 사항을 적용했는지 살펴보세요.

이러한 토목 및 측량 애플리케이션은 BricsCAD에서 지원하는 여러 타사 애플리케이션 중 하나이며, 개발자들은 기능을 개선하고 매 릴리스마다 도입되는 새로운 기능에 발맞추기 위해 노력하고 있습니다.

소셜 미디어에서 팔로우하기