# Dynamo scripts

## Notes

### Branches

On master branch only 2.x scripts are available.

For 1.x scripts see 1.x branch!

### Naming codes

DS: Datashape ui

DP: DynamoPlayer ui

No suffix: no ui

### Script state emojis

✅ Stable

☑️ Mostly working

🐛 Some bugs

🚧 Not finished, under developement

❌ Removed from master branch

🔻 Not upgraded to 2.x yet

## Scripts

### AddParametersToFamily-DS ✅

Add multiple parameters to a currently opened family with one click. All data of the new parameters have to be the same, only the name can differ. 

<details>
  <summary>Required packages</summary>

- Orchid
- Data-Shapes

</details>

### AddSpotElevationToSelectedElements-DS ☑️ 🚧 🐛

Add spot elevations to slected elements. Select the display type of elevation (top, bottom...)

<details>
  <summary>Required packages</summary>

- Data-Shapes

</details>

### AddTitleblockAsParameterToAllSheets-DP ✅

Adds the type name of the titleblocks to each sheet as a parameter. 

<details>
  <summary>More info</summary>

Useful for showing the sheet size in a sheet list. The parameter have to be created beforehand, can be shared or project, must be instance and text. The name of the parameter can be modified in Player. The default parameter name is "Titleblock".

No packages requires

</details>

### BuldingPadsFromElements-DS ☑️ 🚧

Create building pad from selected elements.

<details>
  <summary>More info</summary>

Required packages:

- data-shapes

#### Acknowledgements

The python script is written by [BIMadmin](https://forum.dynamobim.com/u/BIMadmin) and [kennyb6](https://forum.dynamobim.com/u/kennyb6). Source: [forum.dynamobim.com](https://forum.dynamobim.com/t/multiple-building-pads/19917).

</details>

### CategoryPresentation ✅ 🚧 🔻

Places all loaded families from the selected category on a line for presentation.

TODO: ui

### CheckUnlimitedViewDepths ✅

List views which has unlimited view range set

<details>
  <summary>Required packages</summary>

- Genius Loci
- Clockwork

</details>

### CopyParameterValuesToParameter-DP 🐛 🚧

Copy parameter values of a selected family to another parameter of the same family

TODO: docs

### CopySectionBox-DP ✅

Copy a section box from one view to another

<details>
  <summary>Required packages</summary>

- Rhythm

</details>

### DeleteAllRefPlanes ✅

Delete all reference planes from the project

<details>
  <summary>Required packages</summary>

- Archi-lab

</details>

### DisallowJoinSelectedFrames-DP ✅

Disallow join on both end on the selected frames

### DuplicateMultipleViews-DS ✅

Select multiple views and duplicate them

<details>
  <summary>Required packages</summary>

- Data-Shapes

</details>

### DwgImportCleaner ✅

Removes **all** imported dwgs

<details>
  <summary>Required packages</summary>

- Bimorph nodes
- Archilab

</details>

### ExportHeightFromPbp-DP ✅

Exports selected category's all objects' elevation from PBP to excel. You can add an offset value for making the bounding box smaller.

### FloorPresentation-DP ✅

Places all floor types in the project

<details>
  <summary>Required packages</summary>

- Clockwork

</details>

### ImportDwgBatch ✅ 🚧

State: same as importobj, just with dwg

### ImportObjBatch-DP ✅

Imports all objs from a folder to separate rfa files. Designed to be used with Revit Batch Processor. Also works with DinamoPlayer

<details>
  <summary>More info</summary>

#### Required Packages

- MeshToolkit

#### Batch usage

1. Copy the .bat and the .rfa to the same folder as the objs
2. Run obj-copy.bat
3. If you want to change settings for the import script open the script in dynamo and modify the input values and save.
4. In Revit batch processor select the created filelist and the dynamo script and it will create the objs inside the rfa files.

</details>

### KimaiExportParser ❌

*Removed from master, see 1.x branch!*

### ListAllInplaceElements ✅

Lists all inplace elements in model

<details>
  <summary>Required packages</summary>

- Clockwork
- Spring nodes

</details>

### PickNewHostMultipleRailings-DP ✅

Pick new host for multiple railings

### PrefixLoadedFamiliesBatch ✅ 🔻

Add a prefix to all loaded families' names from a selected category. Designed to be used with Revit Batch Processor

TODO: UI, docs

### RenumberSheetsFromSelected-DS ✅

Add +1 to numbers starting from the selected

<details>
  <summary>More info</summary>

Add +1 to sheets from the selected, so you can add a new sheet inbetween.

#### Example

Your sheets numbered like this:

- A01
- A02
- A03
- ...

You want to add a new sheet numbered A02.

Run the script, select the current sheet A02, write "A" to the prefix box (without the quotation marks).

Your new sheet numbers will look like this: (Note the missing A02)

- A01
- A03
- A04
- ...

Now you can add sheet A02. It won't touch those sheets wich don't start with the aforementioned prefix.

#### Requirements

- Data shapes

</details>

### Revisions

#### AddAllRevisionsToAllSheets ✅

Automatically add all revisions to all sheets

<details>
  <summary>Required packages</summary>

- Archi-lab

</details>

#### AddOneRevisionsToAllSheets-DP ✅

Automatically add a selected revisions to all sheets

<details>
  <summary>Required packages</summary>

- Archi-lab

</details>

#### QuickRevisionSchedule-DP ✅

List all revisions to a table in a new window

<details>
  <summary>Required packages</summary>

- Clockwork
- Springs if they accept my PR...

</details>

### SectionBoxToDetailLines-DP ✅ 🚧

Convert the section box of a selected 3D view to detail lines in the current view. Make sure the active view is a plan view!

*Note: not working on rotated section boxes!*

### SubregionsToDetailLines ✅

Convert all subregions to deatil lines in the active view. 

<details>
  <summary>More info</summary>

With too big numbers it freezes! Set units to meters!

Make sure the active view is not 3d

#### Optional packages:

- Springs

</details>

### VariableFloorToTopography-DP ✅

Converts a selected floor to topography. Make sure the floor's height is variable!

### WallPresentation-DP ✅

Place all wall types in the project

<details>
  <summary>Required packages</summary>

Clockwork

</details>

## Nodes

### WeekDayNumber ❌

*Deprecated nodes as prerequeites, see 1.x branch*

### ReplaceFollowingElements ✅

Replace same elements follow each other

<details>
  <summary>Documentation</summary>

Input:

- list: a list of lists
- searchFor: the value you want to replace if follows each other
- replacement: string to replace the following elements
- countUnit: on the replaced list append this value to the count of the same elements

Output:

- replacedList: A list where all of the found following same elements replaced with the replacement
- firstReplacedList: Only the first element is replaced, others counted and appended by the countUnit

</details>

### ReplaceFollowingSameElements ✅

Replace all following same elements in a list of lists. The differences between this and the previous node thet here you don't have to add a searchfor, itt will replace all following elements

<details>
  <summary>Documentation</summary>

Input:

- list: a list of lists
- replacement: string to replace the following elements
- countUnit: on the replaced list append this value to the count of the same elements

Output:

- allReplaced: A list where all of the found following same elements replaced with the replacement
- firstCounted: The first element replaced by the number of following elements, others replaced by the replacement
- firstOriginal: First element is the same as before, others replaced by the replacement

</details>

Python source is included next to the .dyf
