Renaming Logical Names

I have a need to be able to rename a logical name if incorrect or name a logical if not present by way of a VBA macro, but can't find any command that allow this without going through a dialog box. Any help or redirection will be appreciated.

 

Parents
  • scaleflyer said:
    ...can't find any command that allows this without going through a dialog box

    It's not clear what you mean by 'dialog box': that could be a MicroStation dialog or a VBA UserForm.  How do you want to invoke your macro? 

    Do you want to execute the renaming with just a key-in and no user interface?  Investigate the KeyinArguments Property: Gets or sets a value representing the list of arguments given in the most recent "vba run" keyin command.

     
    Regards, Jon Summers
    LA Solutions

  • Hi,

    Are you talking about reference files?

    ActiveModelReference.Attachments(MyAttachmentNo).LogicalName = "New Name"

    ActiveModelReference.Attachments(MyAttachmentNo).Rewrite

    where "MyAttachmentNo" is the attachment number.

    Often I use

    For Each MyAttachment in ActiveModelReference.Attachments

    ...

    Next

    --Robert

    Answer Verified By: scaleflyer 

  • Robert, if I already have 'sheet' files that don't always have the same attachment number for a specific reference file that I want to modify the name, is there a way to first identify the reference by its current logical name, then edit/update the logical name?
    I have logical name MAIN attached, but need to edit the logical name to 'topMAIN' for the clients plotting requirement to screen back this file. This will also apply to several other references in each sheet file. (LIMT, ECON, REQD, PROP, etc all need to have the 'top' prefix added to the logical name.)
    Thanks,
    Michael
Reply
  • Robert, if I already have 'sheet' files that don't always have the same attachment number for a specific reference file that I want to modify the name, is there a way to first identify the reference by its current logical name, then edit/update the logical name?
    I have logical name MAIN attached, but need to edit the logical name to 'topMAIN' for the clients plotting requirement to screen back this file. This will also apply to several other references in each sheet file. (LIMT, ECON, REQD, PROP, etc all need to have the 'top' prefix added to the logical name.)
    Thanks,
    Michael
Children
No Data