Hi PhilLindsay4781,
Have a look at this example. This places a symbol on the Center of Gravity center point.
This example also runs through the existing symbols, looking for the named symbol, and deletes existing instances if found. This prevents symbols on top of symbols if the code is run again, say if a new view is created. I couldn't get this example to update consistently, without adding a line that deletes the COG center point after the symbol is placed.
Here's the gotcha' to using this. The symbol is not going to update if the COG changes, so this rule will need to be run again. Note that I tested to see if deleting the sketch point made any difference to the keeping this updated, and it made no difference as far as I could tell.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
'change the symbol name
'here as needed
Dim oSymbolName As String
oSymbolName = "MySymbol"
'defind the document
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
'get the symbol definition to use
Dim oSketchedSymbolDef As SketchedSymbolDefinition
oSketchedSymbolDef = oDoc.SketchedSymbolDefinitions.Item(oSymbolName)
'Define the drawing sheet
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
'[ clean up existing symbols
'look at each symbol on the sheet
'and delete existing symbols if found
For Each oSymbol In oSheet.SketchedSymbols
'look for symbol by name
If oSymbol.Name = oSymbolName Then
oSymbol.Delete
End If
Next 'symbol
']
'[ place new symbols
For Each oView In oSheet.DrawingViews
'find Center of Gravity
'and place center mark
Dim oCofG As Object
oCoG = oSheet.Centermarks.AddByCenterOfGravity(oView)
'get center mark co-ordinates
Dim oPoint As Point2d
oPoint = oCoG.Position
'place symbol
Dim oSketchedSymbol As SketchedSymbol
oSketchedSymbol = oSheet.SketchedSymbols.Add(oSketchedSymbolDef, oPoint,0, 1)
'delete center mark
oCoG.Delete
Next 'next view
']
