The parameter's storage type is not a string. Level

Hi everyone,

I would like to set a parameter value (string value) to a “level” parameter .


Obvously, I get an error message:

*Warning: Element.SetParameterByName operation failed. *
The parameter’s storage type is not a string.

I have no idea how to acomplish that.

Thank you in advance for your help.

Hi there,

The value is a level not a level name.

Maybe you could use this node to get the level by name:

Cheers

3 Likes

[quote=“Manel_Fernandez, post:2, topic:36304, full:true”]
Hi there,

The value is a level not a level name.

Maybe you could use this node to get the level by name:

Cheers

Hi[/quote],

That’s a good idea.
However that seems to work only for one element.

My node(archi-lab) is slightly different because I’m working in Dynamo 1.3.

I think I need a node called Selec.GetLevel**(s)ByName(s).**:sweat_smile:

I’m sorry. I don’t have Dynamo 1.3 to test it.

Manel

And…does it work in your version?

Get Level By Name with a list of multiple names?

Yes, it works fine,

imagen

Cheers

Manel

1 Like

It should work with any version. Make sure you have the latest Archilab package for your version.

Hi,
How can I find the latest archi-lab version for my Dynamo 1.x?

My office has developed some script using the 1.x Dynamo version.

In addition, my office centralizes all packages in the same path. I am “obliged” to work with this version of Dynamo and also with those packages.
Is it possible to work with different versions of packages at the same time?
One version would be installed, and another version is in a folder.

package_path

I attached the script in case that might helpchangement_de_niveaux.dyn (22.0 KB)
levels-transform.xlsx (9.7 KB)
.

Thank you very much for your help.

If you are not apposed to using a little bit of python, something like this would work really easily.

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
import Autodesk

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variables.
levelNames = IN[0]

level = []
allLevels = FilteredElementCollector(doc).OfClass(Level).ToElements()

for n in levelNames:
	lvl = None
	for l in allLevels:
		if n == l.Name:
			lvl = l
	level.Add(lvl)
			
#Assign your output to the OUT variable.
OUT = level

1 Like

Awesome!

That works perfectly. It was nice of you.

I definitely have to go study some python. Any suggestions on how to get started?

Thank you SeanP.

1 Like

I would say start with the Primer and go from there!
https://primer.dynamobim.org/10_Custom-Nodes/10-4_Python.html