Duplicate Views replacing the name

Hi!

I want to duplicate views and replace the prefix, I need to replace the 6 first characters for an other 6.

For example, all my views works with prefix in order to classificate all the disciplines in the project browser (original prefix “**BMS.01_**FloorPlan” to duplicate view prefix “**FPT.01_**FloorPlan”).

Obviously, if I already change the name, don’t need a “Copy 1” at the end of the View Name. How should I solve that?

Thanks in advance!

Use a String.Replace node to replace the “Copy 1” with “” or remove the last five characters from the string with a string.remove node and a -5 input.

1 Like

Perfect!

I’m new at this, I don’t know anything of visual programming logic, maybe you can give me some basic tips to learn how to use CodeBlock or String input. In some other workflows I read different types of code block, like lists or formulas.

I don’t know what is going wrong.

The intention is to duplicate the views multiple times in order to have view to each discipline.

THANKS!

What is the error for the Element.GetparameterValueByName node?

1 Like

The error is the same for the GetParameter and SetParameter node: “Warning: Internal error, please report: Dereferencing a non-pointer.”

And “Warning: String.Replace operation failed.” for String.Replace.

Is there a legend or view template in the selection set?

1 Like

Yes, there is a view template on the views set. is that the problem? and what about the rest of the workflow, is okay?

Hi @and6rea

If your looking to duplicate plan views you can get floor plan views by using element types as shown below and then filter them by view names “BMS” to duplicate BMS views.

1 Like

I started with that node as errors typically lead to other errors which slowly compound themselves as you go, so best to remove the first error and work your way along. Since you’ve gathered a view template, my guess is that this is the first issue as the parameter names are different. It’s unlikely you want to duplicate your template anyway, and definitely not duplicate it as a dependent (how can you duplicate a template as a dependent?). So i’d start by changing your collector to the method @Kulkul illustrated. If it still is throwing the same error, please upload your DYN and a sample RVT file to test it on to either here or another file share (google drive, dropbox, box, one drive, etc) so we can be sure we’re helping with the right solution.

2 Likes

Thank you very much for your help. I solved it!! :grinning:

Hi mate,

Can I get the script or maybe the package that you used?
thank you so much mate