See the top rated post in this thread. Click here

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

Thread: Change default value of MText line spacing

  1. #1
    Member
    Join Date
    2007-09
    Posts
    15
    Login to Give a bone
    0

    Default Change default value of MText line spacing

    Autocad's default for linespacing seems to be 1. I want it to be .9. I've used the variable TSPACEFAC, and set it to .9, and mtext simply ignores it and keeps the 1, meaning that I have to change it every single time.

    Can anyone tell me why Autocad is ignoring the TSPACEFAC setting, and what I can do about it?

    Thanks.

    Anne Coventry

  2. #2
    Super Moderator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,673
    Login to Give a bone
    0

    Default Re: Change default value of MText line spacing

    According to the documentation on this sysvar, it's not saved at all. Not in the registry, not in the DWG file.

    Use your AcadDoc.lsp file to set it at DWG load time.

    (setvar "TSPACEFAC" 0.9)

    Tested here in 2017, works.
    R.K. McSwain | CAD Panacea |

  3. #3
    Member
    Join Date
    2007-09
    Posts
    15
    Login to Give a bone
    0

    Default Re: Change default value of MText line spacing

    Thanks, but where do I fiind AcadDoc.lsp? I've searched my computer and it doesn't come up.

    I tried using setvar "tspacefac" 0.9 on the command line (instead of just typing tspacefac), and it sets it as .9, but as soon as I try to use it, properties default to 1 again. If I check on the tspacfac it tells me it IS set to 0.9.

    I am aware that it only works in the current drawing, and thought I could set up a little macro to run on each drawing when I open them, but it won't work in the first place.

  4. #4
    Super Moderator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,673
    Login to Give a bone
    0

    Default Re: Change default value of MText line spacing

    Acaddoc.lsp does not exist until you create it.

    I suggest creating a folder such as C:\CADSTUFF, then put Acaddoc.lsp in this folder, then add this folder to the TOP of your Support File Search Path.
    AutoCAD will find and load this file each time you load a drawing (new or existing), and it will set this setting in the process.

    What version of AutoCAD are you running?
    R.K. McSwain | CAD Panacea |

  5. #5
    Member
    Join Date
    2007-09
    Posts
    15
    Login to Give a bone
    0

    Default Re: Change default value of MText line spacing

    I wondered if one had to create it. I'm running 2016. But, as I say, my main problem is that the wretched thing won't work for me in the first place.

  6. #6
    Super Moderator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,673
    Login to Give a bone
    0

    Default Re: Change default value of MText line spacing

    I'm not sure what to tell you.

    I just tested this in 2016 here.

    I set TSPACEFAC to 0.9
    I run the MTEXT command.
    I create an MTEXT object.
    I select it, look in PROPS and the line space factor of the MTEXT object I just created = 0.9

    R.K. McSwain | CAD Panacea |

  7. #7
    Member
    Join Date
    2007-09
    Posts
    15
    Login to Give a bone
    0

    Default Re: Change default value of MText line spacing

    Thanks. All that's left to say is that I envy you. I have tried everything I can think of and it stubbornly refuses to change the line space factor in properties to match the TSPACEFAC I've set.

  8. #8
    Super Moderator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,673
    Login to Give a bone
    1

    Default Re: Change default value of MText line spacing

    I just wanted to make sure we were doing the same steps.

    So you have to go back in after the MTEXT is created and adjust the spacing then?

    You can use the following lisp code to change this setting, on multiple MTEXT objects

    Code:
    (defun c:foo ( / sset i ent obj)
      (setq sset (ssget '((0 . "MTEXT"))) i 0)
      (if sset
    	(repeat (sslength sset)
    	  (setq ent (ssname sset i))
    	  (setq obj (vlax-ename->vla-object ent))
    	  (vla-put-LineSpacingFactor obj 0.9)
    	  (setq i (1+ i))
    	)
       )
     (princ)
    )
    R.K. McSwain | CAD Panacea |

  9. #9
    Member
    Join Date
    2007-09
    Posts
    15
    Login to Give a bone
    0

    Default Re: Change default value of MText line spacing

    I will try out the lsp routine and let you know what happens.

    I know I have a weird way of doing things - I don't much like working with mtext, because I find the dialog box annoying. I usually start with simple text, and then convert it to mtext (txt2mtxt) if I want to change the widths of paragraphs, etc. A lot of the time it is very useful, but with autocad 12 I had a whole lot of lisp routines which did amazing things with text - swap text, copy text, rejustify text, word wrap, changing multiple text at once (like changing the style, width, height, line spacing, etc.) I got very used to that, and never had a need for mtext. Now I have to use mtext, and I find a lot of it annoying - that I can't change the style of multiple texts without using match properties, which gets irritating when you sometimes have text in a different direction, for instance. It mystifies me why, if I select all the text I want to change, the style option disappears from the properties box. I've tried (quick select, text, style, select), and nothing happens.

    All in all, with autocad 2016 I'm much slower than I was in 12 with my add on package of lisp routines. I'm trying to work with it, but everything requires two or three more steps than it used to, and I've been trying to get used to it for 8 months now. The line space issue is just one more irritation. I can get round it, but it's just something else that wastes my time.

  10. #10
    Member
    Join Date
    2007-09
    Posts
    15
    Login to Give a bone
    0

    Default Re: Change default value of MText line spacing

    Thank you so much - I've tested the routine and it works perfectly. I can add it to my routines that load at the beginning, and have it available in all my drawings, thanks.

    P.S.: why foo?

Page 1 of 2 12 LastLast

Similar Threads

  1. 2010: mtext line spacing
    By d.skornik355603 in forum AutoCAD General
    Replies: 3
    Last Post: 2013-03-06, 08:13 PM
  2. mtext line spacing
    By jweill9079 in forum AutoCAD Customization
    Replies: 4
    Last Post: 2008-05-28, 07:32 PM
  3. Replies: 8
    Last Post: 2007-03-12, 02:18 AM
  4. MTEXT Line Spacing
    By avennem in forum AutoCAD General
    Replies: 1
    Last Post: 2005-11-05, 01:32 AM
  5. Globally change line spacing values in MTEXT
    By BCrouse in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2004-07-07, 04:48 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
  •