Simple coords 1.7.10
You will never find the z- coordinate first or the x-coordinate last. Spaces separate the numbers, which are the x, y, and z-coordinates, respectively:īricsCAD always stores the values in the order of x, y, and z. This isĬalled a list, for which LISP is famous (indeed, LISP is short for “list processing”). Notice how the coordinates are surrounded by parenthesis. And “ LastPoint” is the name of the system variable it is surrounded by quotation marks because it is a system variable name (a string).Īfter entering the LISP function, BricsCAD returns the value it stored in variable xyz, such as (8.9227 6.5907Ġ.0000) - your result will be different.Getvar is the name of the LISP function that retrieves the value stored in a system variable.
Xyz is the name of the variable in which you store the x,y,z-coordinate.Recall from in this chapter that the setq function stores values in variables. You need to do this because the coordinates in LastPoint are overwritten with the next use of a command that makes use of a picked point. So, you should copy the coordinates from LastPoint to a variable of your own making. Unknown to you, BricsCAD always stores the x,y,z-coordinates of the last-picked point in a system variable called LastPoint.Select a point to identify coordinates: (Pick a point.) In response to the LISP routine’s prompt, pick a point:.Just as before, BricsCAD prompts you for the point. The BricsCAD command is in quotation marks “ID” because the command is a string (programmer-talk for “text”). Here you are executing a BricsCAD command (Id) from within a LISP routine. Start BricsCAD, load a drawing, and switch to the Prompt History window with F2.By experimenting, you make mistakes and then learn from the mistakes.
It would be a useful lesson to use each of the three and then see what happens. Use the getpoint function, as in (getpoint “Pick a point: “).Use the LastPoint system variable with the getvar function, as in (getvar “lastpoint”).Use the Id command with the command function, as in (command “ID”).Browsing through the LISP Programming Language Reference, you learn you could: LISP provides several ways to get the coordinates of a picked point. Place the coordinates as text in the drawing. Obtain the coordinates from the drawing, probably by picking a point. Recognize that there are two parts to solving the problem: THE PLAN OF ATTACKīefore you write any LISP code, you need to figure out how you’re going to get those x,y,z-coordinates off the command prompt area and into the drawing. Wouldn’t it be great if you could change Id so that it places the coordinates in the drawing, next to the pick point? That would let you label x,y-coordinates and z-elevations over a site plan. : id Select a point to identify coordinates: (Pick a point.) X = 8.9227 Y = 6.5907 Z = 0.0000 Problem is, Id reports the value in the command prompt area, like this: When you pick a point on the screen, Id reports the 3D x,y,z- coordinates of the point. Here’s the example we’ll use for this tutorial: The Id CommandīricsCAD has the Id command. And you can use it for really simple but tedious tasks. The nice thing about LISP is that you can program it on the fly.
#SIMPLE COORDS 1.7.10 CODE#
Learning some LISP programming now means you’ll feel really good whipping off a few lines of code to let LISP perform tedious tasks for you. Sitting in the classroom sometimes seems like a waste of time.īut the things you learn now make life easier later. No doubt, you may be wondering, “Why bother learning a programming language?” In some ways, it’s like being back again in school.
#SIMPLE COORDS 1.7.10 HOW TO#
If you are like many CAD users, you are busy creating drawings and you have no time to learn how to write software programs.
#SIMPLE COORDS 1.7.10 FULL#
In this post, learn the first steps needed to write a LISP routine of your own.įor a full overview of LISP commands for BricsCAD, you can view the official, BricsCAD LISP Developer Guide. In this post, we look at the most powerful method available to “non-programmers” for customizing BricsCAD - the LISP programming language.