Message 1 of 5
Set UseBasePoint for DBText

Not applicable
12-24-2013
12:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I have a problem, hope everybody can help me. This is, where can i put this code: ppo.UseBasePoint = True ,ppo.BasePoint = pt1,ppo.UseDashedLine = True into my program:
<CommandMethod("dd")> Public Sub DrawText() Dim doc As Document = Application.DocumentManager.MdiActiveDocument Dim ed As Editor = doc.Editor Dim db As Database = doc.Database doc.LockDocument() Dim ppo As PromptPointOptions = New PromptPointOptions("") ppo.Message = vbLf & "Choose the first vertex of the square: " Dim ppr As PromptPointResult = ed.GetPoint(ppo) If ppr.Status <> PromptStatus.OK Then Return End If Dim pt1 As Point3d = ppr.Value '' Start a transaction Using acTrants As Transaction = db.TransactionManager.StartTransaction() Dim acBlkTbl As BlockTable acBlkTbl = acTrants.GetObject(db.BlockTableId, _ OpenMode.ForRead) '' Open the Block table record Model space for write Dim acBlkTblRec As BlockTableRecord acBlkTblRec = acTrants.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), _ OpenMode.ForWrite) ''Create a single-line text object Dim acText As DBText = New DBText() acText.SetDatabaseDefaults() acText.Position = ppr.Value acText.Height = 100 acText.TextString = "Cadviet" acText.WidthFactor = 0.8 acText.HorizontalMode = TextHorizontalMode.TextCenter acText.VerticalMode = TextVerticalMode.TextVerticalMid acText.AlignmentPoint = ppr.Value acBlkTblRec.AppendEntity(acText) acTrants.AddNewlyCreatedDBObject(acText, True) acTrants.Commit() End Using ppo.Message = vbLf & "Choose the second vertex of the square: " ppo.UseBasePoint = True ppo.BasePoint = pt1 ppo.UseDashedLine = True ppr = ed.GetPoint(ppo) End Sub
I use "MULTIPLE" in comman line of autocad, so i want to create one more acText. Thanks Everybody.