Broke Ruby User Defined ???


stevenyhof
 Share

Recommended Posts

I did not touch this, but noticed that FormatterDepthSixteenths and FormatterHeightSixteenths have the same code for obj.depth. So I did changed the FormatterHeightSixteenths to obj.height and now it gives me a valid number in the Expanded Macro Value field.

 

2.png

Link to comment
Share on other sites

Steven,

 

The first error was because you hadn't selected an object that had a width.  Nil Class indicates that there's no object to evaluate.

 

These macros supplied by Chief do not have "error handling" so they require that they reference only objects that have the attributes width or height.  That can also cause an error to occur.

 

When I create a macro I include "error handling" so that the macro will either:

  • report why it failed ---  example:  No Object Selected to Evaluate
  • or return simply a blank string
  • or return a value of zero

It depends on what the macro is supposed to do.  I try to anticipate what the user needs to see in order to know what to return.

  • Upvote 2
Link to comment
Share on other sites

15 minutes ago, Joe_Carrick said:

Steven,

 

The first error was because you hadn't selected an object that had a width.  Nil Class indicates that there's no object to evaluate.

 

These macros supplied by Chief do not have "error handling" so they require that they reference only objects that have the attributes width or height.  That can also cause an error to occur.

 

When I create a macro I include "error handling" so that the macro will either:

  • report why it failed ---  example:  No Object Selected to Evaluate
  • or return simply a blank string
  • or return a value of zero

It depends on what the macro is supposed to do.  I try to anticipate what the user needs to see in order to know what to return.

Ah! I understand. Thank you

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