Author Topic: ElevationAt Killing Me  (Read 2370 times)

0 Members and 1 Guest are viewing this topic.

bchapman

  • Guest
ElevationAt Killing Me
« on: February 02, 2013, 02:02:04 AM »
Anyone have example using elevationAt in C#?

bchapman

  • Guest
Re: ElevationAt Killing Me
« Reply #1 on: February 02, 2013, 02:21:31 AM »
Nevermind :)

BlackBox

  • King Gator
  • Posts: 3770
Re: ElevationAt Killing Me
« Reply #2 on: February 02, 2013, 09:05:09 AM »
Nevermind :)

You might consider posting your solution, the tutorial you found, an illustrative example, etc. for others to find.  :-)
"How we think determines what we do, and what we do determines what we get."

bchapman

  • Guest
Re: ElevationAt Killing Me
« Reply #3 on: February 02, 2013, 05:51:29 PM »
Not the greatest, but this is what I did:


           
Code: [Select]
    Profile profile = ts.GetObject(profileId, OpenMode.ForRead) as Profile;
                var FNLELEV = profile.ElevationAt(FNLSTA);
                ed.WriteMessage("\nElev={0}", FNLELEV);

I'd prefer it to select the profile by name... but don't know how to do that :/
« Last Edit: February 02, 2013, 07:03:28 PM by BC_in_NV »

BlackBox

  • King Gator
  • Posts: 3770
Re: ElevationAt Killing Me
« Reply #4 on: February 02, 2013, 06:29:11 PM »
Not the greatest, but this is what I did:


Code - C#: [Select]
  1. Profile profile = ts.GetObject(profileId, OpenMode.ForRead) as Profile;
  2. var FNLELEV = profile.ElevationAt(FNLSTA);
  3. ed.WriteMessage("\nElev={0}", FNLELEV);

In lieu of Var FNELEV... You might consider the default ElevationAt() returned type of double (followed by ToString()?).

... This may just be personal preference.



I'd prefer it to select the profile by name... but don't know how to do that :/

Perhaps there's fruit to be had from the Alignment.GetProfileIds() Method?



P.S. - Don't forget [CODE ] Tags.  :wink:
"How we think determines what we do, and what we do determines what we get."

bchapman

  • Guest
Re: ElevationAt Killing Me
« Reply #5 on: February 02, 2013, 10:15:20 PM »
This is what I've done after getting the object collection... has to be better way...any thoughts?
Code: [Select]
foreach (ObjectId objid in BCCPROFILECOLLECTION)
                {
                    Profile profile = ts.GetObject(objid, OpenMode.ForRead) as Profile;
                    ed.WriteMessage("\nProfile Name={0}",profile.Name);
                    var profilename = profile.Name as string;
                    var wantname = BCCPROFILENAMESET as string;
                    if (profilename.Equals(wantname))
                    break;
                 }