Macro's in X12


wjmdes
 Share

Recommended Posts

OK, so today I learned that Legacy is just a fancy term for obsolete.  See, I do know how to search :) 

 

I have numerous macros, from others and some I wrote.  Has there been any enhanced documentation regarding what "migrating" is going to do to my macros and what I can expect? Or how to fix issues? Is this going to put the brakes on my workflow?  I know enough to write small macros for menial tasks, but I do not have an extended knowledge.

 

Or is this just not a big deal?

 

 

Link to comment
Share on other sites

  • Macros from versions before X12 that have not been migrated should continue working in X12. You do not need to do anything if you merely want to use your existing macros or new macros that don't interact with your existing macros.
    • However, referencing a legacy macro that has not been migrated from a new macro written in X12 (or vice versa) might cause an error.
  • During the migration process you will be able to compare the results of the macro before and after migrating and have the opportunity to make changes if needed.
    • Not all macros will require any changes while migrating.
  • For more information, see "Considerations for Legacy Files" and "Migrating Legacy Ruby Code" in Help.
Link to comment
Share on other sites

The key here is that any distance or area attribute that was a "Floating Point" number in X11 is a "Measurement" in X12.  If you migrate a macro it will assume it's using the X12 "Measurement" data type and might not work the way it did in X11.

 

"Measurements" recognize a "unit" such as inches, feet, sqft, etc.  You can add, subtract, multiply or divide like measurement units - but you can't add or subtract a floating point or integer number to a measurement.

 

If you want to migrate your macros you have to make sure you follow those rules (and there are some more rules) ---- or make sure you convert attributes using .to_f in order to avoid execution errors.

 

My suggestion is to not migrate unless you are sure of what you are doing. 

 

I've taken the time to modify all my macros to work in X12 - it was not a trivial effort.  When I create new macros I try to use the "Measurements" but it requires understanding and implementing several new methods that are unique to Chief's X12 Ruby.  The Measurement Class is not a standard Ruby Class - it's an add-on created by CA.

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