Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Where is last rotation angle stored?

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
357 Views, 8 Replies

Where is last rotation angle stored?

Hi everyone,

I was layed off at the end of October and so i was out of touch. But...i'm
ba-a-a-a-a-ck.

I am using *command* in a lisp routine to *rotate* a selection set. After
this is complete, i want to know how much the user rotated the set. I looked
for a sysvar like *distance* that stores the last value from the *distance*
command but there is no *rotate*.

Is there something or someway to determine how much the user rotated the
selection set?

Thanks

Sal
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

Welcome back, Sal.

I think you are after LASTANGLE.

-Jason


"Sal Brusco" wrote in message
news:9BCBA0C6B7BD4BF81117EB067A2BBD89@in.WebX.maYIadrTaRb...
> Hi everyone,
>
> I was layed off at the end of October and so i was out of touch. But...i'm
> ba-a-a-a-a-ck.
>
> I am using *command* in a lisp routine to *rotate* a selection set. After
> this is complete, i want to know how much the user rotated the set. I
looked
> for a sysvar like *distance* that stores the last value from the
*distance*
> command but there is no *rotate*.
>
> Is there something or someway to determine how much the user rotated the
> selection set?
>
> Thanks
>
> Sal
>
>
Message 3 of 9
Anonymous
in reply to: Anonymous

Hi Jason,

According to my notes, LASTANGLE:

Stores the end angle of the last arc entered relative to the XY plane of the
current UCS for the current space.

I haven't tested your theory yet but is the end angle of the last arc the
same as the last rotation angle? It doesn't sound like it.

Sal

Jason Piercey wrote in message
<55CCDF3713EB162FEE49DD40FE041A1E@in.WebX.maYIadrTaRb>...
>Welcome back, Sal.
>
>I think you are after LASTANGLE.
>
>-
Message 4 of 9
Anonymous
in reply to: Anonymous

I started a new drawing, inspected LASTANGLE (it was 0), drew a line,
rotated it 90, inspected LASTANGLE (it was 90).

-Jason


"Sal Brusco" wrote in message
news:5778043734C1A274FB3574E71777F7C4@in.WebX.maYIadrTaRb...
> Hi Jason,
>
> According to my notes, LASTANGLE:
>
> Stores the end angle of the last arc entered relative to the XY plane of
the
> current UCS for the current space.
>
> I haven't tested your theory yet but is the end angle of the last arc the
> same as the last rotation angle? It doesn't sound like it.
>
> Sal
>
> Jason Piercey wrote in message
> <55CCDF3713EB162FEE49DD40FE041A1E@in.WebX.maYIadrTaRb>...
> >Welcome back, Sal.
> >
> >I think you are after LASTANGLE.
> >
> >-
>
>
Message 5 of 9
Anonymous
in reply to: Anonymous

However, the help files do agree with what you are telling me.

-Jason
Message 6 of 9
Anonymous
in reply to: Anonymous

Hi Jason,

I did what you did and got the same results. But then i tried it again with
a different rotation and got the same 90. So i drew another line and tried
again and with another new line and rotated it and got 0.

When i try drawing an arc with:

Command: a ARC Specify start point of arc or [Center]: c

Specify center point of arc: 0,0

Specify start point of arc: 3,0

Specify end point of arc or [Angle/chord Length]: a
Specify included angle: 45

Command: lastangle

LASTANGLE = 135 (read only)

This clearly should have shown 45 degrees, according to the help files. I
don't know what is going on.

FYI: I have Win98 and AutoCAD Mechanical 2000i (not Mechanical Desktop)

Thanks for your continued assistance.
Sal



Jason Piercey wrote in message
<109C4A072C53CEC69B9847174F344475@in.WebX.maYIadrTaRb>...
>I started a new drawing, inspected LASTANGLE (it was 0), drew a line,
>rotated it 90, inspected LASTANGLE (it was 90).
>
>-Jason
Message 7 of 9
Anonymous
in reply to: Anonymous

Sal,

Since seems to be no saved rotation angle, you could redefine the rotation command to add a global variable of your own.

Doug

"Sal Brusco" wrote in message news:9BCBA0C6B7BD4BF81117EB067A2BBD89@in.WebX.maYIadrTaRb...
>
> Is there something or someway to determine how much the user rotated the
> selection set?
>
Message 8 of 9
Anonymous
in reply to: Anonymous

"Sal Brusco" wrote in message
news:9BCBA0C6B7BD4BF81117EB067A2BBD89@in.WebX.maYIadrTaRb...
> Hi everyone,
>
> I am using *command* in a lisp routine to *rotate* a selection set. After
> this is complete, i want to know how much the user rotated the set. I
looked
> for a sysvar like *distance* that stores the last value from the
*distance*
> command but there is no *rotate*.
>
> Is there something or someway to determine how much the user rotated the
> selection set?

Not in the box, but after seeing your request I realized
that it would be a simple matter to add this sort of
functionality to the InputManager class in my AcadX ActiveX
server (see www.caddzone.com/acadx/acadx.htm).

So, as of today, AcadXInputManager has the following new
read-only properties (which should be self-explainatory
with the exception of LastDisplacement, which is the
displacement of the last MOVE/COPY/STRETCH operation):

LastDisplacement
LastDistance
LastRotation
LastOrientation

These were also declared, but
are not hooked up yet:

LastColor
LastCorner
LastEntity
LastInteger
LastKeyword
LastPoint
LastReal
LastScaleFactor
LastString
LastSubEntity


A quick demo:
-------------------------------------------------------
Command: (setq acad (vlax-get-acad-object))
#

Command: (setq iman (vla-getInterfaceObject acad "AcadX.InputManager"))
#

Command: .ROTATE

Current positive angle in UCS: ANGDIR=counterclockwise ANGBASE=0
Select objects: LAST
1 found
Select objects:
Specify base point: 0,0
Specify rotation angle or [Reference]: 45
Command: (setq ang (vlax-get-property iman 'LastRotation))
0.785398
Command: (angtos ang)
"45"
Command:
----------------------------------------------------------
Message 9 of 9
Anonymous
in reply to: Anonymous

Very impressive! Thanks Tony.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost