TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: velasquez on February 13, 2016, 01:35:58 PM
-
Where is stored the angle of the rotate command?
Specify base point: _MID of
Specify rotation angle or [Copy / Reference] <45>:
-
in the LASTANGLE variable.
-
in the LASTANGLE variable.
Thanks for the help HMSP
But the variable LASTANGLE does not store the last angle to rotate command.
I posted the Results below.
Command: _rotate
Current positive angle in UCS: ANGDIR=counterclockwise ANGBASE=0
Select objects: 1 found
Select objects:
Specify base point: _mid of
Specify rotation angle or [Copy/Reference] <0>: 90
Command: (getvar "lastangle")
0.0
-
As you already have correct assumption, that value is built-in into ROTATE command and can't be extracted lightly... Perhaps, try this lisp to try to overcome this issue :
(defun c:rot
-ang
( / ss o ow a str ch el
) (progn (prompt "\nSelect object(s) for rotation on unlocked layer(s)...") t
) (setq o
(getpoint "\nPick or specify base point for rotation : ")) )
(setq ch
(getkword "\nChoose an option [Copy/Reference] <classic rotate> : ")) (command "_.COPY" ss
"" "_non" '
(0.0 0.0 0.0) "_non" '
(0.0 0.0 0.0)) )
(setq *a
* (acet
-ss
-drag
-rotate ss o
"\nPick or specify angle for rotation : " t
)) )
(setq a
(getangle o
"\nPick or specify reference angle : ")) (setq *a
* (acet
-ss
-drag
-rotate ss
(trans ow
0 1) "\nPick or specify angle for rotation : " t
)) )
( t
(setq *a
* (acet
-ss
-drag
-rotate ss o
"\nPick or specify angle for rotation : " t
)) )
)
)
)
(command "_.ROTATE" ss
"" "_non" o a
) )
)
(setq ch
(getkword "\nSave last specified angle as global variable *a* [Yes/No] <No> : ")) )
)
(prompt "\nInvalid input specifications... Restart routine with correct specifications next time again...") )
)
Regards,
HTH, M.R.
-
As you already have correct assumption, that value is built-in into ROTATE command and can't be extracted lightly... Perhaps, try this lisp to try to overcome this issue :
Regards,
HTH, M.R.
Thank you ribarm,
Your code works well.
I seek a simple method
I already have a pre-selected block and the base point.
What I did was rotate the block to 0 degrees and then recall the command "_.rotate" and allow the user to press ENTER to 0 degrees, simulating rotating command option "_.insert"
Specify rotation angle <0 >: