Sometimes, we want to represent detailed content in Hypar models, such as furniture or other specific manufacturer products. For this purpose we utilize
ContentElement
s, which represent an item of content by pointing to the URL of a hosted glTF file. Creating a content element
- 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 usingmodel.ToGltf()
from theElements.Serialization.glTF.GltfExtensions
class.
Coming soon: automated conversion of Revit Families to Content Elements. Contact the Hypar team for a sneak preview.
- 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.
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.
- 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:
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)