Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Catch FindShortestNetworkPath

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
pieter_souvereyns
384 Views, 2 Replies

Catch FindShortestNetworkPath

I want to use 'FindShortestNetworkPath'.

It works when I 'll try with conditions that are connected, that there is a solution.
But when the user give a structure that is not possible to connect to each other,  I can't catch this error.
I get this message "Value does not fall within the expected range."
But not as an error that it goes to the catch. 


Somebody experience with this?

Try
PathColl = Network.FindShortestNetworkPath(structure_start, structure_end, lengt)
Catch ex As Exception
Exit Sub
End Try


Regards
Pieter

2 REPLIES 2
Message 2 of 3
Jeff_M
in reply to: pieter_souvereyns

This correctly catches the exception using c#:

            try
            { 
                var ids = Network.FindShortestNetworkPath(part1, part2, ref len); 
            }
            catch (System.Exception) 
            { }

 Perhaps specify System.Exception instead of just Exception.

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 3
pieter_souvereyns
in reply to: Jeff_M

That something to remember for the future
try with a variable that is unspecified
Thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report