0

I would like to access the sheet number of a "View view," with the Revit API. I have tried to search for the parameter belonging to a view however it is not listed as a parameter by intellisense. I can see in a document or project that it is a read only sheet number parameter.

    foreach (Element elem in collection)
            {

                View view = elem as View;

                if (view.ViewType == ViewType.FloorPlan)
                {
                    using (Transaction transView = new Transaction(doc, "Set Param"))
                    {
                        transView.Start();

                        int testScale = 100;
                        //set the scale of the view
                        view.Scale = testScale;
                        //get the name of the view
                        message += "\nView name: " + view.ViewName;
                        message += "\nScale after set: " + view.Scale;


                        transView.Commit();
                    }
                }
  • I just downloaded a great tool called "BipChecker", written by Jeremy Tammik and available through links on his blog: http://thebuildingcoder.typepad.com/blog/2011/09/unofficial-parameters-and-bipchecker.html. From running this tool, it looks like your parameter will be a BuiltIn Parameter named "VIEWPORT_SHEET_NUMBER" – Shelly Skeens Jul 29 '14 at 15:47
  • oki used viewSheet.views to access the views on a title block anyhow. – Frank Halliday Jul 30 '14 at 09:45

1 Answers1

0

Shelly is correct. You would need to access it via parameters on the view. BIP is recommended but if you don't mind being language specific you can look up the parameter by it's name that appears in the Revit interface.

I would also recommend that you get the Revit Lookup tool and install it. It's great for looking through the Revit database and classes, etc. to find what you need...

sfaust
  • 2,089
  • 28
  • 54