How to Shorten my Script (Convert Revit to Excel 2016 Dynamo)

Hello Masters,

I have a dynamo script for family parameter transfer from revit to excel Shown in pic A, But its way too long. I am hoping to shorten this map to map similar to Pic B. Thank you.

Regards,
Greg Plaermo

Pic A

Pic B

did you give node to code a try?
select some of your nodes, right click>node to code

1 Like

Mr Marcel,

Let me check. Thanks

all I need is to stop Adding Getparametervaluebyname(Type or Instance) in every parameter name. Just like list node but on parameter names inside input Getparametervaluebyname.

Mr. Marcel,

Can you give me an example to node to code?
I look into your post but for now I cannot integrate it on my current learning.

List of mathematical shapes and how to create them using Designscript

Regards

Excel to Revit script is like a fish net in the OCEAN. Please Help

excel%20to%20revit

You cloud try to call the ParameterSet of the selected element and work from there, this will also allow changes in family parameters without having to edit your script!

This will require some python scripting or custom nodes.

1 Like
import System
from System.Collections.Generic import *

import clr
clr.AddReference('RevitServices')

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


element					= UnwrapElement(IN[0])

a = element.GetOrderedParameters()
family_parameters = []

for i in a:
 	family_parameters.append(i.Definition.Name)


OUT = family_parameters

You can expand from here

1 Like

Wire all of parameter names into a list, then use a single Element.GetParameterValueByName node with cross product lacing.

1 Like

I agree it’s not pretty, but think about it this way - if you shorten it (via cross-product lacing or python scripting) and then in a month or two that script has problems with a handful of items - which one will be easier to chase down the issues? For me personally - the spread out fish net would be nice if i saw that 5 of the 30 sections had yellow warning boxes instead of just one box that turned yellow. That would tell me really quick that whatever issue arose was likely due to something those 5 boxes had in common (for instance the parameter or the parameter’s units). i’d rather have that then have to spend 10 minutes in the output dialog of one box scrolling looking for nulls…

if it aint broke…

2 Likes

Expanded graphs can be easier to troubleshoot, but they’re also much slower. Each of those nodes adds a hit on the RAM, which will slow things down quite quickly.

Typically the yellow warning, once expaned, will show enough info that you can quickly chase down the error. Warnings will typically state something like “expected string, got double” or “couldn’t find a version of ____ that used arguments of element, element” or the like. Add a Object.Type node and a List.Contains node will chase those down pretty quickly.

1 Like

Good Morning Masters,

Thank you for your wisdom and inputs. I now have different options on how to work on this specific script.

Regards,
Greg

Why I am getting only numbers instead of parameter names on list?

List%20is%20empty

Looks like you might be trying to get type parameter values from an instance. If you are looking at type parameters, first take the list of selected elements and feed it thru an element.type node to get the family type.

2 Likes

@Ben_Osborne

Thank you! I got one less problem solve. Here is the script map and the family that I have to populate.

Thank you Dynamo Family.

Regards,
Greg