detect and remove dynamic columns from Mtext

detect and remove dynamic columns from Mtext

GilesPhillips
Collaborator Collaborator
1,863 Views
1 Reply
Message 1 of 2

detect and remove dynamic columns from Mtext

GilesPhillips
Collaborator
Collaborator

Hi all,

 

I've had a colleague unwittingly fill up lots of drawings with mtext, (a sin in my books) all of which have dynamic columns enabled (an even greater sin).

 

This has broken an export script we use, as it gives inaccurate responses to the getboundinbox method in VBA.

 

Can anyone suggest how I can get VBA to find and then remove the dynamic column property of an Mtext entity? it doesn't appear as a regular property, there don't appear to be any methods, and I can't find any xdata or xrecords.. I'm kinda stumped.

 

thanks for any help

 

G

ACad, MEP, Revit, 3DS Max
0 Likes
1,864 Views
1 Reply
Reply (1)
Message 2 of 2

ambrosl
Autodesk
Autodesk

I don't see the property exposed to COM/VBA, you most likely could do this with VB.NET though.  As a workaround, you could possibly write a script (SCR) file from a VBA macro that utilizes AutoLISP statements.  Below is an example that changes the ColumnType for a MText object that has the object handle of "275". An object's handle can be returned with the Handle property in VBA.

(if (> (getpropertyvalue (handent "275") "ColumnType") 0)
  (setpropertyvalue (handent "275") "ColumnType" 0)
)

The SCR file can then be ran using the SendCommand or PostCommand functions.



Lee Ambrosius
Senior Principal Content Experience Designer
For additional help, check out the AutoCAD Developer Documentation