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

  • Member Statistics

    30062
    Total Members
    9156
    Most Online
    oldmillhomes
    Newest Member
    oldmillhomes
    Joined
  • Similar Content

    • By SNestor
      Made a video to describe what I'm wondering...
      I hope the behavior of building the roof using "auto rebuild" is normal Chief behavior - because I have to admit I've never noticed this before today.
       
      Roof Anomaly in Chief - X12 & X13 - Watch Video

    • By justin-c
      I'm trying to figure out if there is a way to display room occupancy load, using a text color tag.
      For example if a room was 100 ft.² and the fire occupancy load is 7 ft.² per person able to take the (room area divided by 7)
      the formula would also need to round up or down to the nearest whole number
       
      Here is the "Callout Specification" dialog window
       
           
       
       
      Here is the "callout tag" with the formula, but I would like it to be modified so instead it  show the red text or something similar
       
       

    • By APTArchitect
      I don't know what I did to make it disappear, but none of my library content is showing up any longer. 
      The library browser window is completely empty.
      I checked the folder path, and that is still correct. All content still exists in the folders I designated. Any suggestions?

    • By HCremodel
      I am trying to create a custom texture detail schedule that references an object's texture and displays the assigned texture image. Problem is, I am fairly inexperienced with Ruby/macro in general although I have a very basic understanding. Has anyone created something similar to this, or have suggestions on how to get started with creating this type of custom macro? I am using Interiors 12X
    • By alexpwalsh
      Up until recently, my reference display worked great exactly as shown in the help docs and videos. I have no idea what changed, but now it no longer appears in red, but rather in black and anywhere a line on the reference display coincides with a line on the displayed floor, the lines "obliterate" one another and there is no line shown at all. It makes for some very strange views that are uninterpretable, especially when windows are on top of each other. I attached pics to show what I mean. 
       
      In my layer display options, the reference display set looks normal. Everything is in red. 
       
      How can one "reset" the reference display to work as it does in a fresh plan?