Ejemplo n.º 1
0
        public void AddFeatureLinesToAllSurface(ObjectIdCollection featureIds, ObjectId surfaceId)
        {
            Debug.WriteLine("Starting AddFeatureLinesToAllSurface");
            using (Application.DocumentManager.MdiActiveDocument.LockDocument())
            {
                using (Transaction tr = CivilApplicationManager.StartTransaction())
                {
                    C3DLandDb.TinSurface surface = surfaceId.GetObject(OpenMode.ForRead) as C3DLandDb.TinSurface;
                    surface.UpgradeOpen();
                    surface.BreaklinesDefinition.AddStandardBreaklines(featureIds, 1.0, 2.0, 2.0, 0.0);
                    surface.DowngradeOpen();

                    tr.Commit();
                    Debug.WriteLine("Ending AddFeatureLinesToAllSurface");
                }
            }
        }
Ejemplo n.º 2
0
        public void AddCivil2016ElevationsToFeature(ObjectId surfaceId, ObjectId featureId, ObjectId siteId,
                                                    object o)
        {
            try
            {
                Debug.WriteLine("Starting AddCivil2016ElevationsToFeature");
                using (Application.DocumentManager.MdiActiveDocument.LockDocument())
                {
                    using (Transaction tr = CivilApplicationManager.StartTransaction())
                    {
                        var feature = (C3DLandDb.FeatureLine)featureId.GetObject(OpenMode.ForRead);
                        feature.UpgradeOpen();
                        feature.AssignElevationsFromSurface(surfaceId, false);
                        feature.DowngradeOpen();

                        //Check and Refine Breakline
                        //FeatureLineManager.RecurseElevFromSurface();

                        var p3Dcollection = feature.GetPoints(FeatureLinePointType.AllPoints);
                        //var poly3d = new Polyline3d(Poly3dType.SimplePoly, p3Dcollection, true);

                        C3DLandDb.TinSurface surface = surfaceId.GetObject(OpenMode.ForRead) as C3DLandDb.TinSurface;
                        surface.UpgradeOpen();
                        ///Todo:Handle Breaklines for Water and Bulkhead
                        surface.BuildOptions.ExecludeMinimumElevation          = true;
                        surface.BuildOptions.MinimumElevation                  = 0.1;
                        surface.BuildOptions.CrossingBreaklinesElevationOption =
                            CrossingBreaklinesElevationType.UseNone;
                        surface.BreaklinesDefinition.AddStandardBreaklines(p3Dcollection, 1.0, 2.0, 2.0, 0.0);
                        surface.DowngradeOpen();

                        tr.Commit();
                        Debug.WriteLine("Ending AddCivil2016ElevationsToFeature");
                    }
                }
            }
            catch (Autodesk.AutoCAD.Runtime.Exception ex)
            {
            }
            catch (System.AccessViolationException ex)
            {
            }
        }
Ejemplo n.º 3
0
        public void AddCivil2016ElevationsToFeature(ObjectId surfaceId, ObjectId featureId, ObjectId siteId,
                                                    object o)
        {
            try
            {
                PGA.MessengerManager.MessengerManager.AddLog("Starting AddCivil2016ElevationsToFeature");
                using (Application.DocumentManager.MdiActiveDocument.LockDocument())
                {
                    using (Transaction tr = CivilApplicationManager.StartTransaction())
                    {
                        var feature = (C3DLandDb.FeatureLine)featureId.GetObject(OpenMode.ForRead);

                        if (feature == null)
                        {
                            return;
                        }

                        feature.UpgradeOpen();
                        feature.AssignElevationsFromSurface(surfaceId, false);
                        feature.DowngradeOpen();

                        //Check and Refine Zeros from Breakline
                        FeatureLineManager.SendMessage(feature);
                        FeatureLineManager.CheckElevFromFeatureLine(feature.ObjectId);

                        var p3Dcollection = feature.GetPoints(FeatureLinePointType.AllPoints);

                        C3DLandDb.TinSurface surface = surfaceId.GetObject(OpenMode.ForRead) as C3DLandDb.TinSurface;

                        if (surface == null)
                        {
                            return;
                        }

                        surface.UpgradeOpen();
                        ///Todo:Handle Breaklines for Water and Bulkhead
                        ///
                        surface.BuildOptions.NeedConvertBreaklines             = true;
                        surface.BuildOptions.ExecludeMinimumElevation          = true;
                        surface.BuildOptions.MinimumElevation                  = 0.1;
                        surface.BuildOptions.CrossingBreaklinesElevationOption =
                            CrossingBreaklinesElevationType.UseLast; ///Todo: Changed 2/19/17 from None.
                        surface.BreaklinesDefinition.AddStandardBreaklines(p3Dcollection, 1.0, 2.0, 2.0, 0.0);
                        surface.DowngradeOpen();

                        tr.Commit();
                        PGA.MessengerManager.MessengerManager.AddLog("Ending AddCivil2016ElevationsToFeature");
                    }
                }
            }
            catch (Autodesk.AutoCAD.Runtime.Exception ex)
            {
                PGA.MessengerManager.MessengerManager.LogException(ex);
            }
            catch (System.AccessViolationException ex)
            {
                PGA.MessengerManager.MessengerManager.LogException(ex);
            }
            catch (System.Exception ex)
            {
                PGA.MessengerManager.MessengerManager.LogException(ex);
            }
        }