Hi Everyone
I have attached a reference file the reference file's logical name is different So I opened the reference file and I change the logical name through model properties
but when i reload the reference the updated logical name is not showing its showing old logical name only; So do i need to detach and reattach the reference file again
or is there any other process to reload the latest logical name
Thanks in advance
Sunil Patil said:I have attached a reference file the reference file's logical name is different So I opened the reference file and I change the logical nam
A DGN model's logical name is no more than a suggestion. When you first attach a DGN model as a reference, the model's logical name — if it has one — is copied to the attachment info in the active DGN model.
Once you have created a reference attachment, the attachment info is stored in the active DGN model. You can change the logical name in the reference dialog, or in the attachment properties. A reference attachment is read-only; the attached model's name is therefore unchanged.
Regards, Jon Summers LA Solutions
Thanks for the reply John!So I have to edit the locgical name in 15 files?:(
Now that I am in the office, it looks as though you want the Logical Name and Description to be the same.
Sunil Patil said:So I have to edit the locgical name in 15 files?:(
Well that would be a huge waste of time, instead you could just use the batch processor to run a VBA macro containing this code:
Option Explicit Public Sub SyncRefData() Dim oAttachment As Attachment For Each oAttachment In ActiveModelReference.Attachments If Not oAttachment.LogicalName = oAttachment.DefaultLogicalName Then oAttachment.LogicalName = oAttachment.DefaultLogicalName End If If Not oAttachment.LogicalDescription = oAttachment.Description Then oAttachment.LogicalDescription = oAttachment.Description End If Next oAttachment CadInputQueue.SendCommand "DIALOG REFERENCE CLOSE" CadInputQueue.SendCommand "DIALOG REFERENCE OPEN" End Sub
It simply checks every reference file, compares the current logical name and description against the values in each attachments Designfile, and if they are different, changes them to whatever the values are in the Designfile.
The only minor oddity is the References dialog doesn't immediately display the changes, so I have added a couple of lines to open and close it and then the updated values can be seen.
Sunil Patil said: I have to edit the logical name in 15 files?
An attachment is a DGN model, not a file. A DGN file may contain many DGN models.
You have to edit the logical name of 15 attachments in your active DGN file. There is no need to change the logical name for the DGN models, unless you want to for some reason that you have not told us.
I copy this code in text file and save as 1.vba
Using batch process I run this on 1 of the file where the reference is attached but the logical name is not changed
Thanks Berry for your time
Sunil Patil said:I copy this code in text file and save as 1.vba
That's not what you do, you need to make an MVBA file using the VBA IDE in Microstation itself, and then paste the code into a Module.
Then you create a Text file which contains only a single line of text, which is the command to load and run that VBA macro.
I know the macro works because I tested it on some sample files.