Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Tony_Yates
in reply to: Anonymous

Hi Paul,

 

Try this:

'Dim oDoc As DrawingDocument
Dim oDoc = ThisApplication.ActiveDocument


Dim oSheet As Sheet

For Each oSheet In oDoc.Sheets

     Dim oSketchedSymbolDef As SketchedSymbol
    For Each oSketchedSymbolDef In oSheet.SketchedSymbols
     If oSketchedSymbolDef.Name = "A3 For Approval" Then
        oSketchedSymbolDef.Delete 'It will delete all the sketched symbols
     End If
   Next

Next

' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument = ThisDrawing.Document


' Obtain a reference to the desired sketched symbol definition.
Dim oSketchedSymbolDef As SketchedSymbolDefinition _
       = oDrawDoc.SketchedSymbolDefinitions.Item("A3 For Construction")

Dim oSheet As Sheet = oDrawDoc.ActiveSheet

'create insertion point, coordinates - in cm !
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oInsertionPoint As Point2d = oTG.CreatePoint2d(40.195195, 10.5)


Dim oSketchedSymbol As SketchedSymbol _
       = oSheet.SketchedSymbols.Add( _
             oSketchedSymbolDef, _
             oInsertionPoint, _
             0, 1, Nothing)

 

change the insertion point number to position where you like it.

Also noticed your stamp name is spelt incorrect. "A3 For Constrcuction" so correct that first.