TheSwamp

Code Red => .NET => Topic started by: nobody on May 08, 2016, 02:04:53 AM

Title: What did this do?
Post by: nobody on May 08, 2016, 02:04:53 AM
One of the api sample posts from the autodesk team from 2013...anyone know what the heck this did?  Apparently it was only available through the API

Code - C#: [Select]
  1. Here is a c# code snippet -
  2.  
  3. Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  4.  
  5. CivilDocument cDoc = CivilApplication.ActiveDocument;
  6.  
  7. Database db = Application.DocumentManager.MdiActiveDocument.Database;    
  8.  
  9.  
  10.  
  11. using (Transaction trans = db.TransactionManager.StartTransaction())
  12.  
  13. {
  14.  
  15.   try
  16.  
  17.   {
  18.  
  19.     GreenEvaluate checkGreenEvl = new GreenEvaluate();
  20.  
  21.  
  22.  
  23.     // Call GreenEvaluatation to compute the Green factor and
  24.  
  25.     // Sustainablility factor for the current CivilDocument
  26.  
  27.     checkGreenEvl.GreenEvaluatation(cDoc);
  28.  
  29.  
  30.  
  31.     // Check the Green factor and Sustainability factor
  32.  
  33.     ed.WriteMessage("\nIs this Project Green ? :" + checkGreenEvl.GreenFactor.ToString());
  34.  
  35.     ed.WriteMessage("\nIs this Project Sustainable  :" + checkGreenEvl.SustainableFactor.ToString());        
  36.  
  37.  
  38.  
  39.     trans.Commit();
  40.  
  41.   }
  42.  
  43.   catch (System.Exception ex)
  44.  
  45.   {
  46.  
  47.     ed.WriteMessage("\nException: " + ex.Message);
  48.  
  49.   }      
  50.  
  51.  
  52.  
  53. }
  54.  
Title: Re: What did this do?
Post by: Jeff_M on May 08, 2016, 12:08:01 PM
Where did you find that? Looks like someone had a class the checks the "Greenness" of a project....
Title: Re: What did this do?
Post by: nobody on May 08, 2016, 02:31:16 PM
Where did you find that? Looks like someone had a class the checks the "Greenness" of a project....

It was one of Partha's post.  It's crazy... wonder what it even based it on.
Title: Re: What did this do?
Post by: kdub_nz on May 08, 2016, 03:12:32 PM
Where did you find that? Looks like someone had a class the checks the "Greenness" of a project....

It was one of Partha's post.  It's crazy... wonder what it even based it on.


Why don't you ask him ??

Is your issue with the code or the 'Greenness' ??
Title: Re: What did this do?
Post by: nobody on May 08, 2016, 03:49:01 PM
No issue...just thought it was interesting enough to discuss. Good point though.
Title: Re: What did this do?
Post by: ChrisCarlson on May 09, 2016, 10:10:00 AM
Weird, do designers in Civil3D care about "greenness"?
Title: Re: What did this do?
Post by: Jeff_M on May 09, 2016, 10:24:49 AM
LOL, apparently someone neglected to note the date on which that 'sample code' was was posted..... And quoted from the end of that post: "If you have any questions on this particular API, let's come back on the same day 'next year' to discuss about this!"
Title: Re: What did this do?
Post by: nobody on May 09, 2016, 09:01:33 PM
haha...ya...kind of funny. Can't seem to message partha or post on the comment. Wonder if he's still with autodesk...my mail to him, which once worked, now bounces back...bummer if so
Title: Re: What did this do?
Post by: nobody on May 09, 2016, 10:01:43 PM
haha...ya...kind of funny. Can't seem to message partha or post on the comment. Wonder if he's still with autodesk...my mail to him, which once worked, now bounces back...bummer if so

Dote...confirmed...Partha is no longer with Autodesk.  With Arcadis now.