Example 8 - place text.swb

'****************************************************************
'
' place text.swb - macro recorded on 01/13/00 by
' Joe Jones			joe@nhcad.com
' New Hampshire CAD	www.nhcad.com
'
' This macro will place text at an X Y location on a drawing
'
'****************************************************************

Dim swApp As Object
Dim ModelDoc As Object
Dim Strng As String

Sub main()
	Set swApp = CreateObject ("SldWorks.Application")
	Set ModelDoc = swApp.ActiveDoc
	swApp.ActiveDoc.ActiveView.FrameState = 1

	' insert date at (.05, .08) in meters
	ModelDoc.CreateText Str(Date), 0.05, 0.08, 0, .01, 0	

	' insert user defined text at (.05, .05) in meters
	Strng = InputBox("Drawn By")
	ModelDoc.CreateText Strng, 0.05, 0.05, 0, .01, 0

	' get the current full path and name of this file
	strng = ModelDoc.GetPathName 

	' if file has not been saved nothing is returned
	if strng <> "" then ModelDoc.CreateText Strng, _
		0.05, 0.03, 0, .01, 0
End Sub