Author Topic: Change Mtext "Dynamic" column to "None"  (Read 2060 times)

0 Members and 1 Guest are viewing this topic.

jlogan02

  • Bull Frog
  • Posts: 327
Change Mtext "Dynamic" column to "None"
« on: June 23, 2021, 06:36:42 PM »
I've searched for some way to get at the Column Type property of Mtext to change it and can't seem to find a method.

My issue is, someone is issuing a none standard piece of Mtext as a starting point for our mtext revision notes and has "Dynamic columns" set. Now I have an issue where I want to scale this revision text up along with the title block using lisp. When I scale the selected mtext objects the rogue mtext revisions scale but overrun the revision area text box. (See dwg image)

My solution or attempt was to find the Mtext with dynamic columns and reset it to NONE from dynamic. Having read a couple of different posts in the swamp lead me to understand that the MtextColumn variable can be set but only applies to new Mtext entities and doesn't update existing Mtext with "Dynamic" columns to "None". 

This results in selecting all 2d polylines
Code - Auto/Visual Lisp: [Select]
  1. (setq ss1 (ssget "_X" '((75 . 0))))

This results in selecting a hatch boundary that looks like a cloud. We use revclouds with hatches inside them. 
Code - Auto/Visual Lisp: [Select]
  1. (setq ss2 (ssget "_X" '((76 . 0))))

So clearly but happily I used a small routine to test "getting" the object I want and failed miserably.

As an aside, match properties does what I want if I select one correct mtext entitiy to update the rogue metxt entity. Which brings me full circle back to getting an Mtext entity with a column type of "Dynamic".

Does anyone know how to get the column type and change it?
« Last Edit: June 23, 2021, 06:47:43 PM by jlogan02 »
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10

jlogan02

  • Bull Frog
  • Posts: 327
Re: Change Mtext "Dynamic" column to "None"
« Reply #1 on: June 23, 2021, 06:49:28 PM »
text overrun image
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10

BIGAL

  • Swamp Rat
  • Posts: 1433
  • 40 + years of using Autocad
Re: Change Mtext "Dynamic" column to "None"
« Reply #2 on: June 23, 2021, 09:08:53 PM »
Pretty sure this was answered at forums/autodesk will try to find.
A man who never made a mistake never made anything

tombu

  • Bull Frog
  • Posts: 289
  • ByLayer=>Not0
Tom Beauford P.S.M.
Leon County FL Public Works - Windows 7 64 bit AutoCAD Civil 3D

CodeDing

  • Newt
  • Posts: 55
Re: Change Mtext "Dynamic" column to "None"
« Reply #4 on: June 24, 2021, 09:53:21 AM »
jlogan02,

Assuming you're using AutoCAD, this will change the MText Columns property to "None":
Code: [Select]
(setpropertyvalue (car (entsel)) "ColumnType" 0)
0 = None
1 = Static
2 = Dynamic

Hope that helps.

Best,
~DD
Senior CAD Tech & AI Specialist
Need AutoLisp help?
Try my custom GPT 'AutoLISP Ace'

jlogan02

  • Bull Frog
  • Posts: 327
Re: Change Mtext "Dynamic" column to "None"
« Reply #5 on: June 24, 2021, 11:24:53 AM »
Thanks everyone. It's all in how you search, isn't it!! I wasn't searching for column width.
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10

jlogan02

  • Bull Frog
  • Posts: 327
Re: Change Mtext "Dynamic" column to "None"
« Reply #6 on: June 24, 2021, 06:05:45 PM »
Thanks again for the suggestions all worked out fine. Now for the second question. In the CAD image of the revisions you'll see initials at an angle along the left side of the revision area. I can't seem to select just those based on their angle.

This selects them but also selects every other piece of text in the drawing except for the revisions on the right.
Code - Auto/Visual Lisp: [Select]
  1. (setq ss3 (ssget "_X" '((8 . "TEXT2")(0 . "*TEXT") (-4 . "/=") (50 . 22.5))))

It actually selects text on layers that aren't TEXT2 or at an angle of 22.5. What am I missing?

 
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10

BIGAL

  • Swamp Rat
  • Posts: 1433
  • 40 + years of using Autocad
Re: Change Mtext "Dynamic" column to "None"
« Reply #7 on: June 24, 2021, 08:12:29 PM »
Post a dwg
A man who never made a mistake never made anything

jlogan02

  • Bull Frog
  • Posts: 327
Re: Change Mtext "Dynamic" column to "None"
« Reply #8 on: June 25, 2021, 10:45:44 AM »
Spoke too soon.

I can't provide an actual drawing as all are preparatory. I've mocked up a drawing that exhibits the same results.

Code - Auto/Visual Lisp: [Select]
  1. (setq ss3 (ssget "_X" '((8 . "TEXT2") (0 . "TEXT") (-4 . "/=") (50 . 22.5))))

I made a slight change and removed the * from
Code - Auto/Visual Lisp: [Select]
  1. (0 . "*text")
. That minimized the issue somewhat. but it's still grabbing text at 0 rotation.

As an side I'm going to need to grab text greater than 20.0 less than 22.5. So this may be the wrong approach all together.




That's weird, I just tested it on a stripped down version of the drawing and it worked. Backed up to the original drawing and it worked there too. ---


Carry on.
« Last Edit: June 25, 2021, 12:42:25 PM by jlogan02 »
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10

jlogan02

  • Bull Frog
  • Posts: 327
Re: Change Mtext "Dynamic" column to "None"
« Reply #9 on: June 25, 2021, 01:56:52 PM »
Seems a little long winded but this works as a test.


Code - Auto/Visual Lisp: [Select]
  1. (defun c:Testt ( / ss3 ss4 )
  2.   (setq ss3 (ssget "_X" '((8 . "TEXT2") (0 . "TEXT") (-4 . "/=") (50 . 22.5) (-4 . "<NOT") (50 . 0) (-4 . "NOT>"))))
  3.   (setq ss4 (ssget "_X" '((8 . "TEXT2") (0 . "TEXT") (-4 . "/=") (50 . 20.5) (-4 . "<NOT") (50 . 0) (-4 . "NOT>"))))
  4.   (command "erase" ss3 ss4 "")
  5.   )
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10