Unpin elements of multi story stair

revit

#1

Hello!

In Revit 2018 API there is a new kind of pin for multi story stair. Unfortunately pinning prevents modify the stair parameters with dynamo.
The standard Element.SetPinnedStatus node seems like does nothing in this case.

Can anyone support me with a python script or node that unpins the elements of a multi story stair?

API reference http://www.revitapidocs.com/2018.1/8b07cbff-013c-889f-8807-703e63a91923.htm


#2

You will find here how to paste what you have tried so far…


#3

Hi @daninet,

I know @Yna_Db doesn’t approve of this (sorry :slight_smile: ), since you haven’t shown what you’ve done your self to solve this, but here goes:

import clr

#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

#Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

#Reference the active Document and application
doc = DocumentManager.Instance.CurrentDBDocument

#Start scripting here:
element = UnwrapElement(IN[0])
lvl = UnwrapElement(IN[1]).Id

#Transaction start:
TransactionManager.Instance.EnsureInTransaction(doc)

unPinned = element.Unpin(lvl)

#Transaction end:
TransactionManager.Instance.TransactionTaskDone()

#Assign your output to the OUT variable.
OUT = unPinned

If you want to unpin multiple levels:


import clr

#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

#Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

#Reference the active Document and application
doc = DocumentManager.Instance.CurrentDBDocument

def unpinAll(lvl):
	return element.Unpin(lvl)

#Start scripting here:
element = UnwrapElement(IN[0])
lvl = [i.Id for i in UnwrapElement(IN[1])]

#Transaction start:
TransactionManager.Instance.EnsureInTransaction(doc)

unPinned = []
for i in lvl:
	unPinned.append(unpinAll(i))

#Transaction end:
TransactionManager.Instance.TransactionTaskDone()

#Assign your output to the OUT variable.
OUT = unPinned

Good luck.


#4

This is very nice :slight_smile: but would have been even nicer in the Share category (very sorry :smile:)


#5

I really stuck with the unpin there was nothing to show. I have selected a stair and have tried the Element.SetPinnedStatus node.

Thank you guys for the support, really appreciate it!


#8

@daninet
It is always possible to try something, to gather and share some useful information and to analyse and discuss the solution that has been given in order to understand it, so that your next request can be more elaborated than the previous one :slight_smile:


#9

In general the problem with the API’s unpin is that it require the multi story stair to be selected and input the levels also. We have around 100 staircase in 12 levels (big project). There are multi story and not multi story stairs, levels are kind of “random”. Some stair is going from lvl 02-08 others are from 00 to 10.

The problem here is multi layered:

-I found it hard to separate multi story and not MS stairs as no parameter refers to their state. The upper level stairs of the MS stairs are simply ignored by dynamo and the first bottom instance is selected.

-I have to input the correct levels I want to unpin. This is pretty much different for every MS staircase.

The whole gymnastics I’m trying to get done is to get the messed up thread numbering sorted on all staircase all across the model. The starting number parameter is locked until the stair is pinned.
Ideally I would need a node that unpins all MS stair in the model.

Here is where I’m standing:

Stairs Renumber.dyn (49.2 KB)


Multistory stair components
#10

Getting the Multistorystairs is easy enough:

You can use the Element Types node to get all in the project, or you can use the python part.
I don’t know why you can’t use the Category node though, since there actually is a category called OST_MultistoryStairs :-).

The rest of what you are describing is a bit more complicated I guess, and I don’t have time to investigate this now, but perhaps you can get a step farther yourself now?