Coder Social home page Coder Social logo

direct-shape-framework's Introduction

logo

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. demo

Installation

Install as .nuget package and enjoi โญ

Features

Highlight Geometry

Creates a copy of selected element in the form of DirectShape element.

Highlight Geometry

   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.

Highlight Point

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.

Highlight Vector

if (element is FamilyInstance instance && instance.Location is LocationPoint locationPoint)
    //Use this method inside transaction
    Highlight.Vector(document, instance.FacingOrientation, locationPoint.Point);

Highlight Face (Experimental)

Places a DirectShape geometry to highlight selected Face.

Highlight 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, wall, face);

Highlight Curve

Creates a number of DirectShape points to visualise a curve. In this example LocationCurve of wall was used.

Highlight Curve

if (instance.Location is LocationCurve locationCurve)
{
    Highlight.CurveByPoints(document, locationCurve.Curve);
}

Highlight BoundingBox

Creates rectangular DirectShape element to visualise element's BoundingBox.

Highlight BoundingBox

//Use this method inside transaction
Highlight.BoundingBox(document, instance.get_BoundingBox(null));

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.

direct-shape-framework's People

Contributors

pa1best avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.