We often have a smoke detectors, wich have an indicatorlamp with the same adres above the door of the room. I want to select the detector, then the indicator (all through the drawing), press enter and the values from the detectors are copied to the indicators.
So the routine I want to make should copy (remember) the value of the first selected block-attribute, and paste it to the next selected block attribute.
I have made a serious yet sketchy attempt to get some code going here, but I feel I'm still quite far off. Can someone help me out?
Heres my code so far:
Code:Option Explicit Dim BlkAtts As Variant Public Sub BlockValtoNextBlock() Dim SelSet As AcadSelectionSet Dim Ent As AcadEntity Dim BlockInsert As AcadBlock Dim i As Integer Dim AttText As String Set SelSet = ThisDrawing.SelectionSets.Add("SS0") SelSet.SelectOnScreen SelSet.Highlight True For Each Ent In SelSet If Not BlockInsert.Name = "Nevenindicator" Then AttText = BlkAtts(0).TextString End If Next For Each Ent In SelSet If BlockInsert.Name = "Nevenindicator" Then UpdateAttrib 0, AttText End If Next SelSet.Highlight False End Sub Sub UpdateAttrib(TagNumber As Integer, BTextString As String) 'This procedure checks to see if there is a value. If BTextString = "" Then BlkAtts(TagNumber).TextString = "" Else BlkAtts(TagNumber).TextString = BTextString End If End Sub