### Using Replication Guides for List Pairing (Dominant List 1) Source: https://dynamobim.org/cbns-for-dummies Applies replication guides to pair elements from two lists of different lengths, resulting in a nested list structure. This example prioritizes the first list's length. ```Python xCoords = {1, 2}; yCoords = {10, 20, 30, 40, 50}; // Result: {{<10>, <100>}, {<20>, <200>}, {<30>, <300>}, {<40>, <400>}, {<50>, <500>}} ``` -------------------------------- ### Basic Cloud Rendering Setup in Dynamo Source: https://dynamobim.org/pt-3-cloud-rendering-with-dynamo This graph demonstrates the simplest setup for uploading a render job and viewing the resulting image. Ensure you are in the Revit project environment. ```Dynamo // Specify the view name to render viewName = "{3D}"; // Export render data renderData = ExportRenderData.ByViewName(viewName); // Set rendering dimensions (must be > 110 pixels) width = 1000; height = 800; // Specify render type and quality renderType = "Photorealistic"; renderQuality = "High"; // Create a cloud rendering job renderJob = CloudRendering.Job(renderData, width, height, renderType, renderQuality); // Initiate the cloud render and wait for completion renderedImages = Cloud.Render(renderJob); // Get the file path of the first rendered image imagePath = List.FirstItem(renderedImages); // Read the image into Dynamo for display image = Image.ReadFromFile(imagePath); ``` -------------------------------- ### Example WAV Filenames for Piano Notes Source: https://dynamobim.org/feed These are example filenames for .wav files, each representing a single piano note. Consistent naming is crucial for the script to function correctly. ```plaintext C.wav D.wav E.wav FS.wav C_high.wav D_high.wav ``` -------------------------------- ### Example Filenames for Sound Files Source: https://dynamobim.org/%F0%9F%8E%B9-auld-lang-syne-player-dynamo-forum-2025-winner These are example filenames for the .wav sound files that correspond to individual piano notes. Each file must contain a single note and follow a consistent naming convention for the Python script to locate and play them. ```text C.wav D.wav E.wav FS.wav C_high.wav D_high.wav ``` -------------------------------- ### Solid Volume Example Source: https://dynamobim.org/wp-content/uploads/forum-assets/collin-mccrone/08/13/COVID-occupancy-by-instance.dyn Calculates the volume of a solid. Requires a solid object as input. ```Python import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * # Example input # Assume 'solid' is a valid solid object, e.g., a Cube or Extrusion # For demonstration, create a sample cube solid = Solid.ByExtrusion(Rectangle.ByWidthLength(10, 10), Vector.ZAxis().Scale(10)) # Calculate volume volume = Solid.Volume(solid) # Output output = volume ``` -------------------------------- ### Get All Elements of Category Example Source: https://dynamobim.org/wp-content/uploads/forum-assets/collin-mccrone/08/13/COVID-occupancy-by-instance.dyn Retrieves all elements belonging to a specified category. Useful for filtering and analysis. ```Python import clr # Assume 'category' is a valid Category object # For demonstration, assume a category named 'Walls' exists # In a real scenario, you would get the category using Document.Categories() # Placeholder for category object # category = IN[0] # Assuming category is an input # Example of how to get elements if you have the category object # elements = Category.Elements(category) # For this example, we'll simulate a list of elements class MockElement: def __init__(self, name): self.name = name class MockCategory: def __init__(self, name): self.name = name def Elements(self): # Simulate returning elements of this category return [MockElement('Wall1'), MockElement('Wall2')] category = MockCategory('Walls') elements = category.Elements() # Output output = elements ``` -------------------------------- ### Get Origin Point Source: https://dynamobim.org/wp-content/uploads/forum-assets/admin/07/16/Basket1.dyn Returns the origin point (0,0,0) in space. This node is often used as a reference or starting point. ```Dynamo ``` ```Dynamo ``` -------------------------------- ### Dynamo Connector Configurations Source: https://dynamobim.org/wp-content/uploads/forum-assets/colin-mccroneautodesk-com/03/13/Buffons-Needle.dyn Examples of connector configurations in Dynamo, specifying the start and end nodes, indices, and port types for data flow between nodes. ```Dynamo XML ``` ```Dynamo XML ``` ```Dynamo XML ``` ```Dynamo XML ``` ```Dynamo XML ``` ```Dynamo XML ``` ```Dynamo XML ``` ```Dynamo XML ``` ```Dynamo XML ``` ```Dynamo XML ``` ```Dynamo XML ``` -------------------------------- ### WPF Window with MVVM in PythonNet3 Source: https://dynamobim.org/pythonnet3-a-new-dynamo-python-to-fix-everything Example demonstrating how to create a custom WPF window using an MVVM pattern in PythonNet3. It includes setting up a ViewModel, defining a XAML window, and handling button clicks. ```Python import clr import System clr.AddReference("System.Xml") clr.AddReference("PresentationFramework") clr.AddReference("PresentationCore") clr.AddReference("System.Windows") clr.AddReference("DynamoCore") from System.Windows import LogicalTreeHelper from Dynamo.Core import NotificationObject class ViewModel: def __new__(cls, *args): cls.args = args # !! Modify namespace when modifying _ViewModel !! cls.__namespace__ = "ViewModel_zlcg" try: return __import__(cls.__namespace__)._ViewModel(*cls.args) except ImportError: class _ViewModel(NotificationObject): __namespace__ = cls.__namespace__ def __init__(self): super().__init__() _text = "Hieee" def get_Text(self): return self._text def set_Text(self, value): self._text = value self.RaisePropertyChanged("Text") Text = clr.clrproperty(str, get_Text, set_Text) return _ViewModel(*cls.args) class MyWindow(System.Windows.Window): xaml = '''