Message 1 of 4
Not applicable
06-26-2018
10:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I'm creating a routine that creates new plan views (structural plans) from the structural plans that are in my project, but these new structural plans will have a different view template.
The portion of the routine I made is as follows:
using (Transaction tx = new Transaction(doc, "View Creation"))
{
tx.Start();
// Create new views with desired template applied
foreach (View v in plantas)
{
ElementId levelId = v.GenLevel.Id;
ViewPlan vista = ViewPlan.Create(doc, vft.Id, levelId);
vista.Name = vista.Name + " - Thick";
vista.Name.Replace("(1)", "");
// Apply the template
vista.ViewTemplateId = vTemplate.Id;
}
tx.Commit();
} The problem is, that when I do this, Revit prompts a message telling that a unique name is needed, but in my code, after the view creation, I set a different name.
What am I missing here?
Thanks in advance!
Solved! Go to Solution.