Author Topic: ( C3D 2008 ) Add Multiple Surface Boundaries  (Read 5620 times)

0 Members and 1 Guest are viewing this topic.

Guest

  • Guest
( C3D 2008 ) Add Multiple Surface Boundaries
« on: May 18, 2007, 11:21:38 AM »
Is it possible to add multiple surface boundaries at one time instead of having to right-click on Boundaries -> Add -> name it, select the type, etc.. click OK, select boundary, wash, rinse, repeat?  I now this wasn't an option in LDT '07; just hoping it was hidden somewhere in C3D 2008 that I haven't found yet.

sinc

  • Guest
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #1 on: May 18, 2007, 11:36:50 AM »
I haven't found a lot of reason to use boundaries.  Instead, I just delete TIN lines.  The boundary auto-snaps to the new limits of the TIN.  This also works for cutting sections out of the middle of a surface.  (Note that with the 2008 version, the "Delete Lines" option for editing surface requires you to type options like "CP" (crossing polygon), "CW" (crossing window), or "F" (fence) in order to select multiple TIN lines at once.)

But I can see how you might want to add multiple boundaries at once in some situations.  Unfortunately, I doubt there's a way.  One of the most-annoying aspects of C3D is how many things must be done by selecting items one at a time.  This comes up over and over and over and over again.

Guest

  • Guest
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #2 on: May 18, 2007, 11:42:57 AM »
We've always used the HIDE option of BOUNDARIES when creating an existing surface.  We use the building outlines as the boundary.

99% of the time we get a survey file and nothing more; no points, DTMs, etc...  so we have to create an existing grade surface using the lines, plines and sometimes (and I stress SOMETIMES), contour objects within the survey drawing.  So what we've done in the past is create an OUTER boundary and then all of the building outlines would be a hidden boundary.

Is there a different/better way to do this in C3D 2008?

sinc

  • Guest
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #3 on: May 18, 2007, 12:01:09 PM »
That's probably easier than deleting TIN lines, especially with a lot of buildings.  I think the only other way is using a wipeout to cover up the contours, which might be easier, but might not be what you want.  Those are the only three ways I can think of.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #4 on: May 18, 2007, 12:04:16 PM »
Uh, why is the building outline NOT entered in as a fault, or break line? In this manner the contours should NOT cross the building pad, and TWO not require an Infill Grading such that the surface volumes are not affected.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Guest

  • Guest
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #5 on: May 18, 2007, 01:23:16 PM »
No way in hell am I going to spend the time to create breaklines for 20-50 buildings with 20-100+ vertices for the outline.  That's just WAAAY too time-consuming and for what we need, the boundary option has always worked out well for us.

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #6 on: May 18, 2007, 03:12:21 PM »
Since boundaries are exposed in the API it shouldn't be too difficult to whip up an addition to the now infamous SincPac3d. I'm going to be free this afternoon, I'll see what I can come up with.

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #7 on: May 18, 2007, 08:46:11 PM »
Here's an addition for SincPac3D-2008. I'm not providing a DLL as SInc has added other things that I haven't yet incorporated here. You can either download Sinc's source code, add this folder & class to it, and recompile OR you can wait for Sinc to include it in his next build. This does have room for improvement, but I've run out of time for now. The biggest issue is that it will fail if you provide a prefix for the boundary name that would result in duplicate boundary names. I have it using the prefix and add an Integer to it, starting with 0, for the description. So if the user selects 3 plines and answers "Buildings" for the prefix, the resulting boundary object description will be Buildings0, Buildings1, Buildings2. If the user uses "Buldings" a second time, an invisible error will be thrown that has once placed C3D into an unstable state.

But, used carefully, it works quite well and quick.

sinc

  • Guest
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #8 on: May 19, 2007, 08:57:41 AM »
Uh, why is the building outline NOT entered in as a fault, or break line? In this manner the contours should NOT cross the building pad, and TWO not require an Infill Grading such that the surface volumes are not affected.

The reason that doesn't work for us is that, ideally, the building pads come in as survey figures.  As such, they come in with each corner at a different elevation, not as a flat pad, and will still have contours drawn across them.

sinc

  • Guest
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #9 on: May 19, 2007, 09:00:03 AM »
Here's an addition for SincPac3D-2008.

Great!  I think I'll be able to get it incorporated sometime this weekend, and post a new DLL.

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #10 on: May 19, 2007, 02:49:20 PM »
ideally, the building pads come in as survey figures.
I haven't used figures. Are these AECC objects or just 3d plines? My MultiHide routine just gets plines right now. If I have some time today I'll do some more research on this and maybe post some revised code.

Update - I now see that the figures are their own object type. And, of course, just adding them to the selectionset does not work. I'll keep looking at how to use them.
« Last Edit: May 19, 2007, 05:06:38 PM by Jeff_M »

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #11 on: May 19, 2007, 08:40:02 PM »
I now have a version working with Figures, however it does not work like the built-in Add boundary function. In C3D, adding a boundary that is a Figure is no different than selecting a pline. I cannot find a way to use the Figure object in code. Instead, I've had to explode the figure (which leaves the figure in the drawing), add the resulting pline to the drawing, use the pline to add the boundary.

