Custom field comparing two values and returning the larger


OGDesigner
 Share

Recommended Posts

Is it possible to create a Custom Object Field that compares two known values (like Length vs Height) and return the higher of the two values?

 

We run piping in our design that is both horizontal and vertical. If the piping is vertical, the Height is the length of the pipe but if the piping is horizontal, the Width is the length of the pipe. I would like to create a new Custom Field that compares the two and returns the larger so I can total the column in my schedule for Total Length of Pipe.

 

Thanks for any suggestions!

Link to comment
Share on other sites

12 minutes ago, OGDesigner said:

Alaskan_Son, This is brilliant and worked like a charm! Is there a reference to writing these operators?

 

 

Me!

 

Joking :lol:

 

Okay, Not joking :mellow:...

 

Its tricky because you have to use both Ruby (programming language) and Chief which are 2 entirely different and separate constructs.  You can use any number of online resources to learn how to program in Ruby including the actual Ruby documentation, the StackOverflow forum, and even ChatGPT...

 

...But then you also have to learn how to use the various tools that Chief has given us to work with.  This is where it gets tricky.  There is a lot of nuance and interplay between the 2.  We have certain information in Chief that we can access and parse, various ways to access and parse that information, and some (but not all) of those ways can optionally use Ruby.  Chief has quite a bit in its documentation about built in name:value pairs, special built in Classes and Methods, and other text macro stuff, but has very little about actual Ruby programming (and rightfully so).

 

If you're serious about custom macros and otherwise using Ruby to access and parse information in Chief, it is well worth the effort to pay for an hour or 3 of consultation/training time.  You'll save yourself many hours...days..even weeks of otherwise unnecessary experimentation. 

  • Upvote 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share