AutoCAD Civil 3D Customization

AutoCAD Civil 3D Customization

Reply
Mentor
tyronebk
Posts: 186
Registered: ‎08-17-2007
Message 1 of 5 (205 Views)

ProfilePVI.Elevation exception

205 Views, 4 Replies
04-26-2012 01:04 PM

I've run into a problem when trying to change a ProfilePVI.Elevation property. If the value is > 0 then there is no problem. If the value is <= 0 then the following exception is thrown:

 

'System.ArgumentOutOfRangeException' occurred in AeccDbMgd.dll

 

This is for 2012 and 2011. Haven't tried 2013 yet.

 

I would provide sample code but there really isn't much to show.

pvi.Elevation = 2;  //good

pvi.Elevation = 0.0000000000001;  //good

pvi.Elevation = 0;  //error

pvi.Elevation = -1;  //error

 

Also, here is a bit of code from the reference guide which clearly shows negative elevations but I am seeing the above errors. Thanks for any insights.

Mentor
tyronebk
Posts: 186
Registered: ‎08-17-2007
Message 2 of 5 (196 Views)

Re: ProfilePVI.Elevation exception

04-27-2012 01:39 PM in reply to: tyronebk

On a related note, I'm noticing that ProfilePVI.Station cannot be set if it falls before or after the horizontal alignment geometry either. It simply outputs a message box error stating "Station xxx.xxx: Either outside of alignment limits, or within gap created by a station equation." The message is correct in that the PVI is outside the alignment limits, but if it was already outside those limits why the restriction now when attempting to change it?

 

Manually making changes through the Panorama grid doesn't run into any of these problems. Is there something I'm overlooking in the API?

*Expert Elite*
Jeff_M
Posts: 4,519
Registered: ‎07-22-2003
Message 3 of 5 (193 Views)

Re: ProfilePVI.Elevation exception

04-27-2012 02:06 PM in reply to: tyronebk

tkarapita wrote:

 

Manually making changes through the Panorama grid doesn't run into any of these problems. Is there something I'm overlooking in the API?



Yep, I discovered this as well. No way around it that I could find.

Jeff_M, also a frequent Swamper
Mentor
tyronebk
Posts: 186
Registered: ‎08-17-2007
Message 4 of 5 (181 Views)

Re: ProfilePVI.Elevation exception

04-29-2012 01:09 PM in reply to: Jeff_M
Thanks for the affirmation Jeff. Did you run into it with .net or LISP? I'm wondering if this is just a managed limitation or if it also applies to COM.
*Expert Elite*
Jeff_M
Posts: 4,519
Registered: ‎07-22-2003
Message 5 of 5 (178 Views)

Re: ProfilePVI.Elevation exception

04-29-2012 02:35 PM in reply to: tyronebk

It's actaully some older code in my .NET dll based on the COM interops. I found when updating the code to use the managed wrappers that this limitation still applied. 

Jeff_M, also a frequent Swamper
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.