Railing Path

Anonymous

Railing Path

Anonymous
Not applicable

Hi, 

 

I'm wondering if Revit API allows edit the path of existing railing elements.

Please let me know if there's any way to implement this or any workaround.

Thank you for your help in advance.

 

Jinsol

0 Likes
Reply
944 Views
7 Replies
Replies (7)

Aaron.Lu
Autodesk
Autodesk
Dear Jinsol, As far as I know, there is no such API.


Aaron Lu
Developer Technical Services
Autodesk Developer Network
0 Likes

Dale.Bartlett
Collaborator
Collaborator

Put aside accessing an existing railing path, is it possible to create railings (ie new path) via the api?




______________
Yes, I'm Satoshi.
0 Likes

Anonymous
Not applicable

Can we have mouse events in Revit APIs. I want to create addins which allows me to draw line using mouse. 

So I want to use mouse events . I am new in Revit so please guide me that is there any mouse events in Revit Api or not

 

0 Likes

Dale.Bartlett
Collaborator
Collaborator

Ok, lazy me...

Help file:

private void CreateRailing(Document document, Stairs stairs)
{
    Transaction trans = new Transaction(document, "Create Railings");
    trans.Start();

    // Delete existing railings
    ICollection<ElementId> railingIds = stairs.GetAssociatedRailings();
    foreach (ElementId railingId in railingIds)
    {
        document.Delete(railingId);
    }
    // Find RailingType
    FilteredElementCollector collector = new FilteredElementCollector(document);
    ICollection<ElementId> RailingTypeIds = collector.OfClass(typeof(RailingType)).ToElementIds();
    Railing.Create(document, stairs.Id, RailingTypeIds.First(), RailingPlacementPosition.Treads);
    trans.Commit();
}

I just need to confirm that I can create standalone in the absence of stairs. Dale

 




______________
Yes, I'm Satoshi.
0 Likes

Dale.Bartlett
Collaborator
Collaborator

Ok, it appears that Railings require an existing Stair.

 Create
Automatically creates new railings with the specified railing type on all sides of a stairs element.

Is there a suggested workaround? Invisible stairs? Dale




______________
Yes, I'm Satoshi.
0 Likes

Dale.Bartlett
Collaborator
Collaborator
Sorry Mouse Events should be a new topic.



______________
Yes, I'm Satoshi.
0 Likes

Dale.Bartlett
Collaborator
Collaborator

bump

 

To summarise, is it possible to create railings via API without exisiting stairs (ie free-standing)? My research says no. Thanks, Dale




______________
Yes, I'm Satoshi.
0 Likes