Skip to content

Instantly share code, notes, and snippets.

@johnpierson
Created November 7, 2023 20:29
Show Gist options
  • Save johnpierson/a0ce89a09a0fe3be1f536f4f4ce33eab to your computer and use it in GitHub Desktop.
Save johnpierson/a0ce89a09a0fe3be1f536f4f4ce33eab to your computer and use it in GitHub Desktop.
FreezeNodesByName
# Importing Reference Modules
# CLR ( Common Language Runtime Module )
import clr
# Adding the DynamoRevitDS.dll module to work with the Dynamo API
clr.AddReference('DynamoRevitDS')
import Dynamo
# access to the current Dynamo instance and workspace
dynamoRevit = Dynamo.Applications.DynamoRevit()
currentWorkspace = dynamoRevit.RevitDynamoModel.CurrentWorkspace
freezeToggle = IN[0]
nodeName = IN[1]
allNodes = currentWorkspace.Nodes
setParamNodes = []
for i in allNodes:
if i.Name == nodeName:
#append the set parameter nodes to a list
setParamNodes.append(i)
#freeze or unfreeze
i.IsFrozen = freezeToggle
OUT = setParamNodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment