Jump to content
Developer Wiki and Function Reference Links ×

Need Vectorscript to replace number with a letter


Recommended Posts

I need help creating a Vectorscript that will replace part of a symbol number.  I have symbols created that I have numbered 1.001, 1.002 and so on.  I need a script or a quick way to replace the first number with a letter to these numbers (A.001, A.002) and so on.  My field is formatted as text.  I would like something that pops up that we can enter the desired letter.  I'd appreciate any ideas on how I can accomplish this.

Link to comment

For symbol instances, Josh's suggestion of using Find and Replace is probably the best option. You can use the Replace All Selected option so that you only work on selected symbols.

 

Is this a one time need or is this something that is part of your workflow and needs to be done on a regular basis? How many symbol instances are we talking about? Is this something that will save you 5 minutes of time? 5 hours? 5 Days?

 

If you really want a script, you will need to provide more detail about exactly how you want it to work.

How do we know we are processing only the desired symbols? All Symbols in the file? Only Selected Symbols? All the symbols on the active layer? Selected on Active Layer? Only objects that have a user specified

Do you want this to only work with your current record definition?  If so then we need the record and field name. The script will then break when someone edits the record name or the field name.

How much error checking and bullet proofing do you need.  What should the script do if someone accidentally put a different character in front of the character to replace? Ignore it? Ignore that instance? Produce an error message and zoom the the faulty object?

 

There are probably about another 100 questions that should really be asked and answered before a real idea of what it takes to write the script can be determined.

 

I like to script and things like this are usually fun to start with, but often after writing something that meets the primary requirement then i get repeated asked to add this and then that and then the other thing. If I know all of the requirements up front, it is much easier to decide if I am willing to spend the time.

 

Give us some more details (as many as you can about what you are really trying to do (and probably why you are trying to do it)) and we might be able to come up with a way that works for you and does not end up as a 20 hour slog to write.

Link to comment

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...