This method leaves an extra object in the drawing, but I'm not sure how else to do this. The user could place the new plines on a frozen layer. Or I could make the new plines invisible......Any other ideas are welcome.
Code: [Select]
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Interop.Common;
using Autodesk.AECC.Interop.Land;
using Autodesk.AECC.Interop.UiLand;
using AutocadUtilities;
using Civil3DUtilities;

namespace SincpacC3D.Create_Hide_Boundaries
{
    /// <summary>
    /// Create multiple Hide Boundaries for a Surface
    /// </summary>
    public class HideBoundaries
    {
        public HideBoundaries()
        {
        }

        private AeccSurface oSurf ;

        [CommandMethod("MULTIHIDE")]
        public void MultiHide()
        {
            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
            C3DUtil c3dUtil = new C3DUtil();
            AeccDocument doc = c3dUtil.AeccDoc;
            Database db = Application.DocumentManager.MdiActiveDocument.Database; PromptEntityOptions ePrmpt = new PromptEntityOptions("");
            ePrmpt.Message = "\nSelect surface to add hidden boundaries to: ";
            PromptEntityResult eResult = ed.GetEntity(ePrmpt);
            if (eResult.Status == PromptStatus.OK)
            {
                using (Transaction tr = db.TransactionManager.StartTransaction())
                {
                    try
                    {
                        Entity oEnt = tr.GetObject(eResult.ObjectId, OpenMode.ForRead, false) as Entity;
                        oSurf = oEnt.AcadObject as AeccSurface;
                        BlockTableRecord curSpace = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
                        PromptSelectionOptions sPrmpt = new PromptSelectionOptions();
                        sPrmpt.MessageForAdding = "\nSelect plines for Hide boundary(ies): ";
                        sPrmpt.MessageForRemoval = "\nPlines to remove from selection set: ";
                        TypedValue[] filter = new TypedValue[1];
                        filter[0] = new TypedValue(0, "*POLYLINE,AECC_SVFIGURE");
                        SelectionFilter ssFilter = new SelectionFilter(filter);
                        PromptSelectionResult ssResult;
                        ssResult = ed.GetSelection(sPrmpt, ssFilter);
                        if (ssResult.Status == PromptStatus.OK)
                        {
                            PromptResult strResult = ed.GetString("Prefix for boundary definitions: ");
                            int i = 0;
                            ObjectId[] objIds = ssResult.Value.GetObjectIds();
                            foreach (ObjectId oId in objIds)
                            {
                                Entity oPline = tr.GetObject(oId, OpenMode.ForRead, false) as Entity;
                                Polyline testPline1 = oPline as Polyline;
                                if (testPline1 == null)
                                {
                                    Polyline2d testPline2 = oPline as Polyline2d;
                                    if (testPline2 == null)
                                    {
                                        Polyline3d testPline3 = oPline as Polyline3d;
                                        if (testPline3 == null)
                                        {
                                            DBObjectCollection oExpObjs = new DBObjectCollection();
                                            oPline.Explode(oExpObjs);
                                            oPline = oExpObjs[0] as Entity;
                                            curSpace.AppendEntity(oPline);
                                            tr.AddNewlyCreatedDBObject(oPline, true);
                                        }
                                    }
                                }
                                try
                                {
                                    oSurf.Boundaries.Add((AcadEntity)oPline.AcadObject, strResult.StringResult + i, AeccBoundaryType.aeccBoundaryHide, true, 0.10);
                                    i++;
                                }
                                catch
                                {
                                }
                            }
                            oSurf.Rebuild();
                        }
                        tr.Commit();
                    }
                    catch
                    {
                    }
                }
            }

        }
    }
}

sinc

  • Guest
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #12 on: May 20, 2007, 09:01:07 AM »
I don't think exploding the survey figures is what we want to do.  That breaks the logical interconnectedness of the survey figure and the survey data.

Perhaps, if the selected object is a survey figure, the best solution might be to create a 3D-polyline that duplicates the figure, and add the polyline as a hide boundary.  This creates data that is not linked to the survey data, which means the boundary won't be automatically removed if the survey network is reset, but that might be OK, and better than exploding a survey figure.

But then again, it might not be that big an issue, exploding the survey figure.  There are already huge problems in this area, which may mean that this one is not a big deal.  For example, it is now possible to graphically-edit survey points in the drawing, but the usefullness of the ability is degraded by the fact that the survey figures do not move with the points.

This might be something I need to play with a bit, and see what works best.
« Last Edit: May 20, 2007, 09:02:59 AM by sinc »

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #13 on: May 20, 2007, 11:57:31 AM »
No, no, no.....Exploding the figure in code does NOT explode THE figure.....it creates the resulting plines but leaves the original object intact. So after running the MultiHide command and you select a figure for the boundary, you will have a new pline drawn over the top of the figure....but BOTH objects will be there.
« Last Edit: May 20, 2007, 11:58:38 AM by Jeff_M »

sinc

  • Guest
Re: ( C3D 2008 ) Add Multiple Surface Boundaries
« Reply #14 on: May 20, 2007, 12:58:36 PM »
Yeah, I noticed that.  So yeah, we end up with a duplicate line, but the original survey figure stays there.  That should work well enough.

I fixed the duplicate-name problem.  I think I'll also try adding a way to control the layer of the duplicate line, so the user can have them go onto a specific layer if desired.  I should be able to get a DLL posted later today.