Option Explicit Dim tcApp Dim tcDwg Dim TORADIANS Dim bContinue '================ Main ================================================= Sub Main () Dim blk 'as Block Dim grs 'as Graphics Dim gr 'As Graphic Dim bbox 'As BoundingBox Set tcApp = CreateObject("TurboCAD.Application") tcApp.Visible = false tcApp.Visible = true 'Following added by PES for testing - Dec 15, 2007 dim objFSO dim objTextFile dim strNextLine dim strRefDes dim strDecal dim strXloc dim strYloc Const ForReading = 1 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile ("ASC_LOG.TXT", ForReading) Do Until objTextFile.AtEndOfStream strNextLine = objTextFile.Readline strRefDes = Mid( strNextLine, 11, 9) strDecal = Trim(Mid( strNextLine, 20, 27)) strXloc = Mid( strNextLine, 47, 8) strYloc = Mid( strNextLine, 55, 8) Set blk = tcApp.ActiveDrawing.Blocks(strDecal) Set grs = blk.Graphics Set bbox = grs.CalcBoundingBox Set grs = tcApp.ActiveDrawing.Graphics grs.AddBlockInsertion strDecal, CSng(strXloc)/1000, CSng(strYloc)/1000, (bbox.Max.Z - bbox.Min.Z)/2 Loop End Sub TORADIANS = 3.14159265358979 / 180 Main MsgBox "PES Test Program Done"