Does Revit2015 Platform API Developers Guidelines exists?

Does Revit2015 Platform API Developers Guidelines exists?

OR_AND_NO
Advocate Advocate
1,208 Views
4 Replies
Message 1 of 5

Does Revit2015 Platform API Developers Guidelines exists?

OR_AND_NO
Advocate
Advocate

To coding for revit2014 i used Revit2014 Platform API Developers Guidelines.

A few weeks ago I upgrade to revit2015 and discover that some examples from pointed above guidelines don’t work and parameters of some methods were changed.

 

For example (Code Region 29-14: Adjusting the analytical model in relation to another element) don't work in revit2015 exeption - “An internal error has occurred.”

 

      public Result Execute(Autodesk.Revit.UI.ExternalCommandData commandData,ref string message,ElementSet elements)

        {

            m_application = commandData.Application;

            m_document = m_application.ActiveUIDocument;

              try

            {

 

               Selection sel = m_document.Selection;

               Reference refAnalytical = sel.PickObject(ObjectType.Element,"Please Pick the source analytical line to adjust to");

 

               Element el = m_document.Document.GetElement(refAnalytical);

               AnalyticalModel aModel = el.GetAnalyticalModel ();

// in original example wasAnalyticalModel aModel = doc.GetElement(refAnalytical) as AnalyticalModel;

 

               Curve aCurve = aModel.GetCurve();

               // Get the reference of the start point

               AnalyticalModelSelector aSelector =new AnalyticalModelSelector(aCurve);

                aSelector.CurveSelector =AnalyticalCurveSelector.StartPoint;

               Reference refSource = aModel.GetReference(aSelector);

                // Pick the source analytical line to be adjusted

               Reference refAnalytical2 = sel.PickObject(ObjectType.Element,"Please pick the source analytical line to be adjusted");

 

                el = m_document.Document.GetElement(refAnalytical2);

               AnalyticalModel aModel2 = el.GetAnalyticalModel();

// in original example wasAnalyticalModel aModel2 = doc.GetElement(refAnalytical2) as AnalyticalModel;

 

               // Get the reference of the start point

               Curve aCurve2 = aModel2.GetCurve();

                AnalyticalModelSelector aSelector2 =new AnalyticalModelSelector(aCurve2);

          //     aSelector2.CurveSelector = AnalyticalCurveSelector.StartPoint;

               // Can be adjusted to the middle of the line if WholeCurve is used

                aSelector2.CurveSelector =AnalyticalCurveSelector.WholeCurve;

               Reference refTarget = aModel2.GetReference(aSelector2);

               // Adjust the analytical line

 

                bool res=aModel.ManuallyAdjust(refSource, refTarget);

//in original example aModel.ManuallyAdjust(refSource, refTarget, true);

 

 

 

               return Result.Succeeded;

            }

 

           catch (Exceptions.OperationCanceledException)

            {

               // Selection Cancelled.

               return Result.Cancelled;

            }

           catch (Exception ex)

            {

               // If any error, give error information and return failed

                message = ex.Message;

                return Result.Failed;

           }

        }

    }

 

 

I try to find Revit2015 Platform API Developers Guidelines without success, Does it exist anywhere?

0 Likes
1,209 Views
4 Replies
Replies (4)
Message 2 of 5

mikako_harada
Alumni
Alumni

Hi, 

 

Are you looking for this documentation? 

http://www.autodesk.com/revitapi-help

 

If so, could you try visit the latest version, following the above link, then try replacing version number in the url. e.g., 

 

http://help.autodesk.com/view/RVT/2015/ENU/?guid=GUID-F0A122E0-E556-4D0D-9D0F-7E72A9315A42

 

It should bring to the older version most of the time (There is a slight chance that if the page is newly added, it may not hit older one. Should work from the top basic pages.)  


Mikako Harada
Developer Technical Services
0 Likes
Message 3 of 5

OR_AND_NO
Advocate
Advocate

Thank You very mach for soon answer.

In Your reference the example (Code Region 29-14: Adjusting the analytical model in relation to another element http://help.autodesk.com/view/RVT/2016/ENU/?guid=GUID-92AF0D57-2E97-4F42-8DE0-F308F89900C4) do not work in revit 2015 and 2016 without recoding so several examples from old version (2014) are not correct and i am looking for correct examples beacouse it's very dificult to understand api using uncorrect examples.

0 Likes
Message 4 of 5

Anonymous
Not applicable

Have you downlaoded the SDK package for Revit 2015 and 2016?

0 Likes
Message 5 of 5

OR_AND_NO
Advocate
Advocate

Sure, 2015 SDK

0 Likes