Hi @jpi656UL. If it is possible to set-up that way, it would have to include some 'triggers' that would automatically run the rule again every time the active sheet changes, to keep the property's value up to date. Currently there is only one event listed in the 'Event Triggers' dialog which has anything to do with drawings specifically, and that is 'Drawing View Change' (uses the OnViewUpdate event), which only gets triggered when something in the model changed, causing the view to be updated to match the model. So that trigger won't work for this situation. You would need to create a custom event handler code to be able to trigger this rule to run every time the active sheet changes. The only other drawing specific event I can think of that has an event handler code established for it is the 'OnRetrieveDimensions', which is obviously not what we want here. So, I'm not sure any code exists to handle the event we want to monitor here.
But here would be one possible representation of the iLogic rule for creating/updating a custom iProperty that records the name (or number) of the active sheet. Then some code to place the title block with that value in its first prompted entry value.
Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Sheet = oDDoc.ActiveSheet
Dim oCProps As PropertySet = oDDoc.PropertySets.Item(4)
Dim oNameProp, oNumProp As Inventor.Property
Try
oNameProp = oCProps.Item("ActiveSheetName")
oNameProp.Value = oSheet.Name
Catch
oNameProp = oCProps.Add(oSheet.Name, "ActiveSheetName")
End Try
'Try
' oNumProp = oCProps.Item("ActiveSheetNumber")
'Catch
' oNumProp = oCProps.Add(0, "ActiveSheetNumber")
'End Try
'For i As Integer = 1 To oDDoc.Sheets.Count
' If oDDoc.Sheets.Item(i) Is oSheet Then
' oNumProp.Value = i
' End If
'Next
Dim oTBDef As TitleBlockDefinition = oDDoc.TitleBlockDefinitions.Item("TitleBlockDefName")
Dim oPromptStrings() As String = {oNameProp.Value}
oSheet.AddTitleBlock(oTBDef, TitleBlockLocationEnum.kBottomRightPosition, oPromptStrings)
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)