/// <summary> /// Gets center of gravity for given instance of <see cref="ModelObject"/> /// </summary> /// <param name="modelObject">Model object to be inquired.</param> /// <returns>Point of center of gravity global coordinate system.</returns> public static Geometry3d.Point GetGravityCenter(this ModelObject modelObject) { ArrayList propertyNames = new ArrayList() { "COG_X", "COG_Y", "COG_Z" }; Hashtable inquireResult = new Hashtable(); if (!modelObject.GetDoubleReportProperties(propertyNames, ref inquireResult)) { throw new Exception("Failed to read center of gravity."); } ; var globalCog = new Geometry3d.Point() { X = double.Parse(inquireResult[propertyNames[0]].ToString()), Y = double.Parse(inquireResult[propertyNames[1]].ToString()), Z = double.Parse(inquireResult[propertyNames[2]].ToString()) }; return(globalCog); }