Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.
Hi,
I have made a customized command that creates numerous baseline regions for use with different custom subassemblies. It works perfectly fine on a shorter alignment (400m length), but not on my long alignments (varies between 10km - 30km).
I get the following error:
************** Exception Text **************
System.ArgumentException: The start and end station should be in the range of baseline.
at Autodesk.Civil.DatabaseServices.BaselineRegionCollection.Add(String regionName, ObjectId assemblyId, Double startStation, Double endStation)
at GettingStarted.MainClass.CreateBaselineRegions() in C:\Users\mohammed.babur\Documents\Visual Studio 2015\Projects\GettingStarted\GettingStarted\MainClass.cs:line 142
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.CommandClass.CommandThunk.Invoke()
I can't seem to find out what's wrong with it, especially since it's working just fine with my other alignments.
Here's an overview of my workflow in C# .Net :
All of this works great on a short alignment, but on my longer ones, I get the system argument exception.
Would be nice to know if I'm just doing something silly here. I would love to post my code here, but I'm hesitant as it may violate our NDA Policy.
Any help would be greatly appreciated!
Thanks,
izzy
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
Hi Jeff,
I just ran a debug (silly me, didn't think it would actually show the numbers).
Please see attached some screenshots of the error and the bottom panes in MS Visual Studio.
At first glance, it looks like my final iteration is 0.04m longer than the alignment length. I'll take a few minutes here to digest the code in the meantime and see if I can find a way around this. Perhaps an if statement which prevents the baseline region from being created if the difference between the start and end station of the final iteration is smaller than the extrusion thickness specified by the user (step 6 in first post of this thread).
Thanks,
izzy
Jeff,
I believe I found the issue.
My iteration stopped at iteration 1207 of 1255. This was because I did not account for the extrusion thickness within the baseline regions when setting up the number of iterations.
Best way to picture this:
Imagine a bridge deck which is 1000m long, and has 25m long substructure (column and pier) span lengths. The total substructure width is 1m wide.
I set the number of iterations as 1000m / 25m. However, this doesn't account for the columns being 1m wide, so as you go up in your iterations, your last few span lengths are actually consumed by the cumulative column widths.
It should be (1000m/25m) is the center to center spacing of the columns. But the columns are 1m wide, so you have to account for that 1m adding up along the alignment, especially if I want to create baseline regions in between the spans and not from center to center of spans.
I rewrote a portion of the code to calculate the cumulative column length, subtract that from the total, and recalculate the number of span lengths from edge of column to edge of column (not center to center).
Now it works great! Except my surface is not densely populated with points, so I get a bunch of missing target errors along the alignment.
Thanks again for the debugging suggestion it really helped!
Cheers,
izzy
Can't find what you're looking for? Ask the community or share your knowledge.