Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Any way in Autocad 2008-2012 to set a rotation angle for mtext? (and have it repeat the angle)

  1. #1
    100 Club
    Join Date
    2006-12
    Posts
    106
    Login to Give a bone
    0

    Default Any way in Autocad 2008-2012 to set a rotation angle for mtext? (and have it repeat the angle)

    I'd like to have MTEXT work like single-line text in some ways. Single line rotation stays where you set it until you change it or end the session. Multi-line does not. Even if you use the -MTEXT option, the rotation goes back to zero after the command terminates. Also, with the -MTEXT option, the on-screen editor disappears in favor of the command line while you type your text. This is annoying.

    Anybody know if there's a workaround or some kind of variable that can be set to hold the rotation angle for as long as it's needed?

  2. #2
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Any way in Autocad 2008-2012 to set a rotation angle for mtext? (and have it repeat the angle)

    You could create a rotated UCS.

  3. #3
    AUGI Addict jpaulsen's Avatar
    Join Date
    2002-04
    Location
    Colorado
    Posts
    2,020
    Login to Give a bone
    0

    Default Re: Any way in Autocad 2008-2012 to set a rotation angle for mtext? (and have it repeat the angle)

    I haven't found a way to set the MTEXT rotation and get it to stick. If I need MTEXT at a specific angle I either set my UCS to that angle or make one MTEXT and copy it.

  4. #4
    100 Club
    Join Date
    2005-12
    Location
    Greeley, CO
    Posts
    116
    Login to Give a bone
    0

    Default Re: Any way in Autocad 2008-2012 to set a rotation angle for mtext? (and have it repeat the angle)

    I would create a button macro. This one ^C^CMText;\J;MC;R;\W;0;CHPROP;Last;;c;white;; start mtext, lets user set the insertion point, sets justification to middle center, allows user to set desired rotation, sets widt to zero, and changes it to white after I m done typing my text. You probably don't need the last bit tha changes it to white but it could look something like this:
    ^C^CMText;\J;MC;R;45;W;0;
    This will create a middle center justified mtext rotated 45° with a width of zero.

  5. #5
    100 Club
    Join Date
    2006-12
    Posts
    106
    Login to Give a bone
    0

    Default Re: Any way in Autocad 2008-2012 to set a rotation angle for mtext? (and have it repeat the angle)

    I wish the UCS thing would work well for me, but using this particular project as an example, I have 64 roadway segments (very curvy road) that have a total of 58 different orientations (so that they will fit stacked two per sheet in the layouts). That's 58 different UCS's for me to create and wrangle on this one job.

    Perhaps I will try building an on-screen button menu with a macro for each orientation, similar to that suggested. Then I'll put a big defpoints label in each roadway segment, so that I can keep track in model space of what each rotation needs to be as I move between segments.

    Sound like a plan?

  6. #6
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Any way in Autocad 2008-2012 to set a rotation angle for mtext? (and have it repeat the angle)

    Quote Originally Posted by crbateman View Post
    I wish the UCS thing would work well for me, but using this particular project as an example, I have 64 roadway segments (very curvy road) that have a total of 58 different orientations (so that they will fit stacked two per sheet in the layouts). That's 58 different UCS's for me to create and wrangle on this one job.

    Perhaps I will try building an on-screen button menu with a macro for each orientation, similar to that suggested. Then I'll put a big defpoints label in each roadway segment, so that I can keep track in model space of what each rotation needs to be as I move between segments.

    Sound like a plan?
    Yes, but create a non-plotting layer for your labels - defpoints is best avoided.

  7. #7
    Member
    Join Date
    2011-01
    Location
    San Fran
    Posts
    36
    Login to Give a bone
    0

    Default Re: Any way in Autocad 2008-2012 to set a rotation angle for mtext? (and have it repeat the angle)

    Quote Originally Posted by crbateman View Post
    I wish the UCS thing would work well for me, but using this particular project as an example, I have 64 roadway segments (very curvy road) that have a total of 58 different orientations (so that they will fit stacked two per sheet in the layouts). That's 58 different UCS's for me to create and wrangle on this one job.

    Perhaps I will try building an on-screen button menu with a macro for each orientation, similar to that suggested. Then I'll put a big defpoints label in each roadway segment, so that I can keep track in model space of what each rotation needs to be as I move between segments.

    Sound like a plan?
    Use UCS, Object, select object. The UCS will be rotated and ready for the text. Create a simple lisp routine or macro for a toolbar so you just type UO and pick the object.

    ucs object \.mtext \J bc
    Last edited by osnapendp407315; 2011-06-24 at 03:05 PM.

  8. #8
    All AUGI, all the time arshiel88's Avatar
    Join Date
    2005-02
    Location
    Off the Grid
    Posts
    560
    Login to Give a bone
    0

    Default Re: Any way in Autocad 2008-2012 to set a rotation angle for mtext? (and have it repeat the angle)

    I've been using this simple routine to align text or mText such as road labels to the road's orientation.

    Code:
    Sub ALine()
    
    Dim retTxtObj As AcadObject
    Dim RetLineObj As AcadObject
    On Error Resume Next
        ThisDrawing.Utility.GetEntity retTxtObj, basePnt, vbCrLf & "Select Text/MText or Block to Align..."
        ThisDrawing.Utility.GetEntity RetLineObj, basePnt, "Select Line/Block Object to align from..."
    
    retTxtObj.Rotation = RetLineObj.Angle
    retTxtObj.Rotation = RetLineObj.Rotation
     
    End Sub

  9. #9
    100 Club
    Join Date
    2006-12
    Posts
    106
    Login to Give a bone
    0

    Default Re: Any way in Autocad 2008-2012 to set a rotation angle for mtext? (and have it repeat the angle)

    Quote Originally Posted by arshiel88 View Post
    I've been using this simple routine to align text or mText such as road labels to the road's orientation.

    Code:
    Sub ALine()
    
    Dim retTxtObj As AcadObject
    Dim RetLineObj As AcadObject
    On Error Resume Next
        ThisDrawing.Utility.GetEntity retTxtObj, basePnt, vbCrLf & "Select Text/MText or Block to Align..."
        ThisDrawing.Utility.GetEntity RetLineObj, basePnt, "Select Line/Block Object to align from..."
    
    retTxtObj.Rotation = RetLineObj.Angle
    retTxtObj.Rotation = RetLineObj.Rotation
     
    End Sub
    I'm ashamed to say that my knowledge of code does not go beyond that of simple Lisps, so I do not know where or how to load and run your code. But I would like to try it, so could you he'p me out a little? I assume it is a VBA routine, but beyond having added VBA compatibility to my Autocad 2011 install, I don't know how to proceed. How do I turn your raw code into a VBA routine? How do I load it? (Does it stay loaded from drawing to drawing, or do I load it every time?) How do I start the routine once in a drawing?

    Sorry to be so noob-like...
    Last edited by crbateman; 2011-06-25 at 05:02 PM.

  10. #10
    All AUGI, all the time arshiel88's Avatar
    Join Date
    2005-02
    Location
    Off the Grid
    Posts
    560
    Login to Give a bone
    0

    Default Re: Any way in Autocad 2008-2012 to set a rotation angle for mtext? (and have it repeat the angle)

    I attached the sample file "myRoutines.dvb".

    vba projects are loaded via vbaload command.
    vbarun to select the available macros/routines.

    It does not autoload unless the file is "acad.dvb" and is loacated in one of the support files search paths.

    I find putting the macro in a toolbar button/keyboard shortcut the most convenient since you don't need to bother loading the project, it will load by demand as long as it is in the support files search paths.

    The macro of the sample routine will be something like this

    ^C^C-vbarun;myRoutines.dvb!ThisDrawing.ALine;
    Attached Files Attached Files

Page 1 of 2 12 LastLast

Similar Threads

  1. 2012: Viewport Rotation Angle
    By dmingo in forum AutoCAD General
    Replies: 6
    Last Post: 2013-04-11, 06:44 PM
  2. 2012: AUTOCAD CIVIL 3D 2012 MULTI LEADER TEXT ANGLE
    By ryager in forum AutoCAD Annotation
    Replies: 0
    Last Post: 2012-04-25, 04:10 PM
  3. Angle de rotation
    By tmuche in forum Revit Architecture - General
    Replies: 1
    Last Post: 2010-02-18, 12:09 PM
  4. AutoCAD 2007 - Set DText default rotation angle back to 0
    By justinsweet in forum AutoCAD General
    Replies: 2
    Last Post: 2006-10-10, 04:20 AM
  5. How to add a rotation angle?
    By patricks in forum Revit Architecture - Families
    Replies: 17
    Last Post: 2006-05-03, 08:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •