Get Element's LevelId

Pretty much this. GetLevelId isn’t a method for model curves, but rather is inherited from the Element class, as model curves are a type of element. This method will only return valid results for the element types with a level, and model curves are not such a thing.

Returning the sketch plane and the level below or nearest level as shown is likely the best way forward, but be careful as planes which are not parallel to the global XY plane could cause accuracy issues, in which case returning a ‘null’ value may be preferable.

2 Likes