DirectShapeFramework 1.1.1
dotnet add package DirectShapeFramework --version 1.1.1
NuGet\Install-Package DirectShapeFramework -Version 1.1.1
<PackageReference Include="DirectShapeFramework" Version="1.1.1" />
paket add DirectShapeFramework --version 1.1.1
#r "nuget: DirectShapeFramework, 1.1.1"
// Install DirectShapeFramework as a Cake Addin #addin nuget:?package=DirectShapeFramework&version=1.1.1 // Install DirectShapeFramework as a Cake Tool #tool nuget:?package=DirectShapeFramework&version=1.1.1
This light weight and easy-to-use library helps to visualize and analyze hidden Revit Geometry, Bounding Boxes, Vectors, lines, points and so on. It is extremely usefull for coordinators and Revit API programmers.
How it works?
This framework uses Revit API DirectShape class to visualize hidden geometry as a real Generic Model instance. It helps you to analyze hidden geometry, check demensions and increase your performance in Revit API Geometry projects.
Click 👆 on the image below 🔰 to watch a small gif demo of visualising element's Bounding Box using Direct Shape Framework.
Installation
Install as .nuget package and enjoi ⭐
Features
- Highlight Geometry
- Highlight Point
- Highlight Vector
- Highlight Face
- Highlight Curve
- Highlight BoundingBox
- Highlight Plane
Highlight Geometry
Creates a copy of selected element in the form of DirectShape element.
IList<GeometryObject> geometry = element.get_Geometry(new Options()).Where(x=>x.IsElementGeometry).ToList();
//Use this method inside transaction
Highlight.Geometry(document, geometry);
//overload for single GeometryObject
Highlight.Geometry(document, geometry.First());
Highlight Point
Placess a DirectShape point by entered coordinates. In this example element's location point is used.
if (element is FamilyInstance familyInstance && familyInstance.Location is LocationPoint locationPoint)
//Use this method inside transaction
Highlight.Point(document, locationPoint.Point);
Highlight Vector
Placess a DirectShape point by vectors start point and creates a visible line of predefined lenghth to show direction of vector. In this example element's FacingOrientation vector is used.
if (element is FamilyInstance instance && instance.Location is LocationPoint locationPoint)
//Use this method inside transaction
Highlight.Vector(document, instance.FacingOrientation, locationPoint.Point);
<a id="highlight-face">Highlight Face (Experimental)
Places a DirectShape geometry to highlight selected Face.
var wallFaces = HostObjectUtils.GetSideFaces(wall, ShellLayerType.Exterior);
var geometryObject = wall.GetGeometryObjectFromReference(wallFaces.First());
if (geometryObject is Face face)
//Use this method inside transaction
Highlight.Face(document, face);
Highlight Curve
Creates a number of DirectShape points to visualise a curve. In this example LocationCurve of wall was used.
if (instance.Location is LocationCurve locationCurve)
{
Highlight.CurveByPoints(document, locationCurve.Curve);
}
Highlight BoundingBox
Creates rectangular DirectShape element to visualise element's BoundingBox.
//Use this method inside transaction
Highlight.BoundingBox(document, instance.get_BoundingBox(null));
Highlight Plane
Creates geometry to visualise Revit API Plane element
//Use this method inside transaction
var elevation = level.Elevation;
// Create a horizontal plane in the XY direction
var origin = new XYZ(0, 0, elevation); // Origin at the level's elevation
var normal = XYZ.BasisZ; // Normal in the Z direction
var levelPlane = Plane.CreateByNormalAndOrigin(normal, origin);
Highlight.Plane(document, levelPlane, 100, 100);
Supported Revit versions
DirectShapeFramework is based on .Net Framework 4.7.2. It is supported by Revit 2019 or higher.
Found a bug or want to contribute?
Please see CONTRIBUTING.md for more information about how to report a bug, suggest echancements and contribute.
License
This project uses MIT license. Read LICENSE.md for more information.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- Nice3point.Revit.Api.RevitAPI (>= 2019.2.11)
- Nice3point.Revit.Api.RevitAPIUI (>= 2019.2.11)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
# Release 1.1.1
## 🚀 Features
- ✨ New overload for `Highlight.Face()` method, eliminating the need for the Element parameter (old overload is now obsolete)
- ✨ New feature to highlight Plane
## 🛠️ Fixes
- 🔧 Fix bugs in `Highlight.Face()` method
- 🔧 Fix bugs in `Highlight.Plane()` method