Scripting how to change negative and positive offset

Hi
I’m creating a script for our traffic designer so that they can use Dynamo to write information from Extended Data to Excel.
They asked for Right and Left side of alignment set as R for Right and L for Left instead of exact offset value as a number so I created this separate part in the script (attached) but I wonder if there is another way I can do it?
Regards,
Patrick

OffsetForLeftOrRightSide.dyn (22.1 KB)

1 Like

Would this work?

Offsets

3 Likes

Thanks for the tutorial on code blocking it Zach. I’d also suggest adding the case of 0 offset just in case.

edit: might actually want to put quotes around the zero condition (… : “0”; ) so you don’t have mixed type list.

3 Likes

Just for fun/sharing here’s another way:

3 Likes

Thanks for your inputs @mzjensen and @KirkWM
Three really good examples how to deal with the issue using both codes and standard nodes and you also added the capability to show if the object don’t have a offset :slight_smile:
Really love this forum

2 Likes

Agree!!
Thanks for the example of coding @mzjensen

Thanks @KirkWM how to deal with it using nodes. Similar result as mine but you made it shorter and also added the less or more nodes. Haven’t used them before so it was good to now ow to use them. Need to test them out.

1 Like