Extracting Wall Type Data


#1

Hi

Very impressed with Dynamo - seems to provide functionality with Revit in a similar way that lisp does with AutoCAD.

I am trying to associate text data to wall objects using shared parameters but have run into a “brick wall” so to speak.

The code so far is attached but the I cannot get any type data into the Excel spreadsheet. I would like to extract the URL of a wall for example.

I understand that “Element.GetParameterValueByName” only get instance parameters and that “Get Family Parameter” and “GetTypeParameter.FrmFamilyInstance” can get type data out of families but I am having trouble with the input into these nodes. I have yet to find a way of imputing the wall object into these nodes

Can any one give me some idea on how I can approach this.

Thanks

Kerrykta_excel

 


#2

Hi Kerry,

It seems you are calling the ‘Wall’ category, the ‘GET’ nodes work with types. So if you use the node “Wall Types” it should be able to retrieve the information you need.


#3

Hi Danny

Thank you for the reply.

I can “'GET” data from family types (the desk) but not from system family types (walls) as below. Also not sure how to get the parameter value after the ‘GET’.

 

Kerry

Form_01

 


#4

Which parameter is giving you trouble specifically?


#5

Kerry,

This should read any Type Parameter. Let me know if you still have trouble with it:

Capture

 

 

Keep in mind that if parameter was not assigned it will return a value of Null.


#6

Hi Konrad

Thank you for the reply.konrad_01

Still not working as I get the following error:

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “<string>”, line 9, in <module>
IOError: System.IO.IOException: Could not add reference to assembly RevitServices
at IronPython.Runtime.ClrModule.AddReference(CodeContext context, String name)
at IronPython.Runtime.ClrModule.AddReference(CodeContext context, Object[] references)
at Microsoft.Scripting.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Microsoft.Scripting.Interpreter.DynamicInstruction4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
at Microsoft.Scripting.SourceUnit.Execute(Scope scope)
at DSIronPython.IronPythonEvaluator.EvaluateIronPythonScript(String code, IList bindingNames, IList bindingValues)

 

Code as follows:

#Copyright © 2015 Konrad K Sobon

@arch_laboratory

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

Import Documment Manger and Transaction Manager

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocummentManager.Instance.CurrentDBDocument

#Import RevitAPI
clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *

#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN

elist = IN[0]
nameInput = str(IN[IN])

elements = []
outList = []

for i in range(0,len(elist)):
elements.append(UnwrapElement(elist[i]))

for i in elements:
eleType = doc.GetElement(i,GetTypeId())
params = eleType.Parameters
for i in params:
if i.Definition.name == nameImput:
outList.append(i.AsString())
else:
continue

#Assign your output to the OUT variable
OUT = outList</span>


#7

Just use Element.Type from package Clockwork to retrieve the wall type…

GetTypeParameters


#8

Hi Andreas

Thanks for the input but it still does not work. - I get null result.

konrad_02

 

 


#9

Mmh - very intriguing indeed.

Which version of Dynamo & Clockwork are you using?

Anything special about those walls - what type of wall are we talking about (standard, stacked, CW, in-place)?

Could you post a project file with a few of those walls?


#10

Andreas, I am sorry to infringe on your completely valid solution. I just thought that taking out that extra step of obtaining a wall type and then querying it for a parameter was a decent solution. :slight_smile:

Kerry, It’s your Dynamo version. latest daily builds have some weird behavior in relation to Python. Just roll back to 7.5.X


#11

Hi

Thank you all for the excellent input. Stripped Dynamo out of my system and reinstalled 7.5.

Things started working again after this along with rectifying some transcription errors in the python code above.

Been writing out spreadsheets and .csv files, updating data parameters from these file and playing with some of the other basic functions.

I know that Dynamo is useful for geometry creation etc. but it seems to me that it is very useful for linking data and managing documentation processes such as title sheets, project data and plotting. Is there any plotting/print nodes available or would I use a Python node to do this?

Starting to realize the potential of this stuff.

Cheers

 

Kerry


#12

Hi Kerry,

Is it possible for you to send us your dyn and rvt files etc so that we may follow up. What version of Revit are you using?

Thanks,

Neal

neal.burnham@autodesk.com

 

 

 


#13

Hi Neal

I am now running the 0.8 candidate (0.8.0.856) running on Revit 2015. [20150303_0715(x64)].

I am loading text specification information into Revit parameters. The text is extracted from .pdf files and “unwrapped” using Notepad++ and broken into paragraphs. The text is then processed into a single string broken into “paragraphs” using a line feed with no carriage return using key words for the break. This allows me to tag the field to display the text formatted as below.

2015-04-01_23-19-36

 

 

 

 

 
<p class=“gh-header-title”>I am having an issue as per <span class=“js-issue-title”>File Encoding Issue</span> <span class=“gh-header-number”>#4148 on the Git</span></p>
<p class=“gh-header-title”>I can send you some files if this would help.</p>
<p class=“gh-header-title”>Cheers</p>
<p class=“gh-header-title”>Kerry</p>
<p class=“gh-header-title”></p>


#14

Hi All,

Konrad, could you say a little more about “latest daily builds have some weird behavior in relation to Python”. Not sure what it is you are seeing and want to be able to fix it. Is there a github issue?

This is what I get in 0.8.0

2015-04-02_1357


#15

Hi Konrad, thanks for sharing the Python script. I tested it out on walls but it’s not reading parameters under Analytical such as Absorptance and Roughness. Should it be able to return the values? I’m getting Null, even though these parameters are populated.

I’m looking for something similar but to retrieve instance parameters as the built-in nodes have some serious problems. Can this Python script be modified easily to return instance parameters instead of type?