View titles based on sheet location (grid location)

View titles based on sheet location (grid location)

Anonymous
Not applicable
450 Views
1 Reply
Message 1 of 2

View titles based on sheet location (grid location)

Anonymous
Not applicable

Typically view titles go on a sheet and number both numerically and sequentially (revit does this automatically). How do we set it to base the view title, based on sheet placement (see attached), I would like to go with the sheet format attached. we would just propose the names based on the numbers and letters shown.

 

If you could help i will be very grateful

0 Likes
451 Views
1 Reply
Reply (1)
Message 2 of 2

BenoitE&A
Collaborator
Collaborator

Hey iwilson,

So we don't know much about your process of creating sheets:

1) let's assume you have people in your company who create them. Then you can create an add-in or a macro modifying the names while they are done, to respect your policy.

Your add-in will look like :

 

// Filter in all views to get the sheets you want

FilterElementCollector collector = new FilterElementCollector(uidoc.Document, uidoc.ActiveView);

collector.OfClass(typeof(Autodesk.Revit.DB.ViewPlan));

// Start transaction to be able to modify 

using (Transaction t = new Transaction(uidoc.Document, "Renomme les vues selectionnees"))
{
t.Start();

 

foreach( Element e in collector) 

{

// Convert to viewPlan

ViewPlan vp = e as ViewPlan;

 

using (SubTransaction subt = new SubTransaction(uidoc.Document))
{
subt.Start();
vp.ViewName = theNameIWant;
subt.Commit();
}

t.Commit();
}

 

2) if you create your views programmatically you can insert this piece of code

 

Have fun !

Benoit


Benoit FAVRE
CEO of etudes & automates
www.etudesetautomates.com/
0 Likes