They don't teach lisp routines in high school autocad classes! Imagine that. Otherwise the rest of my Autocad knowledge has been self and experience taught. Share this post. Link to post Share on other sites. Lee Mac 85 Lee Mac. Learning the art of LISP commands Language. This will create a Line from your specified points in GA and command is still in use to draw line with next point. If you want to stop this line command at this point then change command line code as below (command “Line” p q “”) This will create a line and returns value as Nil. Now we will store this program in our list file. ![]() I want to create a simple 'rotate' command with AutoLisp, so this is the code I wrote: (defun C:myfunc() (setq p1 (getpoint ' nPick first POINT on the screen: n')) (setq p2 (getpoint ' nPick second POINT on the screen: n')) (command 'line' p1 p2 ') (setq ss1 (ssget p2)) (command 'rotate' ss1 p2 '90' ') (princ ) ) I insert two points, p1 and p2 and create a line which connects them. After that I create the ss1 object which is the line p1-p2. Finally I attempt to rotate the line from base point p2 for 90 degrees. I insert the code in AutoCad, but instead of creating the rotated line, it asks to insert manually the base point as well as the angle, so I guess that there is a problem with the command 'rotate'. Any suggestions would be appreciated. From what I've seen online, you have two problems. ROTATE does not take a selection set but an entity name Missing an extra ' before the rotation point. ![]() (defun C:myfunc() (setq p1 (getpoint ' nPick first POINT on the screen: n')) (setq p2 (getpoint ' nPick second POINT on the screen: n')) (command 'line' p1 p2 ') (setq ss1 (ssget p2)) (command 'rotate' (entlast) ' p2 '90') (princ ) ) Reference: As a side note, it usually helps me to try the command manually to make sure you are responding to all the correct prompts with the correct data/values. Crack software downloads. Note: AutoCAD for Mac does not support Managed.NET applications. The command and command-s functions allow you to start and pass values to an AutoCAD command. The command and command-s functions have a variable-length argument list. The first argument of these functions must be the command you want to execute. All other arguments must correspond to the types and values expected by that command's prompt sequence; these may be strings, real values, integers, points, entity names, or selection set names. Data such as angles, distances, and points can be passed either as strings or as the values themselves (as integer or real values, or as point lists). An empty string ( ') is equivalent to pressing the Spacebar or Enter on the keyboard. The command-s function is faster and more efficient than the command function, but the command being executed within the command-s function must be completed within the same statement. This means that an argument must be provided for each of the command’s prompts, and that it cannot execute any more AutoLISP statements until the function has completed.
0 Comments
Leave a Reply. |