Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andydandy74 committed Oct 12, 2024
1 parent 84cde70 commit 5782677
Show file tree
Hide file tree
Showing 6 changed files with 200 additions and 271 deletions.
8 changes: 4 additions & 4 deletions nodes/3.x/AreaSeparator.FromCurve.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels",
"NodeType": "PythonScriptNode",
"Code": "import clr\r\nclr.AddReference('RevitAPI')\r\nfrom Autodesk.Revit.DB import *\r\n\r\nclr.AddReference(\"RevitNodes\")\r\nimport Revit\r\nclr.ImportExtensions(Revit.GeometryConversion)\r\n\r\nclr.AddReference(\"RevitServices\")\r\nimport RevitServices\r\nfrom RevitServices.Persistence import DocumentManager\r\nfrom RevitServices.Transactions import TransactionManager\r\n\r\ndoc = DocumentManager.Instance.CurrentDBDocument\r\ncurves = UnwrapElement(IN[0])\r\nview = UnwrapElement(IN[1])\r\nelementlist = []\r\n\r\nTransactionManager.Instance.EnsureInTransaction(doc)\r\no = view.Origin\r\nn = view.ViewDirection\r\nif o and n: \r\n\tsketchplane = SketchPlane.Create(doc, Plane.CreateByNormalAndOrigin(n, o))\r\n\tdoccreation = doc.Create\r\n\tfor curve in curves:\r\n\t\tseparator = doccreation.NewAreaBoundaryLine(sketchplane, curve.ToRevitType(), view)\r\n\t\telementlist.append(separator)\r\nTransactionManager.Instance.TransactionTaskDone()\r\n\r\nif isinstance(IN[0], list): OUT = elementlist\r\nelse: OUT = elementlist[0]",
"Engine": "IronPython2",
"Engine": "CPython3",
"VariableInputPorts": true,
"Id": "786d1079e66a4b07a4fde72dbefe5739",
"Inputs": [
Expand Down Expand Up @@ -258,7 +258,7 @@
"NodeLibraryDependencies": [
{
"Name": "Clockwork for Dynamo 2.x",
"Version": "2.6.0",
"Version": "2.12.0",
"ReferenceType": "Package",
"Nodes": [
"f88b28916c0a4477a478ed04660b258b"
Expand Down Expand Up @@ -351,8 +351,8 @@
}
],
"Annotations": [],
"X": 247.80640477834064,
"Y": 83.697342032785116,
"X": -356.19359522165951,
"Y": 130.09734203278509,
"Zoom": 0.799595248520623
}
}
33 changes: 18 additions & 15 deletions nodes/3.x/ModelCurve.Type.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}
],
"Replication": "Disabled",
"Description": "A function parameter, use with custom nodes.\r\n\r\nYou can specify the type and default value for parameter. E.g.,\r\n\r\ninput : var[]..[]\r\nvalue : bool = false"
"Description": "Ein Funktionsparameter zur Verwendung mit benutzerdefinierten Blöcken.\r\n\r\nSie können den Typ und den Vorgabewert für den Parameter angeben, z. B.\r\n\r\ninput : var[]..[]\r\nvalue : bool = false"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Output, DynamoCore",
Expand All @@ -55,12 +55,13 @@
],
"Outputs": [],
"Replication": "Disabled",
"Description": "A function output, use with custom nodes"
"Description": "Eine Funktionsausgabe zur Verwendung mit benutzerdefinierten Blöcken"
},
{
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels",
"NodeType": "PythonScriptNode",
"Code": "import clr\r\nclr.AddReference('RevitAPI')\r\nfrom Autodesk.Revit.DB import *\r\n\r\ndef GetCurveType(item):\r\n\tif hasattr(item, \"CurveElementType\"): return item.CurveElementType\r\n\telse: return None\r\n\r\nitems = UnwrapElement(IN[0])\r\n\r\nif isinstance(IN[0], list): OUT = [GetCurveType(x) for x in items]\r\nelse: OUT = GetCurveType(items)",
"Code": "import clr\r\nclr.AddReference('RevitAPI')\r\nfrom Autodesk.Revit.DB import *\r\nimport System\r\n\r\ndef GetCurveType(item):\r\n\tif hasattr(item, \"CurveElementType\"): return System.Enum.GetName(CurveElementType, item.CurveElementType)\r\n\telse: return None\r\n\r\nitems = UnwrapElement(IN[0])\r\n\r\nif isinstance(IN[0], list): OUT = [GetCurveType(x) for x in items]\r\nelse: OUT = GetCurveType(items)",
"Engine": "CPython3",
"VariableInputPorts": true,
"Id": "0296ff7f8a934d3fb88d9dc867dd0119",
"Inputs": [
Expand All @@ -86,7 +87,7 @@
}
],
"Replication": "Disabled",
"Description": "Runs an embedded IronPython script."
"Description": "Führt ein eingebettetes Python-Skript aus."
}
],
"Connectors": [
Expand All @@ -102,18 +103,20 @@
}
],
"Dependencies": [],
"NodeLibraryDependencies": [],
"Author": "None provided",
"Bindings": [],
"View": {
"Dynamo": {
"ScaleFactor": 1.0,
"HasRunWithoutCrash": false,
"IsVisibleInDynamoLibrary": true,
"Version": "2.0.1.5055",
"Version": "2.12.1.8246",
"RunType": "Manual",
"RunPeriod": "1000"
},
"Camera": {
"Name": "Background Preview",
"Name": "Hintergrundvorschau",
"EyeX": -17.0,
"EyeY": 24.0,
"EyeZ": 50.0,
Expand All @@ -126,34 +129,34 @@
},
"NodeViews": [
{
"ShowGeometry": true,
"Name": "Input",
"Id": "7d675e6fff054b4b89ebbe20b050e79e",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Name": "Input",
"ShowGeometry": true,
"Excluded": false,
"X": -32.668628703978,
"Y": 175.966607950104
"X": -120.69878038153074,
"Y": 172.40983414495037
},
{
"ShowGeometry": true,
"Name": "Output",
"Id": "f6657b38376f4e7b9fb89538314be35d",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Name": "Output",
"ShowGeometry": true,
"Excluded": false,
"X": 403.331371296022,
"Y": 175.966607950104
},
{
"ShowGeometry": true,
"Name": "Python Script",
"Id": "0296ff7f8a934d3fb88d9dc867dd0119",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Name": "Python Script",
"ShowGeometry": true,
"Excluded": false,
"X": 179.331371296022,
"Y": 175.966607950104
"Y": 176.8558014013924
}
],
"Annotations": [],
Expand Down
8 changes: 4 additions & 4 deletions nodes/3.x/RoomSeparator.FromCurve.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels",
"NodeType": "PythonScriptNode",
"Code": "import clr\r\nclr.AddReference('RevitAPI')\r\nfrom Autodesk.Revit.DB import *\r\n\r\nclr.AddReference(\"RevitNodes\")\r\nimport Revit\r\nclr.ImportExtensions(Revit.GeometryConversion)\r\n\r\nclr.AddReference(\"RevitServices\")\r\nimport RevitServices\r\nfrom RevitServices.Persistence import DocumentManager\r\nfrom RevitServices.Transactions import TransactionManager\r\n\r\ndoc = DocumentManager.Instance.CurrentDBDocument\r\ncurves = UnwrapElement(IN[0])\r\nview = UnwrapElement(IN[1])\r\n\r\nTransactionManager.Instance.EnsureInTransaction(doc)\r\no = view.Origin\r\nn = view.ViewDirection\r\nif o and n: \r\n\tsketchplane = SketchPlane.Create(doc, Plane.CreateByNormalAndOrigin(n, o))\r\n\tcurvearray = CurveArray()\r\n\tfor curve in curves:\r\n\t\tcurvearray.Append(curve.ToRevitType())\r\n\tdoccreation = doc.Create\r\n\tseparatorarray = doccreation.NewRoomBoundaryLines(sketchplane, curvearray, view)\r\nelse: separatorarray = []\r\nTransactionManager.Instance.TransactionTaskDone()\r\n\r\nelementlist = list()\r\nfor item in separatorarray:\r\n\telementlist.append(item)\r\nif isinstance(IN[0], list): OUT = elementlist\r\nelse: OUT = elementlist[0]",
"Engine": "IronPython2",
"Engine": "CPython3",
"VariableInputPorts": true,
"Id": "786d1079e66a4b07a4fde72dbefe5739",
"Inputs": [
Expand Down Expand Up @@ -254,7 +254,7 @@
"NodeLibraryDependencies": [
{
"Name": "Clockwork for Dynamo 2.x",
"Version": "2.6.0",
"Version": "2.12.0",
"ReferenceType": "Package",
"Nodes": [
"b4fce3f528624c3fa7024e362c08ab5f"
Expand Down Expand Up @@ -322,8 +322,8 @@
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Excluded": false,
"X": 651.90050270489928,
"Y": 38.914217599507815
"X": 650.59583220313289,
"Y": 38.914217599507822
},
{
"ShowGeometry": true,
Expand Down
4 changes: 2 additions & 2 deletions nodes/3.x/SpaceSeparator.FromCurve.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels",
"NodeType": "PythonScriptNode",
"Code": "import clr\r\nclr.AddReference('RevitAPI')\r\nfrom Autodesk.Revit.DB import *\r\n\r\nclr.AddReference(\"RevitNodes\")\r\nimport Revit\r\nclr.ImportExtensions(Revit.GeometryConversion)\r\n\r\nclr.AddReference(\"RevitServices\")\r\nimport RevitServices\r\nfrom RevitServices.Persistence import DocumentManager\r\nfrom RevitServices.Transactions import TransactionManager\r\n\r\ndoc = DocumentManager.Instance.CurrentDBDocument\r\ncurves = UnwrapElement(IN[0])\r\nview = UnwrapElement(IN[1])\r\n\r\n\r\nTransactionManager.Instance.EnsureInTransaction(doc)\r\no = view.Origin\r\nn = view.ViewDirection\r\nif o and n: \r\n\tsketchplane = SketchPlane.Create(doc, Plane.CreateByNormalAndOrigin(n, o))\r\n\tcurvearray = CurveArray()\r\n\tfor curve in curves:\r\n\t\tcurvearray.Append(curve.ToRevitType())\r\n\tdoccreation = doc.Create\r\n\tseparatorarray = doccreation.NewSpaceBoundaryLines(sketchplane, curvearray, view)\r\nelse: separatorarray = []\r\nTransactionManager.Instance.TransactionTaskDone()\r\n\r\nelementlist = list()\r\nfor item in separatorarray:\r\n\telementlist.append(item)\r\nif isinstance(IN[0], list): OUT = elementlist\r\nelse: OUT = elementlist[0]",
"Engine": "IronPython2",
"Engine": "CPython3",
"VariableInputPorts": true,
"Id": "786d1079e66a4b07a4fde72dbefe5739",
"Inputs": [
Expand Down Expand Up @@ -254,7 +254,7 @@
"NodeLibraryDependencies": [
{
"Name": "Clockwork for Dynamo 2.x",
"Version": "2.6.0",
"Version": "2.12.0",
"ReferenceType": "Package",
"Nodes": [
"4defe1b84c704e99be53ab921a87b216"
Expand Down
3 changes: 2 additions & 1 deletion nodes/3.x/python/ModelCurve.Type.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
import System

def GetCurveType(item):
if hasattr(item, "CurveElementType"): return item.CurveElementType
if hasattr(item, "CurveElementType"): return System.Enum.GetName(CurveElementType, item.CurveElementType)
else: return None

items = UnwrapElement(IN[0])
Expand Down
Loading

0 comments on commit 5782677

Please sign in to comment.