コード例 #1
0
        public void CDS_TinSurfacePropertiesDemo()
        {
            ObjectId surfaceId = promptForTinSurface();

            if (ObjectId.Null == surfaceId)
            {
                write("\nNo TIN Surface object was selected.");
                return; // We don't have a surface; we can't continue.
            }

            using (Transaction tr = startTransaction())
            {
                TinSurface surface = surfaceId.GetObject(
                    OpenMode.ForRead) as TinSurface;
                write("\nInformation for TIN Surface: " + surface.Name);
                writeGeneralProperites(surface.GetGeneralProperties());
                writeTerrainProperties(surface.GetTerrainProperties());
                writeTinSurfaceProperties(surface.GetTinProperties());
            }
        }
コード例 #2
0
        public void TinSurfacePropertiesWriter()

        {
            var doc = Active.MdiDocument;
            var db  = doc.Database;

            var surfaces = GetSurfaceEntityIDs(db);

            //Write PlaceHolder

            FeatureCount();

            foreach (var surfid in surfaces)
            {
                ObjectId surfaceId = surfid;

                if (ObjectId.Null == surfaceId)

                {
                    return; // We don't have a surface; we can't continue.
                }

                using (var tran = db.TransactionManager.StartTransaction())

                {
                    TinSurface surface = surfaceId.GetObject(

                        OpenMode.ForRead) as TinSurface;

                    if (surface.Name.Contains("GREEN"))
                    {
                        greens++;
                    }
                    else if (surface.Name.Contains("FAIRWAY"))
                    {
                        fairway++;
                    }
                    else if (surface.Name.Contains("BUNKER"))
                    {
                        bunker++;
                    }
                    else if (surface.Name.Contains("TEEBOX") ||
                             surface.Name.Contains("TEE"))
                    {
                        teebox++;
                    }


                    _write("\nInformation for TIN Surface: " + surface.Name);

                    try
                    {
                        writeGeneralProperites(surface.GetGeneralProperties());
                        writeTerrainProperties(surface.GetTerrainProperties());
                        writeTinSurfaceProperties(surface.GetTinProperties());
                    }
                    catch (System.Exception ex)
                    {
                        COMS.MessengerManager.LogException(ex);
                        _write("Failure retrieving Surface Properties!");
                    }

                    tran.Commit();
                }
            }

            AddFooterInfo();
        }