-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAlignSections.dyn
More file actions
150 lines (121 loc) · 10.2 KB
/
AlignSections.dyn
File metadata and controls
150 lines (121 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<Workspace Version="1.3.1.1736" X="-148.765855886032" Y="255.924155811293" zoom="0.525121797843683" ScaleFactor="1" Name="Home" Description="" RunType="Manual" RunPeriod="1000" HasRunWithoutCrash="True">
<NamespaceResolutionMap />
<Elements>
<Dynamo.Nodes.DSModelElementsSelection guid="66342af2-16cb-44ca-9c37-459130f99431" type="Dynamo.Nodes.DSModelElementsSelection" nickname="Select Model Elements" x="463.818184350998" y="468.907898166658" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="True" IsFrozen="false" isPinned="true">
<instance id="33097216-3d76-43cd-a9f9-e59e835b276d-00328cba" />
</Dynamo.Nodes.DSModelElementsSelection>
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="aa0502b7-02b0-43f5-88fa-21bad69f6eaa" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="StructuralFraming.Location" x="763.386908053003" y="576.884068945455" isVisible="true" isUpstreamVisible="true" lacing="Shortest" isSelectedInput="False" IsFrozen="false" isPinned="true" assembly="RevitNodes.dll" function="Revit.Elements.StructuralFraming.Location">
<PortInfo index="0" default="False" />
</Dynamo.Graph.Nodes.ZeroTouch.DSFunction>
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="6e7fdaee-6751-4884-8f01-b908852a4921" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="Curve.StartPoint" x="1306.36221249587" y="481.577715059825" isVisible="true" isUpstreamVisible="true" lacing="Shortest" isSelectedInput="False" IsFrozen="false" isPinned="true" assembly="ProtoGeometry.dll" function="Autodesk.DesignScript.Geometry.Curve.StartPoint">
<PortInfo index="0" default="False" />
</Dynamo.Graph.Nodes.ZeroTouch.DSFunction>
<Dynamo.Nodes.DSModelElementSelection guid="9c8d43fb-e5a3-4d30-a49b-f25e1e38458e" type="Dynamo.Nodes.DSModelElementSelection" nickname="Select Model Element" x="1195.90325356821" y="750.966583960821" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="True" IsFrozen="false" isPinned="false">
<instance id="33097216-3d76-43cd-a9f9-e59e835b276d-00328b7f" />
</Dynamo.Nodes.DSModelElementSelection>
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="02a85d6d-7426-49e5-85c1-41a8abf01c4f" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="Geometry.ClosestPointTo" x="1844.19448166284" y="547.942907993447" isVisible="true" isUpstreamVisible="true" lacing="Longest" isSelectedInput="False" IsFrozen="false" isPinned="true" assembly="ProtoGeometry.dll" function="Autodesk.DesignScript.Geometry.Geometry.ClosestPointTo@Autodesk.DesignScript.Geometry.Geometry">
<PortInfo index="0" default="False" />
<PortInfo index="1" default="False" />
</Dynamo.Graph.Nodes.ZeroTouch.DSFunction>
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="da3b0de3-80d7-4562-a55f-e55b1cff6cfb" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="Element.Curves" x="1544.23047923148" y="723.495982567819" isVisible="true" isUpstreamVisible="true" lacing="Shortest" isSelectedInput="False" IsFrozen="false" isPinned="true" assembly="RevitNodes.dll" function="Revit.Elements.Element.Curves">
<PortInfo index="0" default="False" />
</Dynamo.Graph.Nodes.ZeroTouch.DSFunction>
<PythonNodeModels.PythonNode guid="7284b9bb-ba5b-4b85-af24-046532d24aa1" type="PythonNodeModels.PythonNode" nickname="Python Script" x="2501.65434915374" y="258.204995000208" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="true" inputcount="3">
<PortInfo index="0" default="False" />
<PortInfo index="1" default="False" />
<PortInfo index="2" default="False" />
<Script>import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("System")
from System.Collections.Generic import List
beamElement = UnwrapElement(IN[0])
#nBl = UnwrapElement(IN[1])
stPt = UnwrapElement(IN[1])
endPt = UnwrapElement(IN[2])
TransactionManager.Instance.EnsureInTransaction(doc)
#p1 = XYZ.Zero
#p2 = XYZ(10, 20, 0)
for i in range(0,len(stPt)):
beamLine = beamElement[i].Location
p1 = stPt[i].ToXyz()
p2 = endPt[i].ToXyz()
newBeamLine = Line.CreateBound(p1, p2)
beamLine.Curve = newBeamLine;
TransactionManager.Instance.TransactionTaskDone()
OUT = beamElement
</Script>
</PythonNodeModels.PythonNode>
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="06a88b88-7f50-4f2c-8465-ba81e7450cc6" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="Curve.EndPoint" x="1371.42711879355" y="232.171918871021" isVisible="true" isUpstreamVisible="true" lacing="Shortest" isSelectedInput="False" IsFrozen="false" isPinned="true" assembly="ProtoGeometry.dll" function="Autodesk.DesignScript.Geometry.Curve.EndPoint">
<PortInfo index="0" default="False" />
</Dynamo.Graph.Nodes.ZeroTouch.DSFunction>
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="9bee5ce3-22d3-443b-a81a-c5d5ef820af4" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="Geometry.ClosestPointTo" x="1860.03112537699" y="205.230427719698" isVisible="true" isUpstreamVisible="true" lacing="Longest" isSelectedInput="False" IsFrozen="false" isPinned="true" assembly="ProtoGeometry.dll" function="Autodesk.DesignScript.Geometry.Geometry.ClosestPointTo@Autodesk.DesignScript.Geometry.Geometry">
<PortInfo index="0" default="False" />
<PortInfo index="1" default="False" />
</Dynamo.Graph.Nodes.ZeroTouch.DSFunction>
<PythonNodeModels.PythonNode guid="d156432b-31f0-4d38-954f-4f42f20959b2" type="PythonNodeModels.PythonNode" nickname="Python Script" x="1311.83673455568" y="15.0407110383771" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="true" inputcount="1">
<PortInfo index="0" default="False" />
<Script>import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("System")
from System.Collections.Generic import List
beamElement = UnwrapElement(IN[0])
beamLine = beamElement.Location
TransactionManager.Instance.EnsureInTransaction(doc)
#p1 = XYZ.Zero
#p2 = XYZ(10, 20, 0)
newbeamLine = XYZ.Zero
beamElement.Location = newbeamLine
TransactionManager.Instance.TransactionTaskDone()
OUT = beamLine
</Script>
</PythonNodeModels.PythonNode>
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="038e2863-cdbf-4963-939f-249e31025a0c" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="Geometry.ClosestPointTo" x="1611.95679133637" y="6.8146837907131" isVisible="true" isUpstreamVisible="true" lacing="Longest" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="ProtoGeometry.dll" function="Autodesk.DesignScript.Geometry.Geometry.ClosestPointTo@Autodesk.DesignScript.Geometry.Geometry">
<PortInfo index="0" default="False" />
<PortInfo index="1" default="False" />
</Dynamo.Graph.Nodes.ZeroTouch.DSFunction>
</Elements>
<Connectors>
<Dynamo.Graph.Connectors.ConnectorModel start="66342af2-16cb-44ca-9c37-459130f99431" start_index="0" end="aa0502b7-02b0-43f5-88fa-21bad69f6eaa" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="66342af2-16cb-44ca-9c37-459130f99431" start_index="0" end="7284b9bb-ba5b-4b85-af24-046532d24aa1" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="66342af2-16cb-44ca-9c37-459130f99431" start_index="0" end="d156432b-31f0-4d38-954f-4f42f20959b2" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="aa0502b7-02b0-43f5-88fa-21bad69f6eaa" start_index="0" end="6e7fdaee-6751-4884-8f01-b908852a4921" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="aa0502b7-02b0-43f5-88fa-21bad69f6eaa" start_index="0" end="06a88b88-7f50-4f2c-8465-ba81e7450cc6" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="6e7fdaee-6751-4884-8f01-b908852a4921" start_index="0" end="02a85d6d-7426-49e5-85c1-41a8abf01c4f" end_index="1" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="9c8d43fb-e5a3-4d30-a49b-f25e1e38458e" start_index="0" end="da3b0de3-80d7-4562-a55f-e55b1cff6cfb" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="02a85d6d-7426-49e5-85c1-41a8abf01c4f" start_index="0" end="7284b9bb-ba5b-4b85-af24-046532d24aa1" end_index="2" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="da3b0de3-80d7-4562-a55f-e55b1cff6cfb" start_index="0" end="02a85d6d-7426-49e5-85c1-41a8abf01c4f" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="da3b0de3-80d7-4562-a55f-e55b1cff6cfb" start_index="0" end="9bee5ce3-22d3-443b-a81a-c5d5ef820af4" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="da3b0de3-80d7-4562-a55f-e55b1cff6cfb" start_index="0" end="038e2863-cdbf-4963-939f-249e31025a0c" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="06a88b88-7f50-4f2c-8465-ba81e7450cc6" start_index="0" end="9bee5ce3-22d3-443b-a81a-c5d5ef820af4" end_index="1" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="9bee5ce3-22d3-443b-a81a-c5d5ef820af4" start_index="0" end="7284b9bb-ba5b-4b85-af24-046532d24aa1" end_index="1" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="d156432b-31f0-4d38-954f-4f42f20959b2" start_index="0" end="038e2863-cdbf-4963-939f-249e31025a0c" end_index="1" portType="0" />
</Connectors>
<Notes />
<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>