Hi @JShearer98. In order for others to write a code that would do all that you want, we would have to know more details about the sketched symbol, such as what <DATE> represents, and where you want it on the sheet. I will post a 'starter' example iLogic rule code below. It assumes the 'name' of the sketched symbol's definition is "DateStamp", so you will likely need to change that within this code first of all. Next, is that definition already within the 'active' drawing, or does it need to be imported from an external sketched symbols library somewhere? This example assumes that the definition already exists within the active document. Next, where to place it. This example is placing it at 3 units (CM by default) by 3 units from the lower left corner of the sheet, as a default location, so you may have to change that. Next is how to set-up or include the date. In this example, it expects the Date portion of the text to be a single TextBox representing a 'Prompted Entry'. It also expects there to be just one Prompted Entry. If either is not true, it will error out. It fills in that one prompt with todays date in short String format.
Sub Main
Dim oInvApp As Inventor.Application = ThisApplication
Dim oDDoc As DrawingDocument = TryCast(oInvApp.ActiveDocument, Inventor.DrawingDocument)
If oDDoc Is Nothing Then Return
Dim oSSDefs As SketchedSymbolDefinitions = oDDoc.SketchedSymbolDefinitions
Dim oSSDef As SketchedSymbolDefinition = Nothing
Try
oSSDef = oSSDefs.Item("DateStamp") '<<< CHANGE THIS >>>
Catch
MsgBox("Could not find Specified SketchedSymbolDefinition!", vbCritical, "iLogic")
End Try
If oSSDef Is Nothing Then Return
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
Dim oSSs As SketchedSymbols = oSheet.SketchedSymbols
Dim oSS As SketchedSymbol = Nothing
Dim oPos As Inventor.Point2d = oInvApp.TransientGeometry.CreatePoint2d(3, 3)
Dim oPrompts() As String = {Now.ToShortDateString}
Try
oSS = oSSs.Add(oSSDef, oPos, 0, 1, oPrompts)
Catch
MsgBox("Error Adding SketchedSymbol Instance To Active Sheet!", vbCritical, "iLogic")
End Try
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)