Autocad lisp track moved point1/28/2024 ![]() ![]() Instead of setting so many variables, you could also create the following two statements in place of the X1, X2, Y1, Y2 and the two PT3 and PT4 settings:.(command “ pline” PT1 PT3 PT2 PT4 “close”) (setq PT1 (getpoint “\n Enter first corner of box: ”)) The LISP routine will then calculate the coordinates of the other two corners and draw a box. This time we will have the user specify the diagonal corners of a rectangular box. Thus (cadddr) would return the fourth element of a list.Įxample: Improving on our BOX1.LSP Routine Each “d” goes one item deeper into the list. You can continue to return the next item in a list by adding a “d” to the (caddr) function.The others, (cadr), (caddr) and (last) can also help you make new lists from existing ones. Two key functions, (car) and (cdr), are the essential tools in extracting elements from a list. To do this you would need the x coordinate of one point and the y coordinate of the other, and then do a bit of math. For example, you may want to get a point midway between two other points. ![]() There are times when you will want to create a list from other lists. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |