ACADuser Posted October 15, 2017 Share Posted October 15, 2017 Here we are on 2017 & I see no way to display my Mtext label of ceiling height in Feet & Inches. There are threads way back in 2011 talking about this shortfall. I work in inches so the label displays in inches. Is there no build-in macro to convert inches to Ft'-In" ? My label %room.name% Ceiling%room.elevation.ceiling% I see Joe has a subroutine in his FloarClass.rb but I haven't a clue how to use it. It should be part of Chief. Link to comment Share on other sites More sharing options...
Joe_Carrick Posted October 16, 2017 Share Posted October 16, 2017 Alan, The Room macros supplied by Chief only display in inches and the values are not returned to ruby as actual values. However, I have a %Ceiling Height Label% macro that converts to ft-in using the subroutine you mentioned. That macro can be inserted in the Default Room Label - or in any individual Room Label. Unfortunately it will not work in a RTB. The problem with Chief adding every possible formatting is that there are so many possibilities for customization. They actually made a mistake IMO of calling their custom labels "macros". Internally they refer to them as "Name:Value" pairs. Link to comment Share on other sites More sharing options...
andypapamarcos Posted October 16, 2017 Share Posted October 16, 2017 Alan, If the question is how do you use Joe's macro from FloatClass, - you go to menu CAD - Text - Text Macro Management and then import the json file. Once you see it in your list of text macros, instead of putting : %room.name% Ceiling%room.elevation.ceiling% you would put : %room.name% Ceiling%Ceiling Height Label% Joe, did I get that right? Andy Link to comment Share on other sites More sharing options...
Joe_Carrick Posted October 16, 2017 Share Posted October 16, 2017 2 hours ago, andypapamarcos said: Joe, did I get that right? Sort of..... FloatClass.rb only needs to be in the scripts folder - it's not a json file & doesn't need to be imported. The %Ceiling Height Label% macro uses the FloatClass.rb file. I don't know if Alan has %Ceiling Height Label% or not. Link to comment Share on other sites More sharing options...
ACADuser Posted October 16, 2017 Author Share Posted October 16, 2017 I have the Yearly subscription json files but do not see %Ceiling Height Label% macro What is the name of the json file that contains that? Was it a separate purchase? Link to comment Share on other sites More sharing options...
Joe_Carrick Posted October 16, 2017 Share Posted October 16, 2017 Alan, Send me your email address in a PM. I'll email the Ceiling Height Label.json file. I'm off ot play in a Golf Tournament this morning but I'll be able to email it this afternoon. 1 Link to comment Share on other sites More sharing options...
ACADuser Posted October 16, 2017 Author Share Posted October 16, 2017 Thanks Joe and have fun. That's what it's all about. Link to comment Share on other sites More sharing options...
ACADuser Posted October 16, 2017 Author Share Posted October 16, 2017 Loaded the Macro but it does not validate & is greyed out. I'm still finding my way with these macro's. No rush as I;m putting out fires on another project this morning. Link to comment Share on other sites More sharing options...
BrownTiger Posted October 16, 2017 Share Posted October 16, 2017 I have a similar macro, can post the code.. with the similar extended Float class (I already posted). It really makes no difference if macro is valid or not... In the room labels default type "%Ceiling Height Label%" without the quotes. Link to comment Share on other sites More sharing options...
ACADuser Posted October 16, 2017 Author Share Posted October 16, 2017 I must be doing something wrong. If I manual paste the macro I get an evaluation error. BTW I added to my Mtext & Default room label and same error Link to comment Share on other sites More sharing options...
DRAWZILLA Posted October 16, 2017 Share Posted October 16, 2017 your not using a rich text box are you? Link to comment Share on other sites More sharing options...
ACADuser Posted October 16, 2017 Author Share Posted October 16, 2017 I've got both Mtext & a Text label, both evaluation error. So what is the issue with Mtext? Link to comment Share on other sites More sharing options...
BrownTiger Posted October 16, 2017 Share Posted October 16, 2017 Here Create a new macro name it "CeilingHeight" Paste the following val = (ceiling_elevation-floor_elevation).divmod(12) inch_frac = ((val[1]-val[1].floor)*16).round.quo(16) result = case inch_frac when Rational(1.0) "#{val[0]}'-#{val[1].ceil}\"" when Rational(0.0) "#{val[0]}'-#{val[1].floor}\"" else "#{val[0].floor}'-#{val[1].floor} #{inch_frac}\"" end Now Edit>Default Settings>Floors and Rooms>Room Label> Into Text enter <CR> %CeilingHeight% Where <CR> is carriage return. Now go back and double click on your room and change show room label check box to unchecked and back to checked and click ok. Link to comment Share on other sites More sharing options...
Alaskan_Son Posted October 16, 2017 Share Posted October 16, 2017 49 minutes ago, BrownTiger said: Now go back and double click on your room and change show room label check box to unchecked and back to checked and click ok. Actually, all you have to do is open the room and then click okay and it will update to reflect the new default room label. Link to comment Share on other sites More sharing options...
ACADuser Posted October 16, 2017 Author Share Posted October 16, 2017 Well I started a plan from template, one room Got the following Link to comment Share on other sites More sharing options...
Joe_Carrick Posted October 16, 2017 Share Posted October 16, 2017 Alan, You have to use the "Default Room Label" and manually type %Ceiling Height Label%. It will not work in a RTB. For existing Rooms, make sure you use "Automatic Label" and uncheck/check "show label". Link to comment Share on other sites More sharing options...
Alaskan_Son Posted October 16, 2017 Share Posted October 16, 2017 Here's a quick example plan and layout using a method you can use to essentially create a Rich Text version of those room labels... Alan's example.plan Alan's example.layout I went over the basics of the method in another thread over in the Tips and Techniques section but essentially you need to: Use a custom macro in the default room label (I just used a modified version of the macro BT posted above for this example that is set to display only the room name when the layer set includes the number 2). Use a solid fill in your default room label (not actually necessary but the technique gets a fair bit more complicated if you don't do this). Set up a couple different room label text styles (one for the room name and another for the ceiling height). Overlap a couple layout boxes in layout using 2 different layer sets (one with nothing but room labels being displayed. Move the appropriate layout box to the front group, and shift it up or down as necessary to get the appropriate text spacing (this step isn't actually absolutely necessary either, but then again the technique starts to get a bit more complex). Once you figure it out, its actually a lot faster and easier than it sounds. Link to comment Share on other sites More sharing options...
ACADuser Posted October 16, 2017 Author Share Posted October 16, 2017 I think Eric nailed it with the "Owner Object", so I have it working. Also why do the built in macro's work in Mtext & Text for room labels and this one won't? Link to comment Share on other sites More sharing options...
ACADuser Posted October 16, 2017 Author Share Posted October 16, 2017 Joe, yours is still not working. Looking at the code cRequired = ["Float Class.rb", "Hash Class.rb", "DwgUnits.rb"] I only have Float Class.rb in my Scrips folder Link to comment Share on other sites More sharing options...
Alaskan_Son Posted October 16, 2017 Share Posted October 16, 2017 14 minutes ago, ACADuser said: I think Eric nailed it with the "Owner Object", so I have it working. Also why do the built in macro's work in Mtext & Text for room labels and this one won't? 2 things... 1. I would recommend you use the term Rich Text as only other AutoCAD users will likely understand what Mtext means. 2. Chief basically has 2 different macro types...Global, and User Defined. Global macros have some unique subsets of macros that recognize WHERE in the plan they exist. One of those subsets is something some of us refer to as "room context". This is how the global Room Info macros work...they recognize the room they were placed in and report the appropriate value. Currently we cannot use a User Defined macro in this same manner and so we're limited to using the OOB global macros for any room information we want to use in a standard text box or a rich text box. I'm pretty sure I could get around this by writing to and reading from an external text file (which I've done in the past in order to create some automated room numbering) but that would require some pretty complex macros and methods. This is the reason Joe, myself,and probably Gerry and others have requested in the past that we be given a Room Context for User Defined text macros so we could create our own custom macros that could be used in Text and Rich Text boxes for use as room labels. Link to comment Share on other sites More sharing options...
Joe_Carrick Posted October 16, 2017 Share Posted October 16, 2017 10 minutes ago, ACADuser said: Joe, yours is still not working. Looking at the code cRequired = ["Float Class.rb", "Hash Class.rb", "DwgUnits.rb"] I only have Float Class.rb in my Scrips folder OK, edit that macro line so that it is only: cRequired = ["Float Class.rb"] I'm also going to email the other 2 rb files. Link to comment Share on other sites More sharing options...
Joe_Carrick Posted October 16, 2017 Share Posted October 16, 2017 One thing that can help to identify when the macro isn't working: Select a room Open TMM Select the Ceiling Height Label macro If it shows "Evaluation Error" check the "Show Evaluation Error" That will provide more detail on what & where the problem is. Link to comment Share on other sites More sharing options...
ACADuser Posted October 16, 2017 Author Share Posted October 16, 2017 Thanks Joe, got the other files & put them in the folder. See the attached error, I reloaded the Ceiling json macro after deleting it. Link to comment Share on other sites More sharing options...
ACADuser Posted October 16, 2017 Author Share Posted October 16, 2017 Opened another plan and loaded the macro but message is slightly different. Link to comment Share on other sites More sharing options...
DRAWZILLA Posted October 16, 2017 Share Posted October 16, 2017 I could be wrong but you can try to change your security level to level 1, just in case Joe doesn't see this. edit: sorry Eric , didn't see your answer Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now