Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be...
Transcript of Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be...
![Page 1: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/1.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Perkins + Will26/07/2017
Tips’n’tricks
![Page 2: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/2.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Manage Revision Clouds With DynamoMauro Sabiu - Perkins+Will
![Page 3: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/3.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Current Tools
Revision + Cloud Manager
![Page 4: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/4.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Current Tools
Revision + Cloud Manager
![Page 5: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/5.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Dynamo Workflow
Why?
• Place Clouds Comments on Sheets
• Print Set as input
• Customization
![Page 6: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/6.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Dynamo Workflow
![Page 7: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/7.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Collector.ElementsInViewSpringNodes Package By Dimitar Venkov
How
![Page 8: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/8.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
How
Set sheets text shared parameter.And place the label in the titleblocks.
![Page 9: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/9.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
TextWrap
import clrclr.AddReference('ProtoGeometry')from Autodesk.DesignScript.Geometry import *import syssys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib')import textwrap
#The inputs to this node will be stored as a list in the IN variables.dataEnteringNode = INtext = IN[0]len = IN[1]
def wraptext(tx, l):
b = textwrap.dedent(tx).strip()if l<=1:
l = 1for width in [l]:
c = textwrap.fill(b, width=width)return c
#Assign your output to the OUT variable.
OUT = wraptext(text, len)
![Page 10: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/10.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Dyn Definition
![Page 11: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/11.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Inputs
Thank you
![Page 12: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/12.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Design Script - FunctionsThe easy way to control parameters
![Page 13: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/13.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Defining a Function within a Code Block
Extract from Dynamo Primer –“Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates another layer of control in a parametric file, and can be viewed as a text-based version of a custom node. In this case, the "parent" code block is readily accessible and can be located anywhereon the graph. No wires needed!”
http://dynamoprimer.com/en/07_Code-Block/7-4_functions.html
![Page 14: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/14.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Defining a Function within a Code Block
Within the Function you can define lists of Strings, Numbers or Boolean values. Anything you can have in a list, you can have in a list within a Function.
These can then be recalled anywhere on the graph without the need for lengthy wires, or node duplication.
If you need to change the parameter value simply change it in the Function no need to search the graph.
![Page 15: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/15.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Using the defined Function in a graph
As with normal lists you recall the whole list –FunctionName() ;
Or an index of that list -FunctionName() [0];
![Page 16: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/16.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Dynamo Coordinate SystemThe easy way to control parameters
![Page 17: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/17.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Dynamo Coordinate System
=
Dynamo Revit
How do I place a family at a datum point P in Revit?
Assuming that:
![Page 18: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/18.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Scenario #1: Pcoord from PBP, Project North = True North
P(6500,7800)
![Page 19: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/19.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Scenario #2: Pcoord from SP, Project North = True North
P(8557,17586)
![Page 20: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/20.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Scenario #3: Pcoord from SP, Project North ≠ True North
P(9187,4322)
PBP=SP
![Page 21: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/21.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Scenario #3: Pcoord from SP, Project North ≠ True North
![Page 22: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/22.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Scenario #4: Pcoord from SP, Project North ≠ True North
P(15187,12322)
![Page 23: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/23.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Scenario #4: Pcoord from SP, Project North ≠ True North
![Page 24: Tips’n’tricks - UK Dynamo User Group · Extract from Dynamo Primer – “Functions can be created in a code block and recalled elsewhere in a Dynamo definition. This creates](https://reader034.fdocuments.net/reader034/viewer/2022052019/6032348f6cc300225879ac28/html5/thumbnails/24.jpg)
UK DYNAMO USER GROUP | SOUTH@UKDynUG | www.ukdug.co.uk
Think in terms of Eastern and Northings
PROJECT BASE POINT
SURVEY POINT