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

Hi,

 

This code does what you need, there may be slight modifications needed, but if you create a sketched symbol called "Triangle Walks"

with 2 promted entries (first is Letter, second is Number) the code will insert the symbol on the left of your drawing

 

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet

Dim oTriangleWalksDef As SketchedSymbolDefinition
oTriangleWalksDef = oDrawDoc.SketchedSymbolDefinitions.Item("Triangle Walks")
            
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
            
Dim dblStartPointX, dblStartPointY As Double
dblStartPointX = 1.5
dblStartPointY = oSheet.Height - 1.5

Dim strLetter As String
strLetter = InputBox("Provide Letter.", "Letter", , 400, 400)

Dim iNumber As Integer
iNumber = InputBox("Provide Number.", "Number", , 400, 400)

For iNumber = 1 To iNumber
Dim sPromptStrings(1) As String
sPromptStrings(0) = strLetter
sPromptStrings(1) = iNumber

Dim oSketchedSymbol As SketchedSymbol
oSketchedSymbol = oSheet.SketchedSymbols.Add(oTriangleWalksDef, oTG.CreatePoint2d(dblStartPointX, dblStartPointY), 0, 1, sPromptStrings)
oSketchedSymbol.Static = True
dblStartPointY = dblStartPointY - 1
Next iNumber
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"