Jump to content

Replace symbol - keep data


Recommended Posts

This is a script that mimics the behavior of Spotlight's "Replace With Active Instrument" button in the OIP of a Spotlight Instrument, but works on any symbol with attached data.

It replaces the selected symbol in the drawing with the active symbol in the RB

and

keeps all the data of records attached to the symbols (should work for multiple record formats)

unless

the name of the field starts with a tilde "~". Fields starting with ~ will use the default data of the incoming symbol.

I'll attach a file so it's clear how it works.

Pick a symbol in the drawing and use the "replace" button on the OIP to replace it with a different symbol. Recalculate the worksheet. All the data goes to the default data of the incoming symbol. i.e. you need to reinter the room, plate #, engraving, etc.

Select a different symbol in the drawing. Make another symbol active in the RB. Run the script. Recalculate the worksheet.

The data in the red cells is always the default data of the incoming symbol. The rest of the data uses the values from the outgoing symbol.

mk

SuperReplace_2013.vwx

Link to comment
  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...