Index: /cpp/frams/_demos/shapeconvert.cpp
===================================================================
--- /cpp/frams/_demos/shapeconvert.cpp	(revision 545)
+++ /cpp/frams/_demos/shapeconvert.cpp	(revision 546)
@@ -83,5 +83,5 @@
 	Model newmodel;
 	newmodel.open();
-	newmodel.buildUsingNewShapes(m, shape, thickness);
+	newmodel.buildUsingSolidShapeTypes(m, shape, thickness);
 	newmodel.close();
 
Index: /cpp/frams/model/geometry/modelgeometryinfo.cpp
===================================================================
--- /cpp/frams/model/geometry/modelgeometryinfo.cpp	(revision 545)
+++ /cpp/frams/model/geometry/modelgeometryinfo.cpp	(revision 546)
@@ -7,14 +7,15 @@
 #include <frams/model/geometry/meshbuilder.h>
 
-void ModelGeometryInfo::findSizesAndAxesOfModel(const Model &model, const double density,
+void ModelGeometryInfo::findSizesAndAxesOfModel(const Model &input_model, const double density,
 	Pt3D &sizes, Orient &axes)
 {
+	SolidsShapeTypeModel model(input_model);
 	SListTempl<Pt3D> points;
 	MeshBuilder::ModelApices apices(density);
-	apices.initialize(&model);
+	apices.initialize(&model.getModel());
 	apices.addAllPointsToList(points);
 	if (points.size() < 1) //maybe 1 or 2 points are also not enough for findSizesAndAxesOfPointsGroup() to work...
 	{
-		logPrintf("ModelGeometryInfo", "findSizesAndAxesOfModel", LOG_ERROR, "Empty points sample for model with %d part(s)", model.getPartCount());
+		logPrintf("ModelGeometryInfo", "findSizesAndAxesOfModel", LOG_ERROR, "Empty points sample for model with %d part(s)", model.getModel().getPartCount());
 		sizes = Pt3D_0;
 		axes = Orient_1;
@@ -65,6 +66,7 @@
 }
 
-double ModelGeometryInfo::volume(const Model &model, const double density)
+double ModelGeometryInfo::volume(const Model &input_model, const double density)
 {
+	SolidsShapeTypeModel model(input_model);
 	Pt3D lowerBoundary, upperBoundary;
 	boundingBox(model, lowerBoundary, upperBoundary);
@@ -90,9 +92,10 @@
 }
 
-double ModelGeometryInfo::area(const Model &model, const double density)
+double ModelGeometryInfo::area(const Model &input_model, const double density)
 {
+	SolidsShapeTypeModel model(input_model);
 	double area = 0.0;
 	
-	for (int partIndex = 0; partIndex < model.getPartCount(); partIndex+=1)
+	for (int partIndex = 0; partIndex < model.getModel().getPartCount(); partIndex+=1)
 	{
 		area += externalAreaOfPart(model, partIndex, density);
Index: /cpp/frams/model/model.cpp
===================================================================
--- /cpp/frams/model/model.cpp	(revision 545)
+++ /cpp/frams/model/model.cpp	(revision 546)
@@ -973,8 +973,8 @@
 				j->p2_refno = j->part2->refno;
 				if (checklevel > 0)
-					{
+				{
 					j->part1->mass += 1.0;
 					j->part2->mass += 1.0;
-					}
+				}
 				if ((j->usedelta) && ((j->d.x != JOINT_DELTA_MARKER) || (j->d.y != JOINT_DELTA_MARKER) || (j->d.z != JOINT_DELTA_MARKER)))
 				{ // delta positioning -> calc. orient.
@@ -1336,10 +1336,10 @@
 }
 
-void Model::buildUsingNewShapes(const Model& old, Part::Shape default_shape, float thickness)
-{
-	for (int i = 0; i < old.getJointCount(); i++)
-	{
-		Joint *oj = old.getJoint(i);
-		Part *p = addNewPart(default_shape);
+void Model::buildUsingSolidShapeTypes(const Model& src_ballandstick_shapes, Part::Shape use_shape, float thickness)
+{
+	for (int i = 0; i < src_ballandstick_shapes.getJointCount(); i++)
+	{
+		Joint *oj = src_ballandstick_shapes.getJoint(i);
+		Part *p = addNewPart(use_shape);
 		p->p = (oj->part1->p + oj->part2->p) / 2;
 		Orient o;
@@ -1350,15 +1350,15 @@
 		p->scale.z = thickness;
 	}
-	for (int i = 0; i < old.getPartCount(); i++)
-	{
-		Part *op = old.getPart(i);
-		for (int j = 0; j < old.getJointCount(); j++)
-		{
-			Joint *oj = old.getJoint(j);
+	for (int i = 0; i < src_ballandstick_shapes.getPartCount(); i++)
+	{
+		Part *op = src_ballandstick_shapes.getPart(i);
+		for (int j = 0; j < src_ballandstick_shapes.getJointCount(); j++)
+		{
+			Joint *oj = src_ballandstick_shapes.getJoint(j);
 			if ((oj->part1 == op) || (oj->part2 == op))
 			{
-				for (int j2 = j + 1; j2 < old.getJointCount(); j2++)
+				for (int j2 = j + 1; j2 < src_ballandstick_shapes.getJointCount(); j2++)
 				{
-					Joint *oj2 = old.getJoint(j2);
+					Joint *oj2 = src_ballandstick_shapes.getJoint(j2);
 					if ((oj2->part1 == op) || (oj2->part2 == op))
 					{
@@ -1369,4 +1369,22 @@
 			}
 		}
+	}
+}
+
+SolidsShapeTypeModel::SolidsShapeTypeModel(const Model& m, Part::Shape use_shape, float thickness)
+{
+	using_model = converted_model = NULL;
+	if (m.getShapeType() == Model::SHAPE_BALL_AND_STICK)
+	{
+		converted_model = new Model;
+		converted_model->open();
+		converted_model->buildUsingSolidShapeTypes(m, use_shape, thickness);
+		converted_model->close();
+		using_model = converted_model;
+	}
+	else
+	{
+		converted_model = NULL;
+		using_model = &m;
 	}
 }
Index: /cpp/frams/model/model.h
===================================================================
--- /cpp/frams/model/model.h	(revision 545)
+++ /cpp/frams/model/model.h	(revision 546)
@@ -414,6 +414,6 @@
 	void rotate(const Pt3D& angles) { Orient o = Orient_1; o.rotate(angles); rotate(o); }
 
-	/// build this model using new shapes, based on the provided model that uses old shapes. See also shapeconvert.cpp.
-	void buildUsingNewShapes(const Model& src_old_shapes, Part::Shape default_shape = Part::SHAPE_CYLINDER, float thickness = 0.2);
+	/// build this model using solid shape types, based on the provided ball-and-stick model. See also shapeconvert.cpp.
+	void buildUsingSolidShapeTypes(const Model& src_ballandstick_shapes, Part::Shape use_shape = Part::SHAPE_CYLINDER, float thickness = 0.2);
 
 #ifdef EASYMAPDEBUG
@@ -448,3 +448,27 @@
 };
 
+/**
+   An object of this class is created from a Model and returns the solids-type const Model& regardless of the source Model shape type.
+   For solids-type Models, the same source Model reference is returned.
+   For ball-and-stick-type Models, the new temporary Model is created (using Model::buildUsingSolidShapeTypes).
+   Useful for making the solids-only code work for both solids Models and ball-and-stick Models, without if's and special cases, like in this example:
+   
+   void fun(const Model& input) // 'input' can be any shape type
+   {
+      SolidsShapeTypeModel converted(input); // 'converted' contains either 'input' or the new solids-type Model created from 'input'
+      functionAcceptingSolidsTypeModel(converted); // operator const Model&() is called automatically because of the function signature
+      int n=converted.getModel().getPartCount(); // getting the const Model& explicitly (converted.getPartCount() would fail)
+   }
+ */
+class SolidsShapeTypeModel
+{
+public:
+	Model *converted_model;
+	const Model *using_model;
+	SolidsShapeTypeModel(const Model& m, Part::Shape use_shape = Part::SHAPE_CYLINDER, float thickness = 0.2);
+	operator const Model&() const { return *using_model; }
+	const Model& getModel() const { return *using_model; }
+	~SolidsShapeTypeModel() { if (converted_model) delete converted_model; }
+};
+
 #endif
