Hi All
I'm a long time stalker (have learnt a lot from you all on here) first time poster.
I'm using Microstation V8i (SELECTseries4) Version 08.11.09.872
I have a reference file, the title sheet, referenced into over 1300 drawings. The reference file contains a tag set with one tag that I need to copy into each drawing so that the x,y and rotation values are the same.
I can't for the life of me work out how to copy it through correctly.
Any help would be appreciated.
Here's my code so far:
Sub Copy_Tag_Through() Dim myFSO As New Scripting.FileSystemObject Dim refAttachment As Attachment Dim myFileName As String Dim myFolder As Scripting.Folder Dim myFile As Scripting.File Dim curFolderName As String Dim referenceFileName As String Dim oAttachment As Attachment Dim fileName As String Dim tagElem As TagElement '****************************************************************************************' SET THE REFERENCE NAME'**************************************************************************************** referenceFileName = "NELP_A3_Title_Sheet_MicroStation.dgn"'****************************************************************************************' OPEN EACH DGN IN THE CURRENT FOLDER'****************************************************************************************' GET A LIST OF FILES IN THE FOLDER curFolderName = MicroStationDGN.ActiveDesignFile.Path Set myFolder = myFSO.GetFolder(curFolderName) For Each myFile In myFolder.Files myFileName = curFolderName & "\" & myFile.Name' OPEN EACH FILE MicroStationDGN.OpenDesignFile myFileName For Each oAttachment In ActiveModelReference.Attachments If referenceFileName = oAttachment.DesignFile.Name Then Set refAttachment = oAttachment '****************************************************************************************' FIND ALL ELEMENTS ON A PARTICULAR LEVEL'**************************************************************************************** Dim oEsc As ElementScanCriteria Set oEsc = New ElementScanCriteria oEsc.ExcludeAllTypes oEsc.ExcludeAllLevels oEsc.IncludeType msdElementTypeTag oEsc.IncludeLevel refAttachment.Levels("NELPDOCCODE") Dim oEnum As ElementEnumerator Set oEnum = refAttachment.Scan(oEsc) Do While oEnum.MoveNext If "NELPDOCCODE" = oEnum.Current.level.Name Then'''''''COPY THE TAG THROUGH TO THE DRAWING End If Loop End If Next' SAVE CadInputQueue.SendCommand "SAVE DESIGN" Next myFile End Sub