10-19-2021
09:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-19-2021
09:13 AM
Sub SetAttributesOnSheets()
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
Dim Blockname As String
Blockname = "Testblock"
Dim oSheet As Sheet
For Each oSheet In oDrawDoc.Sheets
Dim oBlock As AutoCADBlock
For Each oBlock In oSheet.AutoCADBlocks
If oBlock.Name = Blockname Then
Dim tagStrings() As String
Dim textStrings() As String
oBlock.GetPromptTextValues tagStrings, textStrings
Dim i As Integer
For i = LBound(tagStrings) To UBound(tagStrings)
If tagStrings(i) = "TEXT1" Then
textStrings(i) = "text1text"
ElseIf tagStrings(i) = "TEXT2" Then
textStrings(i) = "text2text"
End If
Next
' If multiple tag strings are the same then it will
' only set the value for the first one of them
' That's one of the reasons for this article
' to show how to do it using the AutoCAD API instead
' which seems to be working fine and can be used as
' a workaround
oBlock.SetPromptTextValues tagStrings, textStrings
End If
Next
Next
End SubThis is the closest reference,
I've found but ilogic doesn't use SET (just remove?) & it doesn't like SUB's (must be after SUB MAIN) - remove subs & then more errors ..
Can this be ported to iLogic?