Jump to content

Change Rotation of Dim Text


Abrasive

Recommended Posts

Has anyone written a routine to rotate the dimension text by a given degree?

I looked but didn't find anything.

If the dim text is at 0, I would like to be able to just click on the dim and have the text rotate a given degree.

It can ask for a degree or rotate in increments.

I'm not sure how to even start...

Thanks in advance!

Link to comment
Share on other sites

"rotate in increments" there is various ways to do this, you can read say up and down arrows, press enter goes say 10 deg and so on. Do a google, I think the arrow stuff is by Lee-mac.

Link to comment
Share on other sites

37 minutes ago, BIGAL said:

"rotate in increments" there is various ways to do this, you can read say up and down arrows, press enter goes say 10 deg and so on. Do a google, I think the arrow stuff is by Lee-mac.

The more I think about it, If it just asks me for the degree I can enter it.

Looking for a shortcut way instead of opening properties panel and editing it.

I found these two examples and tried to modify them .... but I broke it....lol

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-put-textrotation-syntax/td-p/1684381

 

 

Link to comment
Share on other sites

Something like this. I did not check if its degrees or radians input  that is your homework.

 

(setq obj (vlax-ename->vla-object (car  (nentsel "\nPick dimension text "))))
(VLA-PUT-ROTATION OBJ (getreal "\nEnter text angle" ))
(command "regen")

 

Edited by BIGAL
  • Like 1
Link to comment
Share on other sites

On 3/7/2023 at 7:51 PM, Abrasive said:

The more I think about it, If it just asks me for the degree I can enter it.

Looking for a shortcut way instead of opening properties panel and editing it.

I found these two examples and tried to modify them .... but I broke it....lol

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-put-textrotation-syntax/td-p/1684381

 

 

 

 

 

 Do you mean some like it 

\

 

image.thumb.png.693568e122e2e3ce22db2a6b6854bc14.png

Link to comment
Share on other sites

Alan J. Thompson (alanjt) lisp allows user to set the rotation of multiple blocks, mtext, multileaders and text to match the angle of any selected (nested allowed) curve (c3d feature lines and alignments, line, arc, ellipse, *polyline, circle, etc.), block/mtext/multileader/text, a zero rotation (relative to current UCS) or a picked/specified angle.

For curves with arcs, the angle extraction will be taken at the location on the curve closest to the user's selection on said curve.

Rotated objects' angle will be readable, but the user will also be given one last chance to rotate them 90°, 180°, 270°.

Also, if the users has the Express Tool acet-sys-shift-down loaded, they will be given the option to hold the shift key down when they select their object for rotation extraction for nested selected, rather than having to switch from primary to nested selection. https://www.theswamp.org/index.php?topic=40450.0

 

In the attached slight modification of his code I added DIMENSION as a type and duplicated the "AcDbMLeader" cond changing it to "AcDbAlignedDimension" to align Dimension Text, then added HATCH modifying PatternAngle of "AcDbHatch" as well.

RotateObjects.LSP

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...