Sub KIRA() Dim FSO As FileSystemObject Dim TxtObj As TextStream Set FSO = CreateObject("Scripting.FileSystemObject") Dim TxtPath As String TxtPath = "D:\KIRA.txt" 'Thay doi duong dan phu hop voi file Txt cua ban Set TxtObj = FSO.OpenTextFile(TxtPath, ForReading) '----------------------------------------------------------- Dim InsertPnt(0 To 2) As Double Dim MyArray As Variant Dim strText As String Dim Madiem As String Dim TenDiem As String Dim CaoDo As String 'index =1 (Ten Diem) 'Index =2 (Caodo) 'Index=3 (MaDiem) Do While Not (TxtObj.AtEndOfStream) StrTemp = TxtObj.ReadLine MyArray = Split(StrTemp, Chr(9)) TenDiem = MyArray(0) InsertPnt(0) = CDbl(MyArray(2)) InsertPnt(1) = CDbl(MyArray(1)) CaoDo = MyArray(1) Madiem = MyArray(2) Call AddText(TenDiem, InsertPnt, 1) Call AddText(CaoDo, InsertPnt, 2) Call AddText(Madiem, InsertPnt, 3) Loop TxtObj.Close End Sub Sub AddText(ByVal strText As String, ByVal InsertPnt, Index As Integer) Dim TextObj As AcadText Dim Htext As Double Htext = 2.5 'you can change Heigh Text If Index = 1 Then Call AddLayer("Ten_Diem") Set TextObj = ThisDrawing.ModelSpace.AddText(strText, InsertPnt, Htext) TextObj.Alignment = acAlignmentMiddleRight TextObj.TextAlignmentPoint = InsertPnt ElseIf Index = 2 Then Call AddLayer("Cao_Do") Set TextObj = ThisDrawing.ModelSpace.AddText(strText, InsertPnt, Htext) TextObj.Alignment = acAlignmentMiddleCenter TextObj.TextAlignmentPoint = InsertPnt ElseIf Index = 3 Then Call AddLayer("Ma_Diem") Set TextObj = ThisDrawing.ModelSpace.AddText(strText, InsertPnt, Htext) TextObj.Alignment = acAlignmentMiddleLeft TextObj.TextAlignmentPoint = InsertPnt End If End Sub Sub AddLayer(LayerName) On Error Resume Next Dim LayerObj As AcadLayer Set LayerObj = ThisDrawing.Layers.Add(LayerName) ThisDrawing.ActiveLayer = LayerObj End Sub