Fabrication in Revit® > Dynamo for Autodesk┬« Revit

Get parameter value by name

(1/2) > >>

I am looking to use the "get parameter value by name" node to fill in the hanger name in my point export script.  No matter what I try, I can't get the value to fill in.  Can someone tell me what I should be entering for a parameter name in my code block?  I would like to get the "source description " if possible but I just can't seem to access it.

A couple ways I do it,

Use the node "Parameter.ByName" not the "ValuebyName" and connect a String node with: "Family" see the attachment "elementnamev1" there is a long explanation for that, but for short just swap the node.

Create a function:

--- Code: ---def getParam(ele, param, listr):
paramt = ele.LookupParameter(param)
para = paramt.AsString()
return para
return None
--- End code ---

Then call the function with any parameter that has a string value (it doesn't work for numeric values):

--- Code: ---TransactionManager.Instance.EnsureInTransaction(doc)
prodname = getParam(<elementID>,"Product Long Description", <name of list you wanted to be added>)
--- End code ---

I call it the cheating way, use the node "Parameters" that list all the parameter of the element, then do a get item at index node to get the value of that specific parameter see attachment elementnamev2, just be careful because only works on element that has the value that you want in the same position (index) or you will get random results, see attachment "elementnamev2"

Once again, thanks AXL.  I do love to have choices.  Do you have an idea of why my Product Long Description parameter would come up blank?

Did Revit have access to the Prodinfo.map when you reloaded the config.
All the parameters beginning with Product are read from there.

I have the hangers, I am using in my model, filled into the product info.map.  Is it possible that Revit is not accessing this some how?  I have to admit I have been using Fab MEP for sometime but have rarely used the product info editor until recently so I am not very familiar with how they work together.


[0] Message Index

[#] Next page

Go to full version