logo

Content Elements

Sometimes, we want to represent detailed content in Hypar models, such as furniture or other specific manufacturer products. For this purpose we utilize ContentElements, which represent an item of content by pointing to the URL of a hosted glTF file.

Creating a content element

  1. Create or obtain a glb file. The glb file format can be created in a number of applications or converted from a range of formats, including Elements itself. Any Hypar Model can be turned into a glTF file using model.ToGltf() from the Elements.Serialization.glTF.GltfExtensions class.
    1. πŸ’‘
      Coming soon: automated conversion of Revit Families to Content Elements. Contact the Hypar team for a sneak preview.
  1. Once you have a glTF file, which you need to host it at a publicly accessible URL. You could utilize a service like netlify, or a public Github repository to host the file.
    1. πŸ’‘
      Coming soon: Hypar's own content service will make it easier to upload and manage your own model content, without having to host anything yourself.
  1. Once you have a publicly hosted glTF file, you can create a ContentElement anywhere in your C# function code. Most of the information supplied to the constructor is optional:
    1. c#
      var contentElement = new ContentElement("https://hypar-content-catalogs.s3-us-west-2.amazonaws.com/da0d0a40-aff1-4bda-a118-8e432fa8b08c/Steelcase+Turnstone+-+Shortcut+-+Stool+-+Chair.glb", new BBox3(), 1, Vector3.XAxis, null) { IsElementDefinition = true };
It's not required, but typically you'll want to treat a content element as an element definition, so that you can make multiple instances of it. (See πŸ‘―β€β™€οΈElement Instances for details)