hey all, happy holiday!
Is there a way in dynamo i can insert a column in revit schedule using the option of “calculated value” ? of course i want to name it of my choice, and also make total of the values in the that column in the last row!
hey all, happy holiday!
Is there a way in dynamo i can insert a column in revit schedule using the option of “calculated value” ? of course i want to name it of my choice, and also make total of the values in the that column in the last row!
@uaftab.cem19 I’m not 100% sure but I think we don’t have access to the Calculated Value via the API. So, I won’t be able to help you on this.
@c.poupin Do you think this can be achieved via Dynamo?
Hello
Apparently it’s not possible
but i never tried it
ah… that is a disappointment.
Well, is it possible that i can add a parameter which is derived from a formula including multiplication of two other parameters of the family??
like i want to add a column in the schedule named “Total Cost”, i would make it a parameter in the project giving it a formula = Area * Unit Cost. and then i can get that parameter as a “Scheduleable field” in dynamo?
@uaftab.cem19 Like this?
wow… yes i guess thats what i want… can you please send this python script?! @Kulkul
Mark the post as solved @uaftab.cem19 .
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
#
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
# To Handle List
toList = lambda x : x if hasattr(x, '__iter__') else [x]
# Inputs
schedule = UnwrapElement(IN[0])
field_name = toList(IN[1])
# "Start" the transaction
TransactionManager.Instance.EnsureInTransaction(doc)
#count the number of rows and columns in the schedule
table = schedule.GetTableData().GetSectionData(SectionType.Body)
nRows = table.NumberOfRows
nColumns = table.NumberOfColumns
#Collect all of data from the schedule
dataListRow = []
for row in range(nRows): #Iterate through the rows. The second row is always a blank space
dataListColumn = []
for column in range(nColumns): #Iterate through the columns
dataListColumn.Add( TableView.GetCellText(schedule, SectionType.Body, row, column) )
dataListRow.Add( dataListColumn );
# "End" the transaction
TransactionManager.Instance.TransactionTaskDone()
OUT = [x for x in map(list, zip(*dataListRow)) if any(f in x for f in field_name)]
@uaftab.cem19
Glad that it solved your issue.
Just curious to how the python script resolved your issue?
It doesn’t insert anything in the schedule
actually i was busy and i just didnt try it yet. i dont understand the revit API thats why i just marked as solution. was it not right @AmolShah ?
@uaftab.cem19 For me it just reads the values of the column whose name you put in IN[1].
lol, no i wanted something else. i wanted to make a column using dynamo.
@AmolShah that’s why i asked to confirm before dropping the code.
You’re confusing me and others . Is this what you want?
yes that is exactly what i want @Kulkul , but i want this field to be a “calculated value”. means; i want to put a formula in this. like i want this w = paramter1 * parameter2
so it becomes:
Did somebody solved this? I’m trying to do the same thing as @uaftab.cem19