Hi friends, in this article I will explain
about the Rotate command in the
AutoLISP or AutoCAD, how to use the Rotate
command in AutoCAD, how to write the code for Rotate in AutoLISP.
First we know about, how to use Rotate in AutoCAD.
Command:
rotate
Select
objects: 1 found
Select
objects:
Specify
base point:
Specify
rotation angle or [Copy/Reference] <90>:
|
- Then the selected object rotates to the 90 degrees.
The below figure shows clearly how to object was rotated.
- Open AutoLISP Editor,Write the below code or Simply Copy and Paste the below code.
(defun
c:rot()
(setq
p1(getpoint "\n Pick First Point of the line")
p2(getpoint
"\n Pick Second Point of the line")
)
(command
"line" p1 p2
"")(setq s(entlast))
(command
"rotate" s "" p1 "90" "")
)
|
- In the above code (setq s(entlast)) is the line because it store the object.
- Save the code as rot.lsp. Open AutoCAD and type the below commands.
(load "rot")
C:ROT
Command: rot
Pick First Point of the line
Pick Second Point of the line
|
Thank you for reading my blog AutoLISp-Roja..If you like my blog please like the facebook page AutoLISPRoja
No comments:
Post a Comment