ruby macro


ChiefuserMathews
 Share

Recommended Posts

Following along, I'm wondering why the Chief supplied macros don't work with multiplication.

 

Room.area.internal is Chief's macro, which doesn't work with multiplication.  Yet Room.internal_area does.

 

It seems like the program supplied macros should be editable.  Obviously macros aren't my forte!

Glazing macro.PNG

Link to comment
Share on other sites

2 minutes ago, ChiefPlagman said:
On 4/11/2021 at 10:10 AM, MoeGia said:

I'm wondering why the Chief supplied macros don't work with multiplication.

"Global" text macros, such as "room.area.internal", are not parsed by Ruby. They are simply replaced with text.

 

Thank you for the clarification.  This particular situation although confusing has a ruby equivalent.  Are you working towards providing other "ruby equivalents" or a way that other global text macro's as you call them can integrate with ruby and be parsed ?

Link to comment
Share on other sites

Thank you.  I'd love to see global macros 'shortcuts'.  It would be a huge help to those of us that need info out but don't understand the Ruby world.  With my limited understanding, I can do a lot of damage pretty quick!

Link to comment
Share on other sites

I think it would be great if Chief's Global Macros could be modified to report data such as percent glazing.  In my post above, I started with the global room area and tried to multiply it by .08, which you can't do.  I didn't understand that those macros don't work with ruby.  I accept that they don't, but I don't have a enough of a grasp of Ruby to understand the nuances.

 

I'm glad to see others have requested it in the past and it's on the list.

Link to comment
Share on other sites

Michael,

 

I'm not sure, but I think she's interested in knowing what the macros are that correspond to those and can be used in calculations.  If so, then the only way I know of getting such a list if by use of an "_Object_Properties"  macro.  I have 3 of those depending on the amount of information needed.  (full, short, short wo defaults).

 

Rather complex macro to write but well worth it if doing any serious macro development.

Link to comment
Share on other sites

Hi Mo,

 

I've attached my macro that lists all of the attributes of an object.  It is sorted alphabetically and skips the attributes that are simply indication of if it's using the defaults for that object.  If you import this into your plans you can select any object, open TMM and select this macro.  It will show you all the available information and the names of the attributes that can be used in custom macros - or even directly in labels.  

 

If you need any help in using such attributes, let me know.

_Object Properties wo _is_default.json

  • Like 1
  • Upvote 2
Link to comment
Share on other sites

8 minutes ago, Joe_Carrick said:

I've attached my macro that lists all of the attributes of an object.

 

Hi Joe,

 

That takes care of the ruby attributes that can be substituted for Cheif's Global macro's in an indirect sort of way.  Thank You.

 

Do you know if any one has taken the time to create a list of the ones that are not available for Natalie @ChiefPlagman so this can all be a little less confusing for everyone.

Link to comment
Share on other sites

17 minutes ago, Chopsaw said:

Do you know if any one has taken the time to create a list of the ones that are not available

Sorry, I don't - but all Chief's "Object Specific" that contain a "." and not a "_" are unavailable for calculations.  In most cases this is just the "Room Data".  You will note that my macro shows the corresponding macros that do work.  example:

  • internal.area .... doesn't work
  • internal_area .... works

I'm pretty sure that the "Object Specific" for "Rooms" are the main ones that don't work.  I think CA has converted almost everything else except their "Global" macros.

  • Upvote 1
Link to comment
Share on other sites

2 minutes ago, Joe_Carrick said:
19 minutes ago, Chopsaw said:

Do you know if any one has taken the time to create a list of the ones that are not available

Sorry, I don't

 

Ok.  I just was not sure if it is a matter of someone at Chief spending a few hours adding the ones that are not available or if each one would take a whole day of programming so we would be better off requesting specific ones and balance that out with new "ruby" feature requests and fixing stuff that is currently broken.

Link to comment
Share on other sites

2 hours ago, MoeGia said:

I think it would be great if Chief's Global Macros could be modified to report data such as percent glazing.  In my post above, I started with the global room area and tried to multiply it by .08, which you can't do.  I didn't understand that those macros don't work with ruby.  I accept that they don't, but I don't have a enough of a grasp of Ruby to understand the nuances.

 

I'm glad to see others have requested it in the past and it's on the list.

 

I understand all that.  What I don't understand is how this relates to your request for 'shortcuts'.  I don't see the connection.

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