I have a vba that attaches a reference with a logical name as "BORDER". The reference dialog box shows the attached reference with logical name as "BORDER". I will then run a second vba that looks for reference logical name as "BORDER". The second vba does not find the reference with logical name "BORDER" unless I close the dgn file and reopen the dgn and run the second vba.
I have tried multiple ways to run the second vba with out opening and closing the dgn file.
Below is the first vba and it does find Border Logical which is named "BORDER". I tried renaming LogicalName a second time and rewriting the reference. Strange that it does find the LogicalName_Border correctly.
Do While (iRef <= LocalVar_Attachments1.Count)
If (LocalVar_Attachments1(iRef).LogicalName = Border_Logical) Then
' LocalVar_Attachments1(iRef).Rewrite
LocalVar_Attachments1(iRef).LogicalName = "BORDER"
LocalVar_Attachments1(iRef).Rewrite
Exit Do
End IF
iRef = iRef + 1
Loop
When running the second vba and do a watch on the reference logical name it does not find "BORDER" unless file is closed and reopened before running the second vba. The reference dialog box shows "BORDER" logical name before closing and reopening the dgn file. Is this possibly a bug in the program.