Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create.NewFascia() rejects roof edges in API but not in Interactive mode

1 REPLY 1
Reply
Message 1 of 2
manishnpatel
490 Views, 1 Reply

Create.NewFascia() rejects roof edges in API but not in Interactive mode

The Create.NewFascia() method is used to create a new fascia object onto a roof edge.  When placing fascia though the GUI/Interactive Mode, I'm allowed to select the upper edges and lower edges of the roof.  If the same roof edge references are passed to NewFascia through API, I get an ArgumentOutOfRangeException indicating it's not a valid edge for the lower edges.  It seems like NewFascia() has a much defined validation routine that is rejecting the edges that are normally allowed though the GUI.  Can you please tell me why only certain edges are allowed and others are being rejected?  One of the edges in question is this lower edge of a roof with 'Two Cut-Plumb' Rafter Cut.

LowerRoofEdge.png

 

Here's the code snippit:

private void TestFasciaPlacement()
{
  UIDocument uidoc = CommandData.Application.ActiveUIDocument;
  var selectedEdgeRef = uidoc.Selection.PickObject(Autodesk.Revit.UI.Selection.ObjectType.Edge);

  var filteredElementCollector = new FilteredElementCollector(RevitDoc).OfClass(typeof(FasciaType));
  var fasciatype = filteredElementCollector.FirstOrDefault() as FasciaType;

  if ((selectedEdgeRef != null) && (fasciatype != null))
  {                                                           
     using (Transaction docTrans = new Transaction(RevitDoc, "Testing Fascia"))
     {
        try
        {
           docTrans.Start();                            
           Fascia fascia = RevitDoc.Create.NewFascia(fasciatype, selectedEdgeRef);                                                                                    
           docTrans.Commit();
        }
        catch (Exception ex)
        {
           //ErrorMsg(ex.Message);
           System.Diagnostics.Debug.Print(ex.Message);
        }
     }
  }
}

 

1 REPLY 1
Message 2 of 2
Joe.Ye
in reply to: manishnpatel

I also reproduced the same issue. the upper edge works, however the lower edge doesn't allow to be used to create fascia. I reported this behavior to the engineering team. Thanks for raising it.


Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community