Unfortunately on your screenshot I see information about A4 format, so I made a selector by the name of the border ("formato_a4") lines 32-36:
Sub main
Dim oInvApp As Inventor.Application = ThisApplication
Dim oDoc As Document = ThisDoc.Document
Dim oTG As TransientGeometry = oInvApp.TransientGeometry
If Not TypeOf oDoc Is DrawingDocument Then Exit Sub
Dim oDDoc As DrawingDocument = oDoc
Dim oSheet As Sheet = oDDoc.ActiveSheet
If oSheet.DrawingViews.Count = 0 Then Exit Sub
Dim oView As DrawingView = oSheet.DrawingViews(1)
oDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
Dim oUsParams As UserParameters = oDoc.ComponentDefinition.Parameters.UserParameters
Dim oRugosidad As UserParameter
Try : oRugosidad = oUsParams("RUGOSIDAD") : Catch : Exit Sub : End Try
Dim oListRug() As String = oRugosidad.ExpressionList.GetExpressionList()
Dim oCustom As PropertySet = oDDoc.PropertySets("Inventor User Defined Properties")
Try : oCustom("RUGOSIDAD").Value = oRugosidad.Value
Catch : oCustom.Add(oRugosidad.Value, "RUGOSIDAD") : End Try
Dim oPoint As Point2d
Dim oSymbol As SketchedSymbol
For Each oSymbol In oSheet.SketchedSymbols
If oSymbol.Name = oRugosidad.Value Then Exit Sub
For i As Integer = 0 To oListRug.Count - 1
If oListRug(i).Contains(oSymbol.Name) Then
oPoint = oSymbol.Position
oSymbol.Delete()
Exit For
End If
Next i
Next
If oPoint Is Nothing Then
Select Case oSheet.Border.Name
Case "FORMATO_A0" : oPoint = oTG.CreatePoint2d(31.5, 6.2)
Case "FORMATO_A1" : oPoint = oTG.CreatePoint2d(23.4, 6.2)
Case "FORMATO_A2" : oPoint = oTG.CreatePoint2d(19.4, 6.2)
Case "FORMATO_A3" : oPoint = oTG.CreatePoint2d(15.5, 6.2)
Case "FORMATO_A4" : oPoint = oTG.CreatePoint2d(11.3, 6.2)
Case Else : MessageBox.Show("Your sheet don't standart.", "Error!") : Exit Sub
End Select
End If
Dim oSymbolDef As SketchedSymbolDefinition = oDDoc.SketchedSymbolDefinitions(oRugosidad.Value)
oSymbol = oSheet.SketchedSymbols.Add(oSymbolDef, oPoint, 0, 1, sPromptStrings)
End Sub
You can also make the sheet selector yourself (by height) :
Select Case oSheet.Height
Case 000 : oPoint = oTG.CreatePoint2d(31.5, 6.2)
Case 000 : oPoint = oTG.CreatePoint2d(23.4, 6.2)
Case 000 : oPoint = oTG.CreatePoint2d(19.4, 6.2)
Case 000 : oPoint = oTG.CreatePoint2d(15.5, 6.2)
Case 307 : oPoint = oTG.CreatePoint2d(11.3, 6.2)
Case Else : MessageBox.Show("Your sheet don't standart.", "Error!") : Exit Sub
End Select
by width:
Select Case oSheet.Width
Case 000 : oPoint = oTG.CreatePoint2d(31.5, 6.2)
Case 000 : oPoint = oTG.CreatePoint2d(23.4, 6.2)
Case 000 : oPoint = oTG.CreatePoint2d(19.4, 6.2)
Case 000 : oPoint = oTG.CreatePoint2d(15.5, 6.2)
Case 225 : oPoint = oTG.CreatePoint2d(11.3, 6.2)
Case Else : MessageBox.Show("Your sheet don't standart.", "Error!") : Exit Sub
End Select
Choose what you like more, but make sure that the data in the cases are true.