You are browsing the archive for autocad commands.

How to Load an AutoLISP File

September 4, 2009 in AutoCAD, CAD


If you’re using AutoCAD for long period of time and you know how to use the AutoLISP and the importance of it. You probably know how to load the AutoLISP file in AutoCAD, and you certainly don’t need to read this tutorial. But if happens that you are relatively new on using the AutoCAD and you want to expand your knowledge in this drawing application software, then this tutorial is for you.

AutoLISP a Brief Description

AutoLISP is based on the LISP programming language, which is simple to learn and very usefull in everyway. AutoLISP Applications or routines can interact in AutoCAD in many ways. These routines can prompt the user for input, access built-in AutoCAD commands directly, and modify or create objects in the drawing database. By creating AutoLISP routines you can add discipline-specific commands to AutoCAD. Actually, some of the standard AutoCAD commands are AutoLISP applications. Knowing how to load and use these routines can enhance your productivity.

Loading the AutoLISP

There are two methods to load an AutoLISP file, one is loading it by using the Customize User Interface editor or CUI, the other is by using the command Load Application or simply APPLOAD. Customize User Interface editor can be found by clicking the CAD Manager pulldown menu, then Customize, then Interface (fig.1).

Fig.1Fig.1

Alternatively at the command prompt, key-in CUI. Then in the Customize Interface editor tab, in the Customizations in all CUI files pane, right-click LISP files, then click Load LISP. Then in the Load LISP dialog box, locate and select the AutoLISP file you want to load. Remember only files with the extension LSP can be selected here. After you selected the AutoLISP file that you want, click OPEN.

Fig.2Fig.2

Load Application or simply APPLOAD, using this command is the easiest method in loading an AutoLISP file. You can find this command under CAD Manager pulldown menu on the same place where the Customize User Interface can be found. Or at the command prompt key-in APPLOAD. The good thing in using this method is, not only the AutoLISP files can be loaded but also some other AutoCAD Application files as well. Such as ObjectARX files (arx), VBA files (dvb), ObjectDBX files (dvx), Visual Lisp Executables (vlx), and Fast-load AutoLISP Format (das) [Fig.3].

Fig.3Fig.3

More of this method here in this post Free AutoLISP Routine.

Related Posts

Source: PinoyCAD[dot]net | Your Daily dose of AutoCAD Tutorials – How to Load an AutoLISP File
Go to Source: PinoyCAD[dot]net | Your Daily dose of AutoCAD Tutorials

Creating New Command in AutoCAD

August 13, 2009 in AutoCAD, CAD, Revit

cui If I’m not mistaken, AutoCAD use CUI since 2006. Not MNU or MNS as it used to be. CUI (customize user interface) is a XML file. It’s easier to manage. In this post, I will create a new command to set all properties to ByLayer. This is a request from my colleague. He likes to override color and linetype when he draw, and want to be able to reset all of the properties back to ByLayer. By clicking my new command, every properties will be set to By Layer.

First you may want to take a look to what I want to achieve. Click here to see animation.

Let’s do it. First open CUI by accessing menu tools>customize>interface… or by typing CUI then [enter] from command line. You will see browser like this. If you use ribbon, find it in manage tab, customization section.

 cui browser

CUI browser is easier to use than creating old AutoCAD menu. There are 3 areas I would like to highlight

  1. All customization. Here is where you can put all your command. Either you want to put it in ribbon, tool bar, right click context menu, and even double click.
  2. Command list. Here is all your AutoCAD commands. When you create a new command, it will appear here.
  3. Properties. Here is your command properties. After creating new command, you will have to define what it should do.

Let’s start with creating a new command. Right click on command list (2), and select new command from context menu. Rename it. Give it name ‘All ByLayer’ without quote. You can see the animation here.

Now, we have created a command. But it doesn’t know what to do yet. We have to tell it what it should do by typing macro command in properties area (3). Type this macro on the macro field.

^C^C(setvar "cecolor" "ByLayer") (setvar "celweight" -1) (setvar "celtype" "ByLayer")

^C^C will cancel all running command. Similar to pressing [esc] twice. Then we tell AutoCAD to change current color to ByLayer. Then current lineweight to ByLayer, and finally current line type to ByLayer.

Give a description for this command.

We have created a new command, and give instruction what it should do when it’s executed. But AutoCAD doesn’t know yet, where you want the command can be accessed. Now find your command in command list. We named it ‘All ByLayer’ before.

Click and drag it to the place where you want it appear. In this example below, I put it on my layer toolbar. You can also put it on right click context menu (more about this later) or double click!

command position

Click OK on this CUI browser to finish our work. Now take a look on your layer toolbar (or anywhere you put it before). Is it there? Try it!

Not so hard right? Learning macro is one thing, but creating customization with CUI is a lot easier than MNU or MNS. Good luck!




Source: CAD Notes – Creating New Command in AutoCAD
Go to Source: CAD Notes

using Dimension Space

July 22, 2009 in AutoCAD, CAD

Dimension presentation is vital in a drawing, a drawing plans cannot be use if the dimension is not readable. Thats why it is important for us AutoCAD Drafters and Architects that we assure that, the dimensions are shown in a nice and in a readable way. But sometimes, in an unavoidable situation like rushing up yourself to finish your drawing and eventually making it to submission day. This is the time when your drawing presentation might suffer, specially the dimension presentation.

Goodthing, AutoCAD has this routine, that can automatically adjust existing parallel linear and angualr dimension in a drawing, so they are equally spaced or aligned at the dimension line with each other.

dim_space_toolbar

(fig.1)

This routine called, the Dimension Space, or DIMSPACE, you can find this routine at the Dimension Pulldown menu, Dimension Space, you can also find it at the dimension toolbar (fig.1). Alternatively, at the command prompt, type DIMSPACE, then ENTER, then select the dimensions you want to adjust. The dimension that to be selected must be linear or angular, of the same type (rotated or aligned), parallel or concentric to one another, and on the extension line of each other. See the example below (fig.2 and fig.3).

dim_space1

(fig.2)

dim_space2

(fig.3)

Random Posts

Source: PinoyCAD[dot]net | Your Daily dose of AutoCAD Tutorials – using Dimension Space
Go to Source: PinoyCAD[dot]net | Your Daily dose of AutoCAD Tutorials