views:

35

answers:

1

Hi All,

I am using C# Express Edition - 2008 developing tool. I intend to form a 3D mesh object by using an array of 100.000 items. To be able to form the 3D mesh, I must use thousands of "mesh.TriangleIndices.Add(...);" . But this is not a good application due to unnecessary code amount. I have to use the shortened coding, such as "mesh.Tai.Add(...);".

After executing Refactoring>Rename, system gives the following error message: "Rename failed. The definition is not in C# project in the current solution"

How to solve this problem ? Please, help ! :-)

Kind Regards Oner YILMAZ

A: 

TriangleIndices is the name of a property of the MeshGeometry3D class that is in a referenced assembly. You cannot rename it.

If you must create the mesh with code (better would be to use a modeling tool to create the mesh as a file) consider using a helper method to shorten things:

private void AddTI(MeshGeometry3D mesh, int index)
{
    mesh.TriangleIndices.Add(index);
}

Seriously consider why you're doing this, though. Modeling tools make easy work of creating meshes in standard formats, and you only need a couple of lines of code to load a mesh file.