Creating ElementAspects
Use IModelDb.Elements.insertAspect to insert a new ElementAspect into an IModelDb. This method takes as its input an ElementAspectProps or a subclass of it, which defines the class and all required properties of the new ElementAspect. The pattern is:
const aspectProps = {
classFullName: "SomeDomain:SomeAspectClass",
element: { id: elementId },
stringProp: "s1",
numberProp: 1,
};
withEditTxn(iModel, (txn) => txn.insertAspect(aspectProps));
Last Updated: 04 May, 2026
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.