parent
2e83f6385e
commit
58111b3305
@ -1,144 +1,568 @@ |
||||
<Workspace Version="1.3.2.2480" X="-2008.68037262133" Y="-700.756032737877" zoom="1.13293551739829" ScaleFactor="1" Name="Home" Description="" RunType="Manual" RunPeriod="1000" HasRunWithoutCrash="True"> |
||||
<NamespaceResolutionMap /> |
||||
<Elements> |
||||
<DSRevitNodesUI.Views guid="b9bb771d-cfd3-4df2-aeeb-9d44732c64fd" type="DSRevitNodesUI.Views" nickname="Schedule View" x="1662.77230550043" y="769.94732600849" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="True" IsFrozen="false" isPinned="false" index="2:FINISH SCHEDULE KEYNOTES" /> |
||||
<CoreNodeModels.Input.Filename guid="8a2a5825-305b-4435-a635-d39b6b04b003" type="CoreNodeModels.Input.Filename" nickname="CSV File Path" x="1662.77230550043" y="855.685643099918" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="True" IsFrozen="false" isPinned="false"> |
||||
<System.String>.\Partition Tag Nomenclature.csv</System.String> |
||||
<HintPath>D:\Dimitar\_Temp\BM\OD\Partition Tag Nomenclature.csv</HintPath> |
||||
</CoreNodeModels.Input.Filename> |
||||
<PythonNodeModels.PythonNode guid="b3e9e004-6e80-4110-961e-8d411c7b8494" type="PythonNodeModels.PythonNode" nickname="csv.ReadUnicode" x="2156.38991458643" y="856.642913909998" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" inputcount="4"> |
||||
<PortInfo index="0" default="False" /> |
||||
<PortInfo index="1" default="False" /> |
||||
<PortInfo index="2" default="False" /> |
||||
<PortInfo index="3" default="False" /> |
||||
<Script># Copyright(c) 2016, Bad Monkeys |
||||
# www.badmonkeys.net |
||||
|
||||
import clr |
||||
import System |
||||
pf_path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86) |
||||
import sys |
||||
sys.path.append('%s\IronPython 2.7\Lib' %pf_path) |
||||
import csv |
||||
import io |
||||
|
||||
csv_path, to_replace, rep, _ = IN |
||||
|
||||
with io.open(csv_path, 'rU', encoding='utf-8') as f: |
||||
data = csv.reader(f) |
||||
OUT = [[c.replace('\n', rep) for c in row] for row in data] if to_replace else list(data)</Script> |
||||
</PythonNodeModels.PythonNode> |
||||
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="87cb1247-b81d-4eb8-ae0f-28aba9a6d838" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="List.Deconstruct" x="2304.23941830452" y="855.896552452774" isVisible="true" isUpstreamVisible="true" lacing="Shortest" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="DSCoreNodes.dll" function="DSCore.List.Deconstruct@var[]..[]"> |
||||
<PortInfo index="0" default="False" /> |
||||
</Dynamo.Graph.Nodes.ZeroTouch.DSFunction> |
||||
<CoreNodeModels.Watch guid="250a82aa-ad6c-4f5a-a023-39ad8505c8d0" type="CoreNodeModels.Watch" nickname="Watch" x="2879.27291820314" y="817.218553272954" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false"> |
||||
<PortInfo index="0" default="False" /> |
||||
</CoreNodeModels.Watch> |
||||
<PythonNodeModels.PythonNode guid="ae88e609-d7dc-404d-b280-deca278f3027" type="PythonNodeModels.PythonNode" nickname="KeySchedule.Populate" x="2710.75543431257" y="819.328790154528" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" inputcount="4"> |
||||
<PortInfo index="0" default="False" /> |
||||
<PortInfo index="1" default="False" /> |
||||
<PortInfo index="2" default="False" /> |
||||
<PortInfo index="3" default="False" /> |
||||
<Script># Copyright(c) 2017, Dimitar Venkov |
||||
# @5devene, dimitar.ven@gmail.com |
||||
# www.badmonkeys.net |
||||
# inspired by the Key Schedule node from arcni-lab.net |
||||
|
||||
import clr |
||||
|
||||
clr.AddReference('RevitAPI') |
||||
from Autodesk.Revit.DB import * |
||||
|
||||
clr.AddReference('RevitServices') |
||||
from RevitServices.Persistence import DocumentManager |
||||
from RevitServices.Transactions import TransactionManager |
||||
doc = DocumentManager.Instance.CurrentDBDocument |
||||
|
||||
ks1 = UnwrapElement(IN[0]) |
||||
headers = IN[1] |
||||
data = IN[2] |
||||
|
||||
try: |
||||
TransactionManager.Instance.EnsureInTransaction(doc) |
||||
if any(isinstance(item, list) for item in data): |
||||
col_count = max(map(len, data) ) |
||||
if col_count != ks1.Definition.GetFieldCount() or col_count != len(headers): |
||||
raise Exception('Prepare the key schedule fields in\nadvance, so that they match the data set.') |
||||
else: |
||||
tableData = ks1.GetTableData() |
||||
sectionData = tableData.GetSectionData(SectionType.Body) |
||||
row_count = sectionData.NumberOfRows |
||||
firstRows = 1 |
||||
if row_count != 1: |
||||
st1 = SubTransaction(doc) |
||||
st1.Start() |
||||
try: |
||||
sectionData.RemoveRow(1) |
||||
except: |
||||
firstRows = 2 |
||||
st1.RollBack() |
||||
st1.Dispose() |
||||
if row_count - firstRows < len(data): |
||||
rowsToAdd = len(data) - row_count + firstRows |
||||
for _ in xrange(0, rowsToAdd): |
||||
sectionData.InsertRow(0) |
||||
else: |
||||
# schedule when updating might already have too many rows |
||||
rowsToDelete = row_count - firstRows - len(data) |
||||
for i in xrange(row_count -1, row_count - rowsToDelete -1, -1): |
||||
sectionData.RemoveRow(i) |
||||
doc.Regenerate() |
||||
row_elems = FilteredElementCollector(doc, ks1.Id) |
||||
i = 0 |
||||
for e in row_elems: |
||||
params = e.ParametersMap |
||||
for j in xrange(col_count): |
||||
params[headers[j] ].Set(unicode(data[i][j]) ) |
||||
i += 1 |
||||
TransactionManager.Instance.TransactionTaskDone() |
||||
OUT = "Schedule set successfully." |
||||
except Exception, ex: |
||||
OUT = ex</Script> |
||||
</PythonNodeModels.PythonNode> |
||||
<CoreNodeModels.Input.BoolSelector guid="3f21436c-35a1-41d2-9dc6-68cb43c5c869" type="CoreNodeModels.Input.BoolSelector" nickname="Refresh" x="1662.77230550043" y="1083.74166137266" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="True" IsFrozen="false" isPinned="false"> |
||||
<System.Boolean>True</System.Boolean> |
||||
</CoreNodeModels.Input.BoolSelector> |
||||
<Dynamo.Graph.Nodes.CodeBlockNodeModel guid="c0310612-87e0-467c-a143-2a7b4fbea68b" type="Dynamo.Graph.Nodes.CodeBlockNodeModel" nickname="Code Block" x="1142.08195373453" y="735.865696137215" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" CodeText="/*

DYNAMO VERSION: 1.3+
REVIT VERSION: 2016+

Created by: Dimitar Venkov
Created on: 09/01/17

Modified by: Dimitar Venkov
Modified on: 12/03/18

Modified by:
Modified on:

REQUIRED PACKAGES:
------------------------------

DESCRIPTION:
------------------------------
- All files must be encoded as UTF-8.

- Make sure that you've created a Schedule beforehand
 and have added a new Text field (Fields > Add Parameter,
 Type of Parameter > Text) for each header name in the
 csv file.

- As of the graph creation date, key schedule fields can
 not be created and added programatically through the API.

ISSUES:
------------------------------

*/;" ShouldFocus="false" /> |
||||
<CoreNodeModels.Input.BoolSelector guid="aee38477-dfcd-4383-8c0b-f18fc41db905" type="CoreNodeModels.Input.BoolSelector" nickname="Replace NewLine" x="1662.77230550043" y="950.758428420376" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="True" IsFrozen="false" isPinned="false"> |
||||
<System.Boolean>False</System.Boolean> |
||||
</CoreNodeModels.Input.BoolSelector> |
||||
<CoreNodeModels.Input.StringInput guid="fa6a663b-2db2-44e0-b945-59b5b0aa1e96" type="CoreNodeModels.Input.StringInput" nickname="Replacement" x="1662.77230550043" y="1009.63815339506" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="True" IsFrozen="false" isPinned="false"> |
||||
<System.String>, </System.String> |
||||
<System.String value=", " /> |
||||
</CoreNodeModels.Input.StringInput> |
||||
</Elements> |
||||
<Connectors> |
||||
<Dynamo.Graph.Connectors.ConnectorModel start="b9bb771d-cfd3-4df2-aeeb-9d44732c64fd" start_index="0" end="ae88e609-d7dc-404d-b280-deca278f3027" end_index="0" portType="0" /> |
||||
<Dynamo.Graph.Connectors.ConnectorModel start="8a2a5825-305b-4435-a635-d39b6b04b003" start_index="0" end="b3e9e004-6e80-4110-961e-8d411c7b8494" end_index="0" portType="0" /> |
||||
<Dynamo.Graph.Connectors.ConnectorModel start="b3e9e004-6e80-4110-961e-8d411c7b8494" start_index="0" end="87cb1247-b81d-4eb8-ae0f-28aba9a6d838" end_index="0" portType="0" /> |
||||
<Dynamo.Graph.Connectors.ConnectorModel start="87cb1247-b81d-4eb8-ae0f-28aba9a6d838" start_index="0" end="ae88e609-d7dc-404d-b280-deca278f3027" end_index="1" portType="0" /> |
||||
<Dynamo.Graph.Connectors.ConnectorModel start="87cb1247-b81d-4eb8-ae0f-28aba9a6d838" start_index="1" end="ae88e609-d7dc-404d-b280-deca278f3027" end_index="2" portType="0" /> |
||||
<Dynamo.Graph.Connectors.ConnectorModel start="ae88e609-d7dc-404d-b280-deca278f3027" start_index="0" end="250a82aa-ad6c-4f5a-a023-39ad8505c8d0" end_index="0" portType="0" /> |
||||
<Dynamo.Graph.Connectors.ConnectorModel start="3f21436c-35a1-41d2-9dc6-68cb43c5c869" start_index="0" end="ae88e609-d7dc-404d-b280-deca278f3027" end_index="3" portType="0" /> |
||||
<Dynamo.Graph.Connectors.ConnectorModel start="3f21436c-35a1-41d2-9dc6-68cb43c5c869" start_index="0" end="b3e9e004-6e80-4110-961e-8d411c7b8494" end_index="3" portType="0" /> |
||||
<Dynamo.Graph.Connectors.ConnectorModel start="aee38477-dfcd-4383-8c0b-f18fc41db905" start_index="0" end="b3e9e004-6e80-4110-961e-8d411c7b8494" end_index="1" portType="0" /> |
||||
<Dynamo.Graph.Connectors.ConnectorModel start="fa6a663b-2db2-44e0-b945-59b5b0aa1e96" start_index="0" end="b3e9e004-6e80-4110-961e-8d411c7b8494" end_index="2" portType="0" /> |
||||
</Connectors> |
||||
<Notes> |
||||
<Dynamo.Graph.Notes.NoteModel guid="e839ffb5-792f-4f51-96fc-b30a604643ef" text="filePath: string
repNewLine: bool
replacement: str
Refresh: bool" x="2033.7604683447" y="913.767755575526" /> |
||||
<Dynamo.Graph.Notes.NoteModel guid="5b8043e6-5ef4-4f9d-bde5-e8f5b8258a22" text="scheduleView: view
headers: string[]
data: string[][]
refresh: bool" x="2561.83054685524" y="868.260847724039" /> |
||||
</Notes> |
||||
<Annotations> |
||||
<Dynamo.Graph.Annotations.AnnotationModel guid="9614cf5b-5694-4fa4-a587-7ed1d63f42a1" annotationText="INPUT:" left="1652.77230550043" top="739.94732600849" width="238" height="411.79433536417" fontSize="14" InitialTop="769.94732600849" InitialHeight="411.794335364167" TextblockHeight="20" backgrouund="#FF848484"> |
||||
<Models ModelGuid="b9bb771d-cfd3-4df2-aeeb-9d44732c64fd" /> |
||||
<Models ModelGuid="8a2a5825-305b-4435-a635-d39b6b04b003" /> |
||||
<Models ModelGuid="3f21436c-35a1-41d2-9dc6-68cb43c5c869" /> |
||||
<Models ModelGuid="aee38477-dfcd-4383-8c0b-f18fc41db905" /> |
||||
<Models ModelGuid="fa6a663b-2db2-44e0-b945-59b5b0aa1e96" /> |
||||
</Dynamo.Graph.Annotations.AnnotationModel> |
||||
</Annotations> |
||||
<Presets /> |
||||
<Cameras> |
||||
<Camera Name="Background Preview" eyeX="-17" eyeY="24" eyeZ="50" lookX="12" lookY="-13" lookZ="-58" upX="0" upY="1" upZ="0" /> |
||||
</Cameras> |
||||
</Workspace> |
||||
{ |
||||
"Uuid": "3c9d0464-8643-5ffe-96e5-ab1769818209", |
||||
"IsCustomNode": false, |
||||
"Description": "", |
||||
"Name": "Finish Key_Read_3", |
||||
"ElementResolver": { |
||||
"ResolutionMap": {} |
||||
}, |
||||
"Inputs": [ |
||||
{ |
||||
"Id": "8a2a5825305b4435a635d39b6b04b003", |
||||
"Name": "CSV File Path", |
||||
"Type": "string", |
||||
"Value": "..\\..\\..\\..\\..\\Forage Kombucha\\Models & CAD\\BIM\\CAD - Linked\\Code Information.csv", |
||||
"Description": "Allows you to select a file on the system to get its filename" |
||||
}, |
||||
{ |
||||
"Id": "3f21436c35a141d29dc668cb43c5c869", |
||||
"Name": "Refresh", |
||||
"Type": "boolean", |
||||
"Value": "true", |
||||
"Description": "Selection between a true and false." |
||||
}, |
||||
{ |
||||
"Id": "aee38477dfcd43838c0bf18fc41db905", |
||||
"Name": "Replace NewLine", |
||||
"Type": "boolean", |
||||
"Value": "false", |
||||
"Description": "Selection between a true and false." |
||||
}, |
||||
{ |
||||
"Id": "fa6a663b2db244e0b94559b5b0aa1e96", |
||||
"Name": "Replacement", |
||||
"Type": "string", |
||||
"Value": ", ", |
||||
"Description": "Creates a string." |
||||
} |
||||
], |
||||
"Outputs": [], |
||||
"Nodes": [ |
||||
{ |
||||
"ConcreteType": "DSRevitNodesUI.Views, DSRevitNodesUI", |
||||
"SelectedIndex": 26, |
||||
"NodeType": "ExtensionNode", |
||||
"Id": "b9bb771dcfd34df2aeeb9d44732c64fd", |
||||
"Inputs": [], |
||||
"Outputs": [ |
||||
{ |
||||
"Id": "55d115ec29d74a3f96b571ebdc5fd647", |
||||
"Name": "Views", |
||||
"Description": "The selected Views", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Replication": "Disabled", |
||||
"Description": "All views available in the current document." |
||||
}, |
||||
{ |
||||
"ConcreteType": "CoreNodeModels.Input.Filename, CoreNodeModels", |
||||
"HintPath": "C:\\Dropbox\\GitHub\\Forage Kombucha\\Models & CAD\\BIM\\CAD - Linked\\Code Information.csv", |
||||
"InputValue": "..\\..\\..\\..\\..\\Forage Kombucha\\Models & CAD\\BIM\\CAD - Linked\\Code Information.csv", |
||||
"NodeType": "ExtensionNode", |
||||
"Id": "8a2a5825305b4435a635d39b6b04b003", |
||||
"Inputs": [], |
||||
"Outputs": [ |
||||
{ |
||||
"Id": "dd66b6447fed49aeae8236864e70cc7a", |
||||
"Name": "", |
||||
"Description": "Filename", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Replication": "Disabled", |
||||
"Description": "Allows you to select a file on the system to get its filename" |
||||
}, |
||||
{ |
||||
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels", |
||||
"NodeType": "PythonScriptNode", |
||||
"Code": "# Copyright(c) 2016, Bad Monkeys\n# www.badmonkeys.net\n\nimport clr\nimport System\npf_path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86)\nimport sys\nsys.path.append('%s\\IronPython 2.7\\Lib' %pf_path)\nimport csv\nimport io\n\ncsv_path, to_replace, rep, _ = IN\n\nwith io.open(csv_path, 'rU', encoding='utf-8') as f:\n\tdata = csv.reader(f)\n\tOUT = [[c.replace('\\n', rep) for c in row] for row in data] if to_replace else list(data)", |
||||
"VariableInputPorts": true, |
||||
"Id": "b3e9e0046e804110961e8d411c7b8494", |
||||
"Inputs": [ |
||||
{ |
||||
"Id": "0851eab4fa804a368f005f343e639cc1", |
||||
"Name": "IN[0]", |
||||
"Description": "Input #0", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
}, |
||||
{ |
||||
"Id": "48b8677470264e6d9cbed1bc79a36dab", |
||||
"Name": "IN[1]", |
||||
"Description": "Input #1", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
}, |
||||
{ |
||||
"Id": "87f44d3ad7e646178071aae4514c2cc1", |
||||
"Name": "IN[2]", |
||||
"Description": "Input #2", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
}, |
||||
{ |
||||
"Id": "c2978f4af82c4f7a96e35ddf4eccc643", |
||||
"Name": "IN[3]", |
||||
"Description": "Input #3", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Outputs": [ |
||||
{ |
||||
"Id": "89a04d1950634c869db716265403dc58", |
||||
"Name": "OUT", |
||||
"Description": "Result of the python script", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Replication": "Disabled", |
||||
"Description": "Runs an embedded IronPython script." |
||||
}, |
||||
{ |
||||
"ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", |
||||
"NodeType": "FunctionNode", |
||||
"FunctionSignature": "DSCore.List.Deconstruct@var[]..[]", |
||||
"Id": "87cb1247b81d4eb8ae0f28aba9a6d838", |
||||
"Inputs": [ |
||||
{ |
||||
"Id": "708f7be1cbd0466ca09e250a9bafde2c", |
||||
"Name": "list", |
||||
"Description": "List to be split.\n\nvar[]..[]", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Outputs": [ |
||||
{ |
||||
"Id": "79f6883ab71d4e3d9bc50c54aa4687d9", |
||||
"Name": "first", |
||||
"Description": "First item in the list.", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
}, |
||||
{ |
||||
"Id": "3b1632e4f6f44830857b09d9e9dff429", |
||||
"Name": "rest", |
||||
"Description": "Rest of the list.", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Replication": "Auto", |
||||
"Description": "Given a list, produces the first item in the list, and a new list containing all items except the first.\n\nList.Deconstruct (list: var[]..[]): var[]..[]" |
||||
}, |
||||
{ |
||||
"ConcreteType": "CoreNodeModels.Watch, CoreNodeModels", |
||||
"NodeType": "ExtensionNode", |
||||
"Id": "250a82aaad6c4f5aa02339ad8505c8d0", |
||||
"Inputs": [ |
||||
{ |
||||
"Id": "4c263fe86a9c45e8a5ef68968c4a4c8f", |
||||
"Name": "", |
||||
"Description": "Node to evaluate.", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Outputs": [ |
||||
{ |
||||
"Id": "0e1084777a824c05bdc3eae5ae3f878b", |
||||
"Name": "", |
||||
"Description": "Watch contents.", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Replication": "Disabled", |
||||
"Description": "Visualize the output of node." |
||||
}, |
||||
{ |
||||
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels", |
||||
"NodeType": "PythonScriptNode", |
||||
"Code": "# Copyright(c) 2017, Dimitar Venkov\r\n# @5devene, dimitar.ven@gmail.com\r\n# www.badmonkeys.net\r\n# inspired by the Key Schedule node from arcni-lab.net\r\n\r\nimport clr\r\n\r\nclr.AddReference('RevitAPI')\r\nfrom Autodesk.Revit.DB import *\r\n\r\nclr.AddReference('RevitServices')\r\nfrom RevitServices.Persistence import DocumentManager\r\nfrom RevitServices.Transactions import TransactionManager\r\ndoc = DocumentManager.Instance.CurrentDBDocument\r\n\r\nks1 = UnwrapElement(IN[0])\r\nheaders = IN[1]\r\ndata = IN[2]\r\n\r\ntry:\r\n\tTransactionManager.Instance.EnsureInTransaction(doc)\r\n\tif any(isinstance(item, list) for item in data):\r\n\t\tcol_count = max(map(len, data) )\r\n\t\tif col_count != ks1.Definition.GetFieldCount() or col_count != len(headers):\r\n\t\t\traise Exception('Prepare the key schedule fields in\\nadvance, so that they match the data set.')\r\n\t\telse:\r\n\t\t\ttableData = ks1.GetTableData()\r\n\t\t\tsectionData = tableData.GetSectionData(SectionType.Body)\r\n\t\t\trow_count = sectionData.NumberOfRows\r\n\t\t\tfirstRows = 1\r\n\t\t\tif row_count != 1:\r\n\t\t\t\tst1 = SubTransaction(doc)\r\n\t\t\t\tst1.Start()\r\n\t\t\t\ttry:\r\n\t\t\t\t\tsectionData.RemoveRow(1)\r\n\t\t\t\texcept:\r\n\t\t\t\t\tfirstRows = 2\r\n\t\t\t\tst1.RollBack()\r\n\t\t\t\tst1.Dispose()\r\n\t\t\tif row_count - firstRows < len(data):\r\n\t\t\t\trowsToAdd = len(data) - row_count + firstRows\r\n\t\t\t\tfor _ in xrange(0, rowsToAdd):\r\n\t\t\t\t\tsectionData.InsertRow(0)\r\n\t\t\telse:\r\n\t\t\t\t# schedule when updating might already have too many rows \r\n\t\t\t\trowsToDelete = row_count - firstRows - len(data)\r\n\t\t\t\tfor i in xrange(row_count -1, row_count - rowsToDelete -1, -1):\r\n\t\t\t\t\tsectionData.RemoveRow(i)\r\n\t\t\tdoc.Regenerate()\r\n\t\t\trow_elems = FilteredElementCollector(doc, ks1.Id)\r\n\t\t\ti = 0\r\n\t\t\tfor e in row_elems:\r\n\t\t\t\tparams = e.ParametersMap\r\n\t\t\t\tfor j in xrange(col_count):\r\n\t\t\t\t\tparams[headers[j] ].Set(unicode(data[i][j]) )\r\n\t\t\t\ti += 1\r\n\tTransactionManager.Instance.TransactionTaskDone()\r\n\tOUT = \"Schedule set successfully.\"\r\nexcept Exception, ex:\r\n\tOUT = ex", |
||||
"VariableInputPorts": true, |
||||
"Id": "ae88e609d7dc404db280deca278f3027", |
||||
"Inputs": [ |
||||
{ |
||||
"Id": "b7170f221dc74b9b845a3ced781cc5a7", |
||||
"Name": "IN[0]", |
||||
"Description": "Input #0", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
}, |
||||
{ |
||||
"Id": "2ad4672e33644a8aabcf47c7c112cb98", |
||||
"Name": "IN[1]", |
||||
"Description": "Input #1", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
}, |
||||
{ |
||||
"Id": "f1cd51b90f7147b2b9d1eacd357159ea", |
||||
"Name": "IN[2]", |
||||
"Description": "Input #2", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
}, |
||||
{ |
||||
"Id": "a08b9d322f924b65b3f808bd0adeef39", |
||||
"Name": "IN[3]", |
||||
"Description": "Input #3", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Outputs": [ |
||||
{ |
||||
"Id": "54d593a6a2c14cfdafc2d03b155faca9", |
||||
"Name": "OUT", |
||||
"Description": "Result of the python script", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Replication": "Disabled", |
||||
"Description": "Runs an embedded IronPython script." |
||||
}, |
||||
{ |
||||
"ConcreteType": "CoreNodeModels.Input.BoolSelector, CoreNodeModels", |
||||
"NodeType": "BooleanInputNode", |
||||
"InputValue": true, |
||||
"Id": "3f21436c35a141d29dc668cb43c5c869", |
||||
"Inputs": [], |
||||
"Outputs": [ |
||||
{ |
||||
"Id": "c08df7e2a7044c3f99e563d07a34611d", |
||||
"Name": "", |
||||
"Description": "Boolean", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Replication": "Disabled", |
||||
"Description": "Selection between a true and false." |
||||
}, |
||||
{ |
||||
"ConcreteType": "Dynamo.Graph.Nodes.CodeBlockNodeModel, DynamoCore", |
||||
"NodeType": "CodeBlockNode", |
||||
"Code": "/*\n\nDYNAMO VERSION: 1.3+\nREVIT VERSION: 2016+\n\nCreated by: Dimitar Venkov\nCreated on: 09/01/17\n\nModified by: Dimitar Venkov\nModified on: 12/03/18\n\nModified by:\nModified on:\n\nREQUIRED PACKAGES:\n------------------------------\n\nDESCRIPTION:\n------------------------------\n- All files must be encoded as UTF-8.\n\n- Make sure that you've created a Schedule beforehand\n and have added a new Text field (Fields > Add Parameter,\n Type of Parameter > Text) for each header name in the\n csv file.\n\n- As of the graph creation date, key schedule fields can\n not be created and added programatically through the API.\n\nISSUES:\n------------------------------\n\n*/;", |
||||
"Id": "c031061287e0467ca1432a7b4fbea68b", |
||||
"Inputs": [], |
||||
"Outputs": [], |
||||
"Replication": "Disabled", |
||||
"Description": "Allows for DesignScript code to be authored directly" |
||||
}, |
||||
{ |
||||
"ConcreteType": "CoreNodeModels.Input.BoolSelector, CoreNodeModels", |
||||
"NodeType": "BooleanInputNode", |
||||
"InputValue": false, |
||||
"Id": "aee38477dfcd43838c0bf18fc41db905", |
||||
"Inputs": [], |
||||
"Outputs": [ |
||||
{ |
||||
"Id": "69ce1f0dc90342dea16a8e7f4b514f86", |
||||
"Name": "", |
||||
"Description": "Boolean", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Replication": "Disabled", |
||||
"Description": "Selection between a true and false." |
||||
}, |
||||
{ |
||||
"ConcreteType": "CoreNodeModels.Input.StringInput, CoreNodeModels", |
||||
"NodeType": "StringInputNode", |
||||
"InputValue": ", ", |
||||
"Id": "fa6a663b2db244e0b94559b5b0aa1e96", |
||||
"Inputs": [], |
||||
"Outputs": [ |
||||
{ |
||||
"Id": "70f36a3f6f8c48949e00fc47347a32bc", |
||||
"Name": "", |
||||
"Description": "String", |
||||
"UsingDefaultValue": false, |
||||
"Level": 2, |
||||
"UseLevels": false, |
||||
"KeepListStructure": false |
||||
} |
||||
], |
||||
"Replication": "Disabled", |
||||
"Description": "Creates a string." |
||||
} |
||||
], |
||||
"Connectors": [ |
||||
{ |
||||
"Start": "55d115ec29d74a3f96b571ebdc5fd647", |
||||
"End": "b7170f221dc74b9b845a3ced781cc5a7", |
||||
"Id": "d1f7e25790194a36bd1128266fd52d3e" |
||||
}, |
||||
{ |
||||
"Start": "dd66b6447fed49aeae8236864e70cc7a", |
||||
"End": "0851eab4fa804a368f005f343e639cc1", |
||||
"Id": "64c2b49c014249389cbb22e694018816" |
||||
}, |
||||
{ |
||||
"Start": "89a04d1950634c869db716265403dc58", |
||||
"End": "708f7be1cbd0466ca09e250a9bafde2c", |
||||
"Id": "d948241b252a4e2bbf42d448566d8169" |
||||
}, |
||||
{ |
||||
"Start": "79f6883ab71d4e3d9bc50c54aa4687d9", |
||||
"End": "2ad4672e33644a8aabcf47c7c112cb98", |
||||
"Id": "74041b21fbc4417bb00594d3f714ddba" |
||||
}, |
||||
{ |
||||
"Start": "3b1632e4f6f44830857b09d9e9dff429", |
||||
"End": "f1cd51b90f7147b2b9d1eacd357159ea", |
||||
"Id": "bbd66cc6420a49f7b0907a193a048786" |
||||
}, |
||||
{ |
||||
"Start": "54d593a6a2c14cfdafc2d03b155faca9", |
||||
"End": "4c263fe86a9c45e8a5ef68968c4a4c8f", |
||||
"Id": "ce1977f069354351b9d14fb86346b482" |
||||
}, |
||||
{ |
||||
"Start": "c08df7e2a7044c3f99e563d07a34611d", |
||||
"End": "a08b9d322f924b65b3f808bd0adeef39", |
||||
"Id": "b9ce9499b92147a6a137a376163db677" |
||||
}, |
||||
{ |
||||
"Start": "c08df7e2a7044c3f99e563d07a34611d", |
||||
"End": "c2978f4af82c4f7a96e35ddf4eccc643", |
||||
"Id": "1250bf1d265b48bab5d5f64783bb016b" |
||||
}, |
||||
{ |
||||
"Start": "69ce1f0dc90342dea16a8e7f4b514f86", |
||||
"End": "48b8677470264e6d9cbed1bc79a36dab", |
||||
"Id": "c71745ecbcdd41509312616e2b3e085d" |
||||
}, |
||||
{ |
||||
"Start": "70f36a3f6f8c48949e00fc47347a32bc", |
||||
"End": "87f44d3ad7e646178071aae4514c2cc1", |
||||
"Id": "0da16d84573a428eaff6127cadfa6479" |
||||
} |
||||
], |
||||
"Dependencies": [], |
||||
"Bindings": [], |
||||
"View": { |
||||
"Dynamo": { |
||||
"ScaleFactor": 1.0, |
||||
"HasRunWithoutCrash": true, |
||||
"IsVisibleInDynamoLibrary": true, |
||||
"Version": "2.0.1.5055", |
||||
"RunType": "Manual", |
||||
"RunPeriod": "1000" |
||||
}, |
||||
"Camera": { |
||||
"Name": "Background Preview", |
||||
"EyeX": -17.0, |
||||
"EyeY": 24.0, |
||||
"EyeZ": 50.0, |
||||
"LookX": 12.0, |
||||
"LookY": -13.0, |
||||
"LookZ": -58.0, |
||||
"UpX": 0.0, |
||||
"UpY": 1.0, |
||||
"UpZ": 0.0 |
||||
}, |
||||
"NodeViews": [ |
||||
{ |
||||
"ShowGeometry": true, |
||||
"Name": "Schedule View", |
||||
"Id": "b9bb771dcfd34df2aeeb9d44732c64fd", |
||||
"IsSetAsInput": true, |
||||
"IsSetAsOutput": false, |
||||
"Excluded": false, |
||||
"X": 1662.77230550043, |
||||
"Y": 769.94732600849 |
||||
}, |
||||
{ |
||||
"ShowGeometry": true, |
||||
"Name": "CSV File Path", |
||||
"Id": "8a2a5825305b4435a635d39b6b04b003", |
||||
"IsSetAsInput": true, |
||||
"IsSetAsOutput": false, |
||||
"Excluded": false, |
||||
"X": 1662.77230550043, |
||||
"Y": 855.685643099918 |
||||
}, |
||||
{ |
||||
"ShowGeometry": true, |
||||
"Name": "csv.ReadUnicode", |
||||
"Id": "b3e9e0046e804110961e8d411c7b8494", |
||||
"IsSetAsInput": false, |
||||
"IsSetAsOutput": false, |
||||
"Excluded": false, |
||||
"X": 2156.38991458643, |
||||
"Y": 856.642913909998 |
||||
}, |
||||
{ |
||||
"ShowGeometry": true, |
||||
"Name": "List.Deconstruct", |
||||
"Id": "87cb1247b81d4eb8ae0f28aba9a6d838", |
||||
"IsSetAsInput": false, |
||||
"IsSetAsOutput": false, |
||||
"Excluded": false, |
||||
"X": 2304.23941830452, |
||||
"Y": 855.896552452774 |
||||
}, |
||||
{ |
||||
"ShowGeometry": true, |
||||
"Name": "Watch", |
||||
"Id": "250a82aaad6c4f5aa02339ad8505c8d0", |
||||
"IsSetAsInput": false, |
||||
"IsSetAsOutput": false, |
||||
"Excluded": false, |
||||
"X": 2879.27291820314, |
||||
"Y": 817.218553272954 |
||||
}, |
||||
{ |
||||
"ShowGeometry": true, |
||||
"Name": "KeySchedule.Populate", |
||||
"Id": "ae88e609d7dc404db280deca278f3027", |
||||
"IsSetAsInput": false, |
||||
"IsSetAsOutput": false, |
||||
"Excluded": false, |
||||
"X": 2710.75543431257, |
||||
"Y": 819.328790154528 |
||||
}, |
||||
{ |
||||
"ShowGeometry": true, |
||||
"Name": "Refresh", |
||||
"Id": "3f21436c35a141d29dc668cb43c5c869", |
||||
"IsSetAsInput": true, |
||||
"IsSetAsOutput": false, |
||||
"Excluded": false, |
||||
"X": 1662.77230550043, |
||||
"Y": 1083.74166137266 |
||||
}, |
||||
{ |
||||
"ShowGeometry": true, |
||||
"Name": "Code Block", |
||||
"Id": "c031061287e0467ca1432a7b4fbea68b", |
||||
"IsSetAsInput": false, |
||||
"IsSetAsOutput": false, |
||||
"Excluded": false, |
||||
"X": 1142.08195373453, |
||||
"Y": 735.865696137215 |
||||
}, |
||||
{ |
||||
"ShowGeometry": true, |
||||
"Name": "Replace NewLine", |
||||
"Id": "aee38477dfcd43838c0bf18fc41db905", |
||||
"IsSetAsInput": true, |
||||
"IsSetAsOutput": false, |
||||
"Excluded": false, |
||||
"X": 1662.77230550043, |
||||
"Y": 950.758428420376 |
||||
}, |
||||
{ |
||||
"ShowGeometry": true, |
||||
"Name": "Replacement", |
||||
"Id": "fa6a663b2db244e0b94559b5b0aa1e96", |
||||
"IsSetAsInput": true, |
||||
"IsSetAsOutput": false, |
||||
"Excluded": false, |
||||
"X": 1662.77230550043, |
||||
"Y": 1009.63815339506 |
||||
} |
||||
], |
||||
"Annotations": [ |
||||
{ |
||||
"Id": "9614cf5b56944fa4a5877ed1d63f42a1", |
||||
"Title": "INPUT:", |
||||
"Nodes": [ |
||||
"b9bb771dcfd34df2aeeb9d44732c64fd", |
||||
"8a2a5825305b4435a635d39b6b04b003", |
||||
"3f21436c35a141d29dc668cb43c5c869", |
||||
"aee38477dfcd43838c0bf18fc41db905", |
||||
"fa6a663b2db244e0b94559b5b0aa1e96" |
||||
], |
||||
"Left": 1652.77230550043, |
||||
"Top": 739.94732600849, |
||||
"Width": 293.0, |
||||
"Height": 411.79433536417, |
||||
"FontSize": 14.0, |
||||
"InitialTop": 769.94732600849, |
||||
"InitialHeight": 411.794335364167, |
||||
"TextblockHeight": 20.0, |
||||
"Background": "#FF848484" |
||||
}, |
||||
{ |
||||
"Id": "e839ffb5792f4f5196fcb30a604643ef", |
||||
"Title": "filePath: string\r\nrepNewLine: bool\r\nreplacement: str\r\nRefresh: bool", |
||||
"Nodes": [], |
||||
"Left": 2033.7604683447, |
||||
"Top": 913.767755575526, |
||||
"Width": 0.0, |
||||
"Height": 0.0, |
||||
"FontSize": 36.0, |
||||
"InitialTop": 0.0, |
||||
"InitialHeight": 0.0, |
||||
"TextblockHeight": 0.0, |
||||
"Background": "#FFC1D676" |
||||
}, |
||||
{ |
||||
"Id": "5b8043e65ef44f9dbde5e8f5b8258a22", |
||||
"Title": "scheduleView: view\r\nheaders: string[]\r\ndata: string[][]\r\nrefresh: bool", |
||||
"Nodes": [], |
||||
"Left": 2561.83054685524, |
||||
"Top": 868.260847724039, |
||||
"Width": 0.0, |
||||
"Height": 0.0, |
||||
"FontSize": 36.0, |
||||
"InitialTop": 0.0, |
||||
"InitialHeight": 0.0, |
||||
"TextblockHeight": 0.0, |
||||
"Background": "#FFC1D676" |
||||
} |
||||
], |
||||
"X": -722.23982906755737, |
||||
"Y": -289.320218987813, |
||||
"Zoom": 0.71395775646133186 |
||||
} |
||||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@ |
||||
[InternetShortcut] |
||||
URL=https://www.ci.verona.wi.us/161/Decks-Patios |
@ -0,0 +1,2 @@ |
||||
[InternetShortcut] |
||||
URL=https://wred-lwrd.countyofdane.com/permitting/erosion-control |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@ |
||||
[InternetShortcut] |
||||
URL=https://wred-lwrd.countyofdane.com/permitting/shoreland-mitigation |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@ |
||||
[InternetShortcut] |
||||
URL=https://data-cityofmadison.opendata.arcgis.com/datasets/zoning-districts |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue