1 / 25

Presenting Your Analysis Data in Autodesk® Revit® Architecture 2011

Presenting Your Analysis Data in Autodesk® Revit® Architecture 2011. Harry Mattison Principal Engineer – Revit API, Autodesk. How do you go from this…. To this?. The Answer is…. The Revit Analysis Visualization Framework. Analysis Visualization Framework (AVF) Is:. New in 2011

cybil
Download Presentation

Presenting Your Analysis Data in Autodesk® Revit® Architecture 2011

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Presenting Your Analysis Data in Autodesk® Revit® Architecture 2011 Harry Mattison Principal Engineer – Revit API, Autodesk

  2. How do you go from this…

  3. To this?

  4. The Answer is… The Revit Analysis Visualization Framework

  5. Analysis Visualization Framework (AVF) Is: • New in 2011 • Able to display data on faces, curves, and free points • Data and display are not persistent in the Revit model. • Images can be saved in the Revit model or exported.

  6. Wide Range of AVF Uses Avatech Solutions Scan To BIM • Imports 3D laser scanning datato Revit

  7. Wide Range of AVF Uses Autodesk Solar Radiation Technology Preview • Compute and display impact of solar energy

  8. Wide Range of AVF Uses • Display image on Revit geometry http://thebuildingcoder.typepad.com/blog/2010/06/display-webcam-image-on-building-element-face.html

  9. A Video Overview

  10. Some Key Classes • SpatialFieldManager Create or reuse this manager object for the desired view 2) AddSpatialFieldPrimitive Create an empty analysis results container 3) FieldDomainPoints Base class for points where results will be displayed 4) FieldValues One or more values at each domain point

  11. Basic AVF Example SpatialFieldManagersfm = SpatialFieldManager.CreateSpatialFieldManager(doc.ActiveView, 1); intprimitiveIndex = sfm.AddSpatialFieldPrimitive(); IList<XYZ> pts = new List<XYZ>(); pts.Add(new XYZ(0, 0, 0)); // one point of data at origin FieldDomainPointsByXYZpnts = new FieldDomainPointsByXYZ(pts); // ByXYZ for points in 3-space, ByUV for points on face, // ByParameter for points on curve List<double> doubleList = new List<double>(); doubleList.Add(0); // one value corresponding to the one point in the pts list IList<ValueAtPoint> valueList = new List<ValueAtPoint>(); ValueList.Add(new ValueAtPoint(doubleList)); // create ValueAtPoint list that contains doubleList FieldValuesfieldValues = new FieldValues(valueList); // create FieldValues container for the ValueList sfm.UpdateSpatialFieldPrimitive(primitiveIndex, pnts, fieldValues); // Update the primitive

  12. But First Your View Needs a Display Style If no Analysis Display Style is set, your results will not be shown Document doc = commandData.Application.ActiveUIDocument.Document; AnalysisDisplayMarkersAndTextSettingsmarkerSettings = new AnalysisDisplayMarkersAndTextSettings(); // AnalysisDisplayColoredSurfaceSettings can be used for display on a face AnalysisDisplayColorSettingscolorSettings = new AnalysisDisplayColorSettings(); AnalysisDisplayLegendSettingslegendSettings = new AnalysisDisplayLegendSettings(); AnalysisDisplayStyle ads = AnalysisDisplayStyle.CreateAnalysisDisplayStyle(doc, "Markers 1", markerSettings, colorSettings, legendSettings); // create the display style doc.ActiveView.AnalysisDisplayStyleId = ads.Id; // apply the style to a view (in this case, the active view)

  13. AnalysisDisplayMarkersAndTextSettings • double MarkerSize • MarkerType (circle, square, triangle) • double Rounding • boolShowText • TextTypeId / SetTextTypeId

  14. AnalysisDisplayColoredSurfaceSettings • boolShowGridlines

  15. AnalysisDisplayColorSettings • ColorSettingsType (Gradient, Solid Color) • MaxColor • MinColor • Get/SetIntermediateColors colorSettings.ColorSettingsType = AnalysisDisplayStyleColorSettingsType.GradientColor; colorSettings.MaxColor = new Color(10, 10, 10); colorSettings.MinColor = new Color(250, 250, 250); IList<AnalysisDisplayColorEntry> intermediateColorList = new List<AnalysisDisplayColorEntry>(); intermediateColorList.Add(new AnalysisDisplayColorEntry(new Color(200, 200, 200))); intermediateColorList.Add(new AnalysisDisplayColorEntry(new Color(150, 150, 150))); intermediateColorList.Add(new AnalysisDisplayColorEntry(new Color(100, 100, 100))); colorSettings.SetIntermediateColors(intermediateColorList);

  16. AnalysisDisplayLegendSettings • intNumberOfSteps • double Rounding • boolShowDataDescription • boolShowDataName • boolShowLegend • boolShowUnits • TextTypeId / SetTextTypeId

  17. Units and Multipliers Results data can be displayed using one or more unit types IList<string> unitNames = new List<string>(); unitNames.Add(“Feet"); unitNames.Add("Inches"); IList<double> multipliers = new List<double>(); multipliers.Add(1); multipliers.Add(12); spatialFieldManager.SetUnits(unitNames, multipliers);

  18. Multiple Measurements Per Point Each point can have one or more associated values. The “Name” property of the Analysis Results controls which set of values are shown.

  19. Multiple Measurements Per Point SpatialFieldManagersfm = SpatialFieldManager.CreateSpatialFieldManager(view3D, 3); IList<string> measureNames = new List<string>(); measureNames.Add("January"); measureNames.Add("April"); measureNames.Add("July"); sfm.SetMeasurementNames(measureNames); List<double> doubleList = new List<double>(); IList<ValueAtPoint> valueList = new List<ValueAtPoint>(); doubleList.Add(u); doubleList.Add(u + 15); doubleList.Add(u + 30); valueList.Add(new ValueAtPoint(doubleList)); # of measurementsper point

  20. How to Offset Results from Curve or Face // find center of face UV min = face.GetBoundingBox().Min; UV max = face.GetBoundingBox().Max; UV faceCenter = new UV((max.U + min.U) / 2, (max.V + min.V) / 2); // create transform 2.5 feet from face Transform computeDerivatives = face.ComputeDerivatives(faceCenter); XYZ faceCenterNormal = computeDerivatives.BasisZ.Normalize().Multiply(2.5); Transform transform = Transform.get_Translation(faceCenterNormal); intidx = sfm.AddSpatialFieldPrimitive(face, transform);

  21. Tips & Tricks Can't create a manager if the view already has one, so check before creating one SpatialFieldManagersfm = SpatialFieldManager.GetSpatialFieldManager(doc.ActiveView); if (sfm != null) sfm.Clear(); // clear any existing results else sfm = SpatialFieldManager.CreateSpatialFieldManager(doc.ActiveView, 1); Find existing display style FilteredElementCollector collector = new FilteredElementCollector(doc); ICollection<Element> collection = collector.OfClass(typeof(AnalysisDisplayStyle)).ToElements(); vardisplayStyle = from element in collection where element.Name == "Colored Surface" select element; if (displayStyle.Count() == 1) view3D.AnalysisDisplayStyleId = displayStyle.First().Id;

  22. Improving Performance Don’t put too many points in any one Spatial Field Primitive for (int i = 0; i < 10000; i++) { points.Add(new XYZ(i, 0, 0)); doubleList.Add(i); valList.Add(new ValueAtPoint(doubleList)); doubleList.Clear(); if (i % 1000 == 0) // only put 1,000 points in each primitive { sfm.UpdateSpatialFieldPrimitive(primitiveIndex, new FieldDomainPointsByXYZ(points), new FieldValues(valList)); valList.Clear(); points.Clear(); primitiveIndex = sfm.AddSpatialFieldPrimitive(); } }

  23. Save View to File to Retain Results Display transaction.Start(); ImageExportOptions options = new ImageExportOptions(); options.ViewName = "Saved View"; ElementIdviewId = doc.SaveToProjectAsImage(options); transaction.Commit();

  24. Marker Size = 0 for Smallest Possible Markers

  25. SDK Samples • AnalysisVisualizationFramework/DistanceToSurfaces • AnalysisVisualizationFramework/SpatialFieldGradient

More Related