Message 1 of 4
Trouble with AttachmentPoint.TopCenter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When I create DBText with a TopCenter alignment, the text comes out "Aligned" with a Height of 0 and Angle of 0. Any other value for the attachment point seems to work fine.
tsTable = CType(Trans.GetObject(AcadDoc.Database.TextStyleTableId, OpenMode.ForWrite), TextStyleTable)
Align = AttachmentPoint.TopCenter
TextEnt = New DBText
TextEnt.SetDatabaseDefaults()
TextEnt.TextString = TextString
TextEnt.Position = New Point3d(InsPoint)
TextEnt.Justify = Align
If Align <> AttachmentPoint.BaseLeft Then TextEnt.AlignmentPoint = New Point3d(InsPoint)
TextEnt.Height = Height
TextEnt.ColorIndex = Color
TextEnt.Rotation = Angle
TextEnt.TextStyle = tsTable(Style)
TextEnt.Layer = Layer
btr = Trans.GetObject(AcadDoc.Database.CurrentSpaceId, OpenMode.ForWrite)
btr.AppendEntity(TextEnt)
Trans.AddNewlyCreatedDBObject(TextEnt, True)
Trans.Commit()
tsTable = CType(Trans.GetObject(AcadDoc.Database.TextStyleTableId, OpenMode.ForWrite), TextStyleTable)
Align = AttachmentPoint.TopCenter
TextEnt = New DBText
TextEnt.SetDatabaseDefaults()
TextEnt.TextString = TextString
TextEnt.Position = New Point3d(InsPoint)
TextEnt.Justify = Align
If Align <> AttachmentPoint.BaseLeft Then TextEnt.AlignmentPoint = New Point3d(InsPoint)
TextEnt.Height = Height
TextEnt.ColorIndex = Color
TextEnt.Rotation = Angle
TextEnt.TextStyle = tsTable(Style)
TextEnt.Layer = Layer
btr = Trans.GetObject(AcadDoc.Database.CurrentSpaceId, OpenMode.ForWrite)
btr.AppendEntity(TextEnt)
Trans.AddNewlyCreatedDBObject(TextEnt, True)
Trans.Commit()