Arithmetic operations with points?


#1

Hello Dynamo community

Is it posible to do arithmetic operations with points without convert them to numbers and back all the time?
*summation, subtraction, absolute value, …)
Thanks 4 the help :slight_smile:


#2

Yes but only if you use Revit API XYZs (you’ll therefore need to use Python/C# to access the API). If you need Proto Points (Dynamo Points) you can easily convert them back once you’ve completed your calculations by calling ToProtoType(). I would recommend using the Revit API as much as possible under any circumstance to be honest, its superior in performance to the ProtoGeometry library and more developed given that its had about a 20 year head-start!


#3

I want to use it on Revit coordinates but it’s not working somehow. :frowning:


#4

If you are talking about Revit API Transforms, only multiplication is supported. Instead you can perform the calculations on XYZs then set the respective property of the transform accordingly (basis axes, origin, etc)


#5

As a side note, if you don’t want to convert to revit’s native XYZ types and do work in python or c#, you can use Vector instances and perform some operation on them:


#6

Thank you :slight_smile:


#7

thank you also very much for explaining how work with the node Pythons Script from String. IT seems more easy to use without open the edit node mode everytime