Pyrotechnic Posted April 18, 2017 Share Posted April 18, 2017 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. Quote Link to comment
JBenghiat Posted April 18, 2017 Share Posted April 18, 2017 Are you changing the symbol name or a record attached to the symbol instance? If the latter, just use Text>Find-Replace Text... Select Replace All and Look in Record Fields. Replace "1." with "A.". -Josh Quote Link to comment
Pat Stanford Posted April 18, 2017 Share Posted April 18, 2017 Are these symbol instances (objects placed in a drawing) or symbol definitions (stored in the resource manager.) Which it is you are talking about will make a major difference in how to proceed. Quote Link to comment
Pyrotechnic Posted April 18, 2017 Author Share Posted April 18, 2017 These would be symbol instances, I do not want to change the symbol definition Quote Link to comment
Pat Stanford Posted April 19, 2017 Share Posted April 19, 2017 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. Quote Link to comment
Recommended Posts
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.