The mdlXxx_create functions take an element template as the second parameter. For example...
mdlCircle_createBy3Pts (MSElementP out, MSElementP in, DPoint3dP pt, int fillMode)
The purpose of that template is to provide the new element with a set of characteristics. That way, we don't have to set symbology on the new element, for example.
Why is the template a non-const pointer? If the template element is not modified, then a const pointer should be fine. Is it safe to perform a const_cast if my template element is const? For example, is the following reasonable?
ElementHandle eh (...); MSElement circle; DPoint3d origin { 1., 1., 0. }; mdlCircle_createBy3Pts (&circle, const_cast<MSElementP>(eh.GetElementCP ()), &origin, 0);
Note that ElementHandle does not have a member GetElementP().