In the following tutorial, you get a taste of the many different kinds of functions LISP offers you for manipulating numbers and words. LISP is so powerful that it can manipulate almost any aspect of the BricsCAD drawing. Horizontal distance between columns: !diaīricsCAD draws precisely the same seven circles, using the value 1.28571 stored in dia. Redo the Circle and Array commands, this time using variable dia, as follows:ĢPoint/3Point/RadTanTan/Arc/Multiple/: (Pick a point.)Įntities in set: 1 Select entities to array: (Press enter.) You make one variable equal another, as follows: But you also want to balance a descriptive name, such as diameter, with minimized typing, such as x. In fact, it is good to create variable names that reflect the content, such as the circle diameter calculated above. The only limitation is that you cannot use LISP function names, such as setq, T, and getint. You can make up any combination of characters to create variable names, such as pt1, diameter, and yvalue. The ! prefix (sometimes called "bang") is useful for reminding yourself of the value contained by a variable, in case you've forgotten, or are wondering what happened during the calculation. To prove to yourself that x contains the value of 1.28571, use BricsCAD's ! (exclamation) prefix, as follows: The x is known as a variable because it can have any value. From algebra class, you probably recall equations like 'x = 7 + 9' and 'x = 7 / 9'. Here, x remembers the result of the (/ 9.0 7.0) calculation. To save the result of a calculation, use the setq function together with a variable, as follows: To do this, employ the most common LISP function, known as setq. Just as the M-key on a calculator lets it remember the result of your calculation, LISP can be made to remember the results of all your calculations. In the above example, you used the (/ 9.0 7) equation twice: once in the Circle command and again in Array. Once again, you use LISP to specify the array spacing, which happens to equal the circle diameter. Horizontal distance between columns: 0.128571 Horizontal distance between columns: (/ 0.9 7) Number of rows in the array : (Press enter.) Now go on to the Array command, and draw the other six circles, as follows:Įntities in set: 1 Select entities to array: (Press enter.) You can use an appropriate LISP function anytime BricsCAD expects user input. Instead of typing the value for the diameter, enter the LISP equation, as follows:īricsCAD draws a circle with a diameter of 1.28571 inches. For example, you may need to draw a linear array of seven circles to fit in a 9" space.ĢPoint/3Point/RadTanTan/Arc/Multiple/ : (Pick a point.) Okay, so let's look at how to use LISP code for a practical purpose. While toolbar and menu macros are easy to write and edit, they limit your ability to control BricsCAD.įor a full overview of LISP commands for BricsCAD, you can view the official, BricsCAD LISP Developer Guide. In this post learn how to use LISP in BricsCAD with a practical example plus there is an overview of LISP functions at the bottom of the page. In this post, we look at the most powerful method available to "non-programmers" for customizing BricsCAD - the LISP programming language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |