Create a new Structure and attach a pipe Problem.

Create a new Structure and attach a pipe Problem.

MikeEvansUK
Advisor Advisor
3,950 Views
19 Replies
Message 1 of 20

Create a new Structure and attach a pipe Problem.

MikeEvansUK
Advisor
Advisor

I have a code which re-attaches detached structures and pipes and am trying to adapt it to insert a new structure where there is none but everytime I run it it fails with a error, due to the current state of the object directly after the code below is run.

 

Public Function AddStructure(ByVal oNetwork As Network, ByVal startPoint As Point3d, ByVal oPipe As Pipe, ByVal oConnectorPositionType As ConnectorPositionType) As Boolean
Dim db As Database = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database
Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = db.TransactionManager
Dim tr As Transaction = db.TransactionManager.StartTransaction()


Dim m_bIsCreated As Boolean

 

Dim oPartsListId As ObjectId = m_doc.Styles.PartsListSet(1)
Dim oPartsList As PartsList = tr.GetObject(oPartsListId, OpenMode.ForWrite)

Dim oidStructure As ObjectId = Nothing

oidStructure = oPartsList(1)

Dim opfStructure As PartFamily = tr.GetObject(oidStructure, OpenMode.ForWrite)
Dim psizeStructure As ObjectId = opfStructure(0)
Dim oidNewStructure As ObjectId = ObjectId.Null
oNetwork.AddStructure(oidStructure, psizeStructure, startPoint, 0, oidNewStructure, True)
'oNetwork.AddStructure(oidStructure, psizeStructure, endPoint, 0, oidNewStructure, True)

'm_Editor.WriteMessage("@PipeSample: Create PipeNetwork Successfully!" + Convert.ToChar(10))
'MsgBox("Please zoom to the network with the name of " + oNetwork.Name)
m_bIsCreated = True
IDNewStructure = oidNewStructure
tr.Commit()

Return True
End Function

 

I have a transaction already running in the master sub and originally shared this transaction without comitting in this sub etc but have since tried adding a new transaction just in this sub but that still fails with the same error.

 

The Network & pipe is open for read. I am at a loss as to what is in a fit state to finalise the code and attach the pipe to the newly created structure.

 

Any ideas what I have done wrong here?

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

0 Likes
3,951 Views
19 Replies
Replies (19)
Message 2 of 20

redtransitconsultants
Collaborator
Collaborator

Could be because the Network and pipe are open for read and not Read/Write.

Steve Hill,Civil Designer / .NET Developer / AutoCAD and AutoCAD Civil 3D Certified Professional
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

http://redtransitconsultants.com/
Autodesk Exchange Store
Twitter | LinkedIn | YouTube

0 Likes
Message 3 of 20

augusto.goncalves
Alumni
Alumni
Can you describe the error or post an image?

As mentioned by Steve, it can be related to read/write permission, but that usually throw a "Not open for write" exception
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 4 of 20

MikeEvansUK
Advisor
Advisor

Here's some more information guy's.

 

oNetwork.AddStructure(oidStructure, psizeStructure, startPoint, 0, oidNewStructure, True)

 

oNewStruc = tr.GetObject(IDNewStructure, OpenMode.ForWrite, False)  
oNewStruc.ConnectToPipe(oPipe.ObjectId, oConnectorPositionType)             > It fails on this line

 

I can't really post a screenshot as I only get errors out of the catch ex statements or a dialogue. However Here is the eror and stack trace.

 

Application does not support just-in-time (JIT)
debugging. See the end of this message for details.

************** Exception Text **************
System.InvalidOperationException: Operation is not valid due to the current state of the object.
at Autodesk.AutoCAD.DatabaseServices.Transaction.CheckTopTransaction()
at Autodesk.AutoCAD.DatabaseServices.Transaction.DeleteUnmanagedObject()
at Autodesk.AutoCAD.Runtime.DisposableWrapper.!DisposableWrapper()
at Autodesk.AutoCAD.Runtime.DisposableWrapper.Dispose(Boolean )
at Autodesk.AutoCAD.Runtime.DisposableWrapper.Dispose()
at MikeCivil3dPack2013.NetworkFix.MeccNetworkTools() in C:\net_programming\Mikec3DPack_2013\PipeNetworkConversion\NetworkFix.vb:line 258
at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()

 

Line 258: If M_trans IsNot Nothing Then M_trans.Dispose()

 

Mike

 

 

 

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

0 Likes
Message 5 of 20

augusto.goncalves
Alumni
Alumni
It's strange to fail on ConnectToPipe but you point the call stack at line 258...

Are you using transaction with a USING keyword? This is safer as handles the dispose properly...

Maybe we'll need more to understand what's happening...
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 6 of 20

MikeEvansUK
Advisor
Advisor

Thanks Augusto, No I wasn't using a Using Statement. If you say that is safer I must look in to that myself. (Not a hardened Vb chap but sort of self taught).

 

Ok I have managed to get things to work (partially). I added Catch statements just for the connection portion and also have chaged to Pipe.connect to structure to see if it made any difference. I still recieve errors and even though the structure is created at the correct location (matching the pipe.endpoint) it seems to refuse to be conected.

 

Very odd indeed.

 

I will try  rewriting with a Using to see if that fixes it and if I get no joy i can send you the entire vb file if you want.

 

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

0 Likes
Message 7 of 20

augusto.goncalves
Alumni
Alumni
Aha! You didn't have any catch?

That might be it.

If you have problems on the code during a transaction operation, then you need to handle the proper disposal of the transaction object. That's where the USING is great, it handles that for us

I'm guessing something is wrong or the Transaction object is invalid, which causes the exception you're seeing.

Ideally you'll need (pseudo-code)

Using (transaction)
try
your code here
transaction.commit()
catch
some handling
transaction.abort()
end try
End Using ' this will dispose the transaction
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 8 of 20

Jeff_M
Consultant
Consultant

Mike, be sure the Pipe object is open for Write. The following, quickly written, example works correctly and seems to be very similar to what you are trying to do. (c#, but you should get the idea)

        [CommandMethod("placestruct")]
        public void placestruct()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            PromptEntityOptions entOpts = new PromptEntityOptions("\nSelect a pipe:");
            entOpts.AllowNone = true;
            entOpts.SetRejectMessage("...not a Civil3D pipe.");
            entOpts.AddAllowedClass(typeof(Pipe), true);
            PromptEntityResult entRes = ed.GetEntity(entOpts);
            if (entRes.Status != PromptStatus.OK)
                return;
            CivilDocument civdoc=CivilApplication.ActiveDocument;
            using (Transaction tr = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction())
            {
                Pipe pipe = (Pipe)entRes.ObjectId.GetObject(OpenMode.ForRead);
                PartsList parts = (PartsList)civdoc.Styles.PartsListSet[0].GetObject(OpenMode.ForRead);
                PartFamily fam = (PartFamily)parts[1].GetObject(OpenMode.ForRead);
                ObjectId structId = fam[0];
                ObjectId newStructId = ObjectId.Null;
                Network ntwrk = (Network)pipe.NetworkId.GetObject(OpenMode.ForWrite);
                ntwrk.AddStructure(fam.ObjectId, structId, pipe.StartPoint, 0, ref newStructId, false);
                pipe.UpgradeOpen();
                pipe.ConnectToStructure(ConnectorPositionType.Start, newStructId, true);
                pipe.DowngradeOpen();
                tr.Commit();
            }
        }
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 9 of 20

redtransitconsultants
Collaborator
Collaborator

@Jeff_M, since he's adding a structure, doesn't both the Network and the Pipe have to be open for write? The pipe would definitely to allow connection to the structure, but if you're adding a structure, you have to have access to modify the network as well.

 

 

Looking at your code now, I see that you do have the network open for write as well.

 

 

His function calls for a network and a pipe - but doesn't show them being opened for write. I'd like to see the code before he calls this function as, like you, I bet they are not open for write.

Steve Hill,Civil Designer / .NET Developer / AutoCAD and AutoCAD Civil 3D Certified Professional
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

http://redtransitconsultants.com/
Autodesk Exchange Store
Twitter | LinkedIn | YouTube

0 Likes
Message 10 of 20

Jeff_M
Consultant
Consultant
Yes, the Network needs to be open for Write, but based on where Mike shows the error occurring (after the structure is created) it seems that he does have it open for write so I didn't mention that.

I, too, would like to see the code calling this function.
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 11 of 20

MikeEvansUK
Advisor
Advisor

Sorry Guy's everything is openforWrite (I think) so the problem is probably my clunky student grade code. : )

 

Entire code apart from posted function below:

Public Class NetworkFix
    Implements Autodesk.AutoCAD.Runtime.IExtensionApplication

    'Private m_doc As CivilDocument = Nothing
    Public Shared m_trans As Transaction = Nothing
    'Private m_Database As Database = Nothing
    'Private m_Editor As Editor = Nothing

    'Public Shared g_oPipeApplication As AeccPipeApplication = Nothing
    'Public Shared oPipeDocument As AeccPipeDocument = Nothing
    'Public Shared oPipeDatabase As AeccPipeDatabase = Nothing
    'Public Shared oPipeNetworks As AeccPipeNetworks = Nothing
    Public Shared oPipeNetwork3 As AeccPipeNetwork = Nothing
    'Public Shared g_oCivil3DDoc As AeccLandUi.AeccDocument = Nothing
    Public Shared M_PipeNetwork As AeccPipeNetwork = Nothing
    'Public Shared oacaddoc As oAcadDocument
    Public Shared NET_PipeNetwork As Network
    Public Shared contextVal As Object
    Public Shared contextfound = False
    Public Shared IDNewStructure As ObjectId = Nothing
    Public Shared oNewStruc As Autodesk.Civil.DatabaseServices.Structure = Nothing
    Shared useThisEntityOption As PromptEntityOptions
    Shared useThisEntityResult As PromptEntityResult


    Sub Initialize() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize
        DemandLoading.RegistryUpdate.RegisterForDemandLoading()
    End Sub

    Sub Terminate() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate

    End Sub

    Private Shared Sub handle_promptEntityOptions(ByVal sender As Object, ByVal e As PromptEntityOptionsEventArgs)
        useThisEntityOption = e.Options

    End Sub

    Private Shared Sub handle_promptEntityResult(ByVal sender As Object, ByVal e As PromptEntityResultEventArgs)
        useThisEntityResult = e.Result
    End Sub

    <CommandMethod("MikeC3dPAck", "MeccNetworkFixConnections", CommandFlags.Modal)> _
    Public Sub MeccNetworkTools()
        'Get Civil 3D application, document and database
        If Not GetCivilApplication() Then
            Exit Sub
        End If
        Dim Start As Boolean = True

        Dim frmPipeTools As New FrmPipeNetworkTools

        'Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
        Dim db As Database = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database
        Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = db.TransactionManager
        m_trans = db.TransactionManager.StartTransaction()
        Dim netpipe As Pipe = Nothing
        Dim onetstructure As Autodesk.Civil.DatabaseServices.Structure = Nothing

        Try
            Dim entopts As New PromptEntityOptions("Select Network: ")
            entopts.Message = "Select Network: "

            Dim ent As PromptEntityResult = Nothing

            Dim Opipe1 As Autodesk.AECC.Interop.Pipe.AeccPipe = Nothing
            Dim oStructure1 As Autodesk.AECC.Interop.Pipe.AeccStructure = Nothing
            Try
                ent = m_Editor.GetEntity(entopts)
            Catch
                m_Editor.WriteMessage("You did not select a valid entity")
                RemoveHandler m_Editor.PromptingForEntity, AddressOf handle_promptEntityOptions
                RemoveHandler m_Editor.PromptedForEntity, AddressOf handle_promptEntityResult
            End Try

            RemoveHandler m_Editor.PromptingForEntity, AddressOf handle_promptEntityOptions
            RemoveHandler m_Editor.PromptedForEntity, AddressOf handle_promptEntityResult
            ' Try
            If ent.Status = PromptStatus.OK Then
                Dim entid As ObjectId = ent.ObjectId
                Dim entity1 As Autodesk.AutoCAD.DatabaseServices.Entity = DirectCast(M_trans.GetObject(entid, OpenMode.ForRead, True), Autodesk.AutoCAD.DatabaseServices.Entity)
                Dim obj As Object = entity1 'g_oCivil3DDoc.ObjectIdToObject(entid.OldIdPtr)

                If TypeOf obj Is Pipe Then
                    netpipe = obj
                    Opipe1 = netpipe.AcadObject

                ElseIf TypeOf obj Is Autodesk.Civil.DatabaseServices.Structure Then
                    onetstructure = obj
                    oStructure1 = onetstructure.AcadObject

                Else
                    m_Editor.WriteMessage("The selection was not a member of a PipeNetwork")
                    'm_trans.Abort()
                End If
                'CLEAR Dictionary entries

                Dim NETpipeNetworkID
                Dim NETpipeNetwork As Network = Nothing


                Dim sPipeNetwork1 As String
                'sPipeNetwork1 = FindPipeNetworkName(Opipe1, oStructure1, oPipeDocument)



                Try
                    For Each NETpipeNetworkID In m_doc.GetPipeNetworkIds
                        NETpipeNetwork = M_trans.GetObject(NETpipeNetworkID, OpenMode.ForWrite, False, False)
                        'If NETpipeNetwork.Name = sPipeNetwork1 Then
                        '    NET_PipeNetwork = NETpipeNetwork
                        '    M_PipeNetwork = NET_PipeNetwork.AcadObject
                        'End If
                        If Not netpipe Is Nothing Then
                            For Each opipeid As ObjectId In NETpipeNetwork.GetPipeIds
                                Dim npipe As Pipe = M_trans.GetObject(opipeid, OpenMode.ForWrite, False, False)
                                If netpipe.Name = npipe.Name Then
                                    NET_PipeNetwork = NETpipeNetwork
                                    npipe = Nothing
                                    netpipe = Nothing
                                End If
                            Next
                        ElseIf onetstructure Is Nothing Then
                            For Each oStrucId As ObjectId In NETpipeNetwork.GetPipeIds
                                Dim nstructure As Autodesk.Civil.DatabaseServices.Structure = m_trans.GetObject(oStrucId, OpenMode.ForWrite, False, False)
                                If onetstructure.Name = nstructure.Name Then
                                    NET_PipeNetwork = NETpipeNetwork
                                    onetstructure = Nothing
                                    nstructure = Nothing
                                End If
                            Next
                        End If
                    Next
                Catch
                End Try
            End If
            ''Add partslist and family data

            For Each opipeId As ObjectId In NET_PipeNetwork.GetPipeIds
                netpipe = DirectCast(M_trans.GetObject(opipeId, OpenMode.ForWrite, True), Pipe)

                Dim iox As Double = netpipe.StartPoint.X
                Dim ioy As Double = netpipe.StartPoint.Y
                Dim eox As Double = netpipe.EndPoint.X
                Dim eoy As Double = netpipe.EndPoint.Y
                Dim ioZ As Double = netpipe.StartPoint.Z
                Dim eoZ As Double = netpipe.EndPoint.Z

                If netpipe.ConnectedPartCount < 2 Then 'We have a a disconnected structure
                    Dim Netstructure As [Structure] = Nothing
                    For Each OstructureID As ObjectId In NET_PipeNetwork.GetStructureIds
                        Netstructure = DirectCast(M_trans.GetObject(OstructureID, OpenMode.ForWrite, True), [Structure])
                        If Netstructure.Location.X = iox And Netstructure.Location.Y = ioy Then
                            Try
                                If netpipe.StartStructureId = Nothing Then
                                    netpipe.ConnectToStructure(ConnectorPositionType.Start, OstructureID, True)
                                End If
                            Catch

                            End Try
                        ElseIf Netstructure.Location.X = eox And Netstructure.Location.Y = eoy Then
                            Try
                                If netpipe.EndStructureId = Nothing Then
                                    netpipe.ConnectToStructure(ConnectorPositionType.End, OstructureID, True)
                                End If
                            Catch

                            End Try
                        Else ' We have no structure at the end, create one and connect it
                            If netpipe.StartStructureId = Nothing Then ' Still nothing
                                ''add structure
                                Try
                                    AddStructure(NET_PipeNetwork, netpipe.StartPoint, netpipe, ConnectorPositionType.Start)
                                    netpipe.ConnectToStructure(ConnectorPositionType.Start, oNewStruc.ObjectId, True)
                                Catch
                                End Try

                            ElseIf netpipe.EndStructureId = Nothing Then 'Still nothing
                                Try
                                    AddStructure(NET_PipeNetwork, netpipe.EndPoint, netpipe, ConnectorPositionType.End)
                                    netpipe.ConnectToStructure(ConnectorPositionType.End, oNewStruc.ObjectId, True)
                                Catch
                                End Try
                            End If
                            'Next structure
                        End If

                    Next
                End If
            Next

            'Catch
            'End Try
            M_trans.Commit()
        Catch ex As System.Exception
            m_Editor.WriteMessage("Exception Message is  : " + ex.Message.ToString())
            If M_trans IsNot Nothing Then M_trans.Abort()
        Finally

            If M_trans IsNot Nothing Then M_trans.Dispose()
        End Try

        ResetVar()

    End Sub

 

Let me know if you see anything. (There's probably loads here, still learning)

 

Mike

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

0 Likes
Message 12 of 20

MikeEvansUK
Advisor
Advisor

Something I note Jeff, you appear to get the pipe open for Read then upgrade it to write.

 

"pipe.UpgradeOpen()"

 

Then after Downgrade. Is there any major difference (in the way it is handled) in doing this instead of just opening for read directly?

 

I will try adding Using & end using into the code to see if this assists but am intrested to see where I am going wrong. it's odd that some structures attach and some do not even though they are located exactly at the start/end of the pipe.

 

Augusto I did have catch statements elsewhere in the main code just not within that sub. I added them to enable to code to finalise and so I can see the problems in there, I should probably add more than I do.

 

BTW: Does anyone know how to get the information on a Catch to appear in VSExpress 2013 without adding the "EX As exception" then Writing the info to console or dialogue. Vb used to display this in a pop up in the 2011 under 32bit mode but does not anymore which is quite annoying.

 

M

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

0 Likes
Message 13 of 20

Jeff_M
Consultant
Consultant
Mike, I read somewhere when I was first getting started in .NET that objects should be open for Write for as short a time as possible so I will usually open them for Read and Upgrade/Downgrade as needed. In this case, I had actually tested to see if it would throw the same error you are getting when it was open for Read. Then just added the Up/Down after the fast.
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 14 of 20

augusto.goncalves
Alumni
Alumni
You should open for read then, if needed, convert to write. Only open for write if your action is entirely write. Why? When you open for write, AutoCAD creates a copy for future UNDO (and other things), so for read is faster and lighter. I don't see a reason to downgrade after, unless you're passing the object to another function.

About the catch, you can see it in debug mode... or you can declare a Ex variable and use Debug.Write to output to VS console
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 15 of 20

Jeff_M
Consultant
Consultant
I use the DowngradeOpen() due to the edits being committed instead of waiting for the Transaction to do so. From the ObjectARX help:
Downgrades the object from being open OpenMode.ForWrite, to being OpenMode.ForRead. In the process, all changes made to the object while it was open for write are committed to the database and appropriate notification is sent.
Jeff_M, also a frequent Swamper
EESignature
Message 16 of 20

MikeEvansUK
Advisor
Advisor

Not really got into objectArx (or how it realates to .net) so I didn't know that however I can see the logic in using downgrade where possible (instead of having to do it right at the end) in conjunction with using open for read / write accordingly. This may be the reason some of my code runs a bit slow at times.

 

Thanks for the guidance. By the sounds of it there is nothing strikingly wrong in my code here so I'm happy there "Brilliant". So I'll try rewriting to contain the sudgested Using and Open modes and see if that helps.

 

Cheers..

 

Mike

 

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

0 Likes
Message 17 of 20

Jeff_M
Consultant
Consultant

@Anonymous wrote:

Not really got into objectArx (or how it realates to .net) so I didn't know that ....

Mike

 


Mike, if you are using the AutoCAD/Civil3d .NET API's then you ARE into ObjectARX.....the .NET libraries expose the ObjectARX Objects for us to use without needing to know the higher level programming stuff. Thus making it easier for us users to be able to create our own powerful customizations. If you don't have the help documentation for the .NET API, you should...and it's in the ObjetARX SDK under the docs folder: arxmgd.chm

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 18 of 20

MikeEvansUK
Advisor
Advisor

Ah, I figuredd it was a seporate API due to the seporate download.

 

Anyway. I have revised the code to include Using, Upgrade & Downgrades.  I also relocated a portion where it was looking for structrues with no manholes - That didn't exist?.

 

It works very well now however, I seem to have instances where there are structures located at the same coordinates as the pipes x & y which do not get picked up and connected. I have tried reducing the decimals to 3 to see if there was a miniscule error between the two and some still don't connect.

 

This is still a work in progress but fundimentally now will scan the network and fix the locations of any manhole which have lost connectivity and came about because the draggeom command appears to break all network connections when accidentally done.

 

Thanks for all the help and the great info / teachings. Well worth it. Kudos to you all.

 

Mike

 

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

0 Likes
Message 19 of 20

MikeEvansUK
Advisor
Advisor

Select Network: at Autodesk.Civil.Checker.Check(ErrorStatus es, String message)


at Autodesk.Civil.DatabaseServices.Network.AddStructure(ObjectId structureFamilyId, ObjectId structureSizeId, Point3d location, Double rotation, ObjectId& newStructureId, Boolean applyRules)


at MikeCivil3dPack2013.NetworkFix.AddStructure(Network oNetwork, Point3d startPoint, Pipe oPipe, ConnectorPositionType oConnectorPositionType)

 

Just run this following my adjustments and got the error above. Not sure if this may highlight anything?

 

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

0 Likes
Message 20 of 20

Jeff_M
Consultant
Consultant
Real hard to say without some code, Mike.
Jeff_M, also a frequent Swamper
EESignature
0 Likes