创建一个体积曲面


体积曲面表示了一个文档中两个三角网曲面或网格曲面的区别或合成。你可以用TInVolumeSurface类或GridVolumeSurface类的Create()方法创建一个体积曲面。

本例提示用户选择基底曲面和比较曲面,然后通过它们创建一个新的TinVolumeSurface。为了不影响(创建曲面的)主题,promptForTinSurface()的处理被省略了。

CommandMethod("CreateTinVolumeSurface")]
public void CreateTinVolumeSurface()
{
    using (Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction())
    {
        string surfaceName = "ExampleVolumeSurface";
        // Prompt user to select surfaces to use
        // promptForTinSurface uses Editor.GetEntity() to select a TIN surface
        ObjectId baseId = promptForTinSurface("Select the base surface");
        ObjectId comparisonId = promptForTinSurface("Select the comparison surface");

        try
        {
            // Create the surface
            ObjectId surfaceId = TinVolumeSurface.Create(surfaceName, baseId, comparisonId);
            TinVolumeSurface surface = surfaceId.GetObject(OpenMode.ForWrite) as TinVolumeSurface;
        }

        catch (System.Exception e)
        {
            editor.WriteMessage("Surface create failed: {0}", e.Message);
        }

        // commit the create action
        ts.Commit();
    }
}

父主题:

创建曲面

results matching ""

    No results matching ""