.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing mtext Next word Formatting width

1 REPLY 1
SOLVED
Reply
Message 1 of 2
GeeHaa
466 Views, 1 Reply

Changing mtext Next word Formatting width

Hi,

 

I'm writing a program to scale a drawing and when it encounters MTEXT it leaves the width factor at the previous value. I tried changing the width property but it does not change and it doesn't throw an error. Is there another property that handles this?

 

Thanks

 

 

                  For Each id In ids

                        Dim ent As Entity = TryCast(tr.GetObject(id, OpenMode.ForRead, False), Entity)
                        If ent Is Nothing Then Return
                        If Not ent.IsWriteEnabled Then ent.UpgradeOpen()

                        ent.TransformBy(Matrix3d.Scaling(convertVal, ptLL))

                        If TypeOf ent Is DatabaseServices.MText Then
                            Dim mt As MText = ent
                            mt.Width = mt.Width * convertVal
                        End If
                    Next

 

 

 

1 REPLY 1
Message 2 of 2
GeeHaa
in reply to: GeeHaa

It seems in order for the width to be changed the columnType has to be set to NoColumns. If this is set the MTEXT Object Scales without having to change the width. I'm not sure if this is OK to do but it seems to work.

 

 

                    For Each id In ids
                        Dim ent As Entity = TryCast(tr.GetObject(id, OpenMode.ForRead, False), Entity)
                        If ent Is Nothing Then Return
                        If Not ent.IsWriteEnabled Then ent.UpgradeOpen()
                        ent.TransformBy(Matrix3d.Scaling(convertVal, ptLL))
                        If TypeOf ent Is DatabaseServices.MText Then
                            Dim mt As MText = ent
                            If mt.ColumnType <> ColumnType.NoColumns Then
                                If mt.ColumnCount = 1 Then
                                    mt.ColumnType = ColumnType.NoColumns
                                End If
                            End If
                        End If

                    Next

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost