Sub helloworldagain()
'remarks/comments are made after the apostrophe
Dim App As Application 'TurboCAD Top level object
Dim drg As Drawing 'Where all the business will be done
Dim t As Graphic 'We'll use this to store some text
Dim l As New Graphic 'We'll use this to store a line (New is optional)
'too many ways of doing the same thing in VB
Dim BB As BoundingBox 'Special helper objects
Dim s As String 'Conventional VB string 256 chars
s = InputBox("Hello", "My first app", "type your name here") 'Conventional VB
Set App = IMSIGX.Application 'setting a reference (not a new object)
Set drg = App.ActiveDrawing 'just saves us from typing it out all the time
Set t = drg.Graphics.AddText(s, 0, 10, 0, 10) 'this will add a new graphic to the drawing
t.Properties("PenColor").Value = RGB(255, 0, 0) 'now we set the properties - layer,color etc
Set BB = t.CalcBoundingBox 'Get TC to calculate the bounding box
'Because I used new in the Dim statement I don't need to use Set
l = drg.Graphics.AddLineSingle(BB.Min.X, BB.Min.Y, 0, BB.Max.X, BB.Min.Y, 0) ' adding a line graphic
l.Properties("Penstyle").Value = "DASHED" 'the properties are well documented
l.Properties("Pencolor").Value = RGB(0, 0, 255) 'or you could probe them with code
drg.ActiveView.ZoomToExtents 'the drawing also has properties
'if you've created and object or reference to an object then you get rid of it
Set l = Nothing
Set BB = Nothing
Set t = Nothing
Set drg = Nothing
Set App = Nothing
End Sub