iLogic Program to add Custom Symbols

iLogic Program to add Custom Symbols

Anonymous
Not applicable
588 Views
2 Replies
Message 1 of 3

iLogic Program to add Custom Symbols

Anonymous
Not applicable

Hello All,

 

I was wondering if someone could help me design an iLogic program. I would like to use small equilateral triangles (approx. 0.156" tall) with two to three letters of text (size 0.06) inside the triangle. I'll be using this symbol to designate certain features. A feature will be labeled with either the letter "S" or "F" followed by a number (1,2,3...and so fourth). I would like a prompt to ask the user how many features they need to label and then have the program loop through and create a symbol with the correct letter and appropriate number, pasting each symbol in a line down the side of the page so that the user can click and drag each symbol to the desired location.

 

If anyone knows of a way to do this, or could steer me in the right direction, it would be much appreciated!

 

Thanks!

 

-Nick

0 Likes
Accepted solutions (1)
589 Views
2 Replies
Replies (2)
Message 2 of 3

frederic.vandenplas
Collaborator
Collaborator
Accepted solution

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"
Message 3 of 3

Anonymous
Not applicable
Thank you so much, this does exactly what I was looking for. Much appreciated!

-Nick
0 Likes