AnsweredAssumed Answered

WaterMark Macro not correct Font Point size?

Question asked by Craig Makarowski on Jan 29, 2019
Latest reply on Jan 30, 2019 by Deepak Gupta

WellI recorded a macro to make a Water mark on my Drawings for Preliminary Drawings. THe Font does not set to the correct size (Should be 72 points), also doesn't seem to have the Behind sheet check mark set as well. here is my Macro

' ******************************************************************************

' C:\Users\cramak\AppData\Local\Temp\swx12964\Macro1.swb - macro recorded on 01/29/19 by cramak

' ******************************************************************************

Dim swApp As Object

 

 

Dim Part As Object

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long

 

 

Sub main()

 

 

Set swApp = Application.SldWorks

 

 

Set Part = swApp.ActiveDoc

boolstatus = Part.Extension.SelectByID2("Sheet1", "SHEET", 0.189459370676497, 0.254029203869184, 0, False, 0, Nothing, 0)

Part.EditTemplate

Part.EditSketch

Part.ClearSelection2 True

Part.FontPoints 72

Part.FONTBOLD True

 

 

Dim myNote As Object

Dim myAnnotation As Object

Dim myTextFormat As Object

Set myNote = Part.InsertNote("<FONT color=0x00c0c0c0><FONT size=72PTS style=B>PRELIMINARY DRAWING")

If Not myNote Is Nothing Then

myNote.LockPosition = False

myNote.Angle = 0.3490658503989

boolstatus = myNote.SetBalloon(0, 0)

Set myAnnotation = myNote.GetAnnotation()

If Not myAnnotation Is Nothing Then

longstatus = myAnnotation.SetLeader3(swLeaderStyle_e.swNO_LEADER, 0, True, False, False, False)

boolstatus = myAnnotation.SetPosition(0.170992792024719, 0.144460837201969, 0)

 

 

Set myTextFormat = Part.GetUserPreferenceTextFormat(0)

myTextFormat.Italic = False

myTextFormat.Underline = False

myTextFormat.Strikeout = False

myTextFormat.Bold = True

myTextFormat.Escapement = 0.3490658503989

myTextFormat.LineSpacing = 0.001

myTextFormat.CharHeightInPts = True

myTextFormat.TypeFaceName = "Century Gothic"

myTextFormat.WidthFactor = 1

myTextFormat.ObliqueAngle = 0

myTextFormat.LineLength = 0

myTextFormat.Vertical = False

myTextFormat.BackWards = False

myTextFormat.UpsideDown = False

myTextFormat.CharSpacingFactor = 1

boolstatus = myAnnotation.SetTextFormat(0, False, myTextFormat)

End If

End If

Part.ClearSelection2 True

Part.WindowRedraw

Part.EditSheet

Part.EditSketch

End Sub

' ******************************************************************************

 

here is the settings even when i set the Behind Sheet check box the recorded macro doesn't seem to capture it!

 

Result, Font should be very big!

Outcomes