AutoCADLT: Keyboard shortcut to rotate object around itself by 90 degrees

AutoCADLT: Keyboard shortcut to rotate object around itself by 90 degrees

winthrop_david
Explorer Explorer
1,363 Views
5 Replies
Message 1 of 6

AutoCADLT: Keyboard shortcut to rotate object around itself by 90 degrees

winthrop_david
Explorer
Explorer

I have recently switched from using BricsCAD to AutoCAD LT and I am running into issues converting over some of my custom keyboard shortcuts. In BricsCAD I had a custom shortcut to rotate an object around itself, I made three macros for 90 degrees clockwise, 90 counter clockwise and 180 degrees.

 

The behavior of shortcut was: select object (or grouping of lines), click the macro, then the object would rotate around it's centerpoint (like a pinwheel)

 

The macro appeared like:
[code]^c^c^p(command "_rotate" (ssget) "" "_non" (trans (apply 'acet-geom-mid-point (vle-getboundingbox (ssget "_P"))) 0 1) 90.0)(princ)^p[/code]

 

 

 

 

 

[ The subject line of this post has been edited for clarity by @pendean Original: Keyboard shortcut to rotate object around itself by 90 degrees ]

0 Likes
1,364 Views
5 Replies
Replies (5)
Message 2 of 6

pendean
Community Legend
Community Legend



@winthrop_david wrote:

... ^c^c^p(command "_rotate" (ssget) "" "_non" (trans (apply 'acet-geom-mid-point (vle-getboundingbox (ssget "_P"))) 0 1) 90.0)(princ)^p ...


Looks like your code get stuck here, is that what you see? Screenshot is from AutoCAD, LT2024 does the same

pendean_0-1705956678259.png

 

 

 

 

 

 

0 Likes
Message 3 of 6

winthrop_david
Explorer
Explorer

Yes it is, the coding must be different within AutoCAD, maybe there is an different way to have three marcos to rotate an object around it's center point (which is what the vle-getboundingbox) is doing.

0 Likes
Message 4 of 6

Kent1Cooper
Consultant
Consultant

@winthrop_david wrote:

.... select object (or grouping of lines), ....


Not only should that e be an a, but also, you can't take the bounding box of a selection set.  It has to be an individual object, in VLA object conversion from its entity name.  There are routines around to get the collective bounding box of multiple objects [for example DrawBoundingBoxMult.lsp >here< knows how to do it, though it draws the collective bounding box, which you wouldn't need].  You would need to do that before trying to extract a midpoint from that result.

Kent Cooper, AIA
0 Likes
Message 5 of 6

ВeekeeCZ
Consultant
Consultant

Found this...

While it allows the selection of multiple objects it rotates them around their individual center points.

0 Likes
Message 6 of 6

Kent1Cooper
Consultant
Consultant

@Kent1Cooper wrote:

....  There are routines around to get the collective bounding box of multiple objects [for example DrawBoundingBoxMult.lsp >here< knows how to do it, ....  You would need to do that before trying to extract a midpoint from that result.


For example, try the attached SpinMult.lsp modified from that routine.  It has a you-specify-the-rotation-angle command, and three commands pre-defined for the orthogonal angles.  See the comments at the top of the file, and the prompt it puts in at the command line when loaded.

Kent Cooper, AIA