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 c8b9588 commit 7a36c83
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 180 deletions.
61 changes: 32 additions & 29 deletions nodes/3.x/FamilyInstance.ByCurve.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,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.Elements)\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\nfamtype = UnwrapElement(IN[1])\r\nlvl = UnwrapElement(IN[2])\r\nelementlist = list()\r\ncounter = 0\r\n\r\nTransactionManager.Instance.EnsureInTransaction(doc)\r\n# make sure familysymbol is active\r\nif famtype.IsActive == False:\r\n\tfamtype.Activate()\r\n\tdoc.Regenerate()\r\nfor curve in curves:\r\n\tnewobj = doc.Create.NewFamilyInstance(curve.ToRevitType(),famtype,lvl,Structure.StructuralType.NonStructural)\r\n\telementlist.append(newobj.ToDSType(False))\r\nTransactionManager.Instance.TransactionTaskDone()\r\nOUT = elementlist",
"Engine": "CPython3",
"VariableInputPorts": true,
"Id": "de95e19d38be41d88700badf9263702e",
"Inputs": [
Expand Down Expand Up @@ -62,7 +63,7 @@
}
],
"Replication": "Disabled",
"Description": "Runs an embedded IronPython script."
"Description": "Führt ein eingebettetes Python-Skript aus."
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Function, DynamoCore",
Expand All @@ -74,7 +75,7 @@
{
"Id": "c521b7b55e2b4470b9e0f7b93762adb8",
"Name": "unknownItem",
"Description": "Input #1",
"Description": "var[]..[]",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
Expand All @@ -83,7 +84,7 @@
{
"Id": "38d7e5e8926843a39ca3803c48ba6d41",
"Name": "seq",
"Description": "Input #2",
"Description": "var[]..[]",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
Expand All @@ -94,15 +95,15 @@
{
"Id": "b567b8ff7a0146c9af21285ddfc63b7d",
"Name": "",
"Description": "Output #1",
"Description": "Rückgabewert",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
"KeepListStructure": false
}
],
"Replication": "Auto",
"Description": "If the item in input #1 is not a list, only the first item of the list in input #2 will be returned."
"Description": "If the unknown item is not a list but rather a single item, only the first item of the list (input \"seq\") will be returned."
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Function, DynamoCore",
Expand All @@ -125,7 +126,7 @@
{
"Id": "4867012a27af4ae3a00c9f8d35db6829",
"Name": "seq",
"Description": "return value",
"Description": "Rückgabewert",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
Expand Down Expand Up @@ -159,7 +160,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 @@ -180,7 +181,7 @@
],
"Outputs": [],
"Replication": "Disabled",
"Description": "A function output, use with custom nodes"
"Description": "Eine Funktionsausgabe zur Verwendung mit benutzerdefinierten Blöcken"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Symbol, DynamoCore",
Expand All @@ -206,7 +207,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.Symbol, DynamoCore",
Expand All @@ -232,7 +233,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"
}
],
"Connectors": [
Expand Down Expand Up @@ -276,18 +277,20 @@
"44ac4888-4aa4-49a9-9344-23b729c11df9",
"cd09ad33-8c34-4850-ac26-24448d92c38f"
],
"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 @@ -300,79 +303,79 @@
},
"NodeViews": [
{
"ShowGeometry": true,
"Name": "Python Script",
"Id": "de95e19d38be41d88700badf9263702e",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Name": "Python Script",
"ShowGeometry": true,
"Excluded": false,
"X": 404.347893915757,
"Y": 111.890795631825
},
{
"ShowGeometry": true,
"Name": "ReturnListOrSingleValue",
"Id": "2caac6cf5c83427ea8edd8331d9c2ac7",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Name": "ReturnListOrSingleValue",
"ShowGeometry": true,
"Excluded": false,
"X": 629.179407176287,
"Y": 1.90795631825267
},
{
"ShowGeometry": true,
"Name": "TurnIntoList",
"Id": "d784e2419f684af9b019ca897c519204",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Name": "TurnIntoList",
"ShowGeometry": true,
"Excluded": false,
"X": 206.0,
"Y": 62.0
},
{
"ShowGeometry": true,
"Name": "Input",
"Id": "7ba0e7580a9d4073b4cd9cd708a8a56f",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Name": "Input",
"ShowGeometry": true,
"Excluded": false,
"X": -59.8689547581905,
"Y": 0.0
},
{
"ShowGeometry": true,
"Name": "Output",
"Id": "00259b2b01d24a4d908c52bfc3a85191",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Name": "Output",
"ShowGeometry": true,
"Excluded": false,
"X": 921.179407176287,
"Y": 1.90795631825267
},
{
"ShowGeometry": true,
"Name": "Input",
"Id": "ceb9c34f12064e4b99a3032b3d777b84",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Name": "Input",
"ShowGeometry": true,
"Excluded": false,
"X": 206.215288611545,
"Y": 138.048361934477
},
{
"ShowGeometry": true,
"Name": "Input",
"Id": "11da214ab5374a9f84efb510ae815acb",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Name": "Input",
"ShowGeometry": true,
"Excluded": false,
"X": 242.801872074883,
"Y": 221.048361934477
}
],
"Annotations": [],
"X": 74.0,
"Y": 316.211069418387,
"Zoom": 1.20262664165103
"X": 76.616580263003982,
"Y": 194.64747359513518,
"Zoom": 0.71930644257152787
}
}
2 changes: 1 addition & 1 deletion nodes/3.x/FamilyInstance.ByPointInView.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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.Elements)\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\npoints = UnwrapElement(IN[0])\r\nfamtypes = UnwrapElement(IN[1])\r\nviews = UnwrapElement(IN[2])\r\n\r\ndef FamInstViewBased(point, ft, view):\r\n\t# make sure familysymbol is active\r\n\tif ft.IsActive == False:\r\n\t\tft.Activate()\r\n\t\tdoc.Regenerate()\r\n\tnewobj = doc.Create.NewFamilyInstance(point.ToXyz(),ft,view)\r\n\treturn newobj.ToDSType(False)\r\n\r\nTransactionManager.Instance.EnsureInTransaction(doc)\r\nif isinstance(IN[0], list):\r\n\tif isinstance(IN[1], list):\r\n\t\tif isinstance(IN[2], list): OUT = [FamInstViewBased(x, y, z) for x, y, z in zip(points, famtypes, views)]\r\n\t\telse: OUT = [FamInstViewBased(x, y, views) for x, y in zip(points, famtypes)]\r\n\telse:\r\n\t\tif isinstance(IN[2], list): OUT = [FamInstViewBased(x, famtypes, y) for x, y in zip(points, views)]\r\n\t\telse: OUT = [FamInstViewBased(x, famtypes, views) for x in points]\r\nelse:\r\n\tif isinstance(IN[1], list):\r\n\t\tif isinstance(IN[2], list): OUT = FamInstViewBased(points, famtypes[0], views[0])\r\n\t\telse: OUT = FamInstViewBased(points, famtypes[0], views)\r\n\telse:\r\n\t\tif isinstance(IN[2], list): OUT = FamInstViewBased(points, famtypes, views[0])\r\n\t\telse: OUT = FamInstViewBased(points, famtypes, views)\r\nTransactionManager.Instance.TransactionTaskDone()",
"Engine": "IronPython2",
"Engine": "CPython3",
"VariableInputPorts": true,
"Id": "935f7db04a684f9eae86d1f9c56a5915",
"Inputs": [
Expand Down
Loading

0 comments on commit 7a36c83

Please sign in to comment.