ACADuser

Ceiling Height Label?

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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. 

Share this post


Link to post
Share on other sites

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?

 

Share this post


Link to post
Share on other sites

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.

  • Upvote 1

Share this post


Link to post
Share on other sites

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.

 

CA Ceiling Height.JPG

CA Ceiling Height2.JPG

Share this post


Link to post
Share on other sites

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.  

 

 

Share this post


Link to post
Share on other sites

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

CA Ceiling Height3.JPG

Share this post


Link to post
Share on other sites

your not using a  rich text box are you?

Share this post


Link to post
Share on other sites

I've got both Mtext & a Text label, both evaluation error.

So what is the issue with Mtext?

 

Share this post


Link to post
Share on other sites

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. 

 

Share this post


Link to post
Share on other sites
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. 

Share this post


Link to post
Share on other sites

Well I started a plan from template, one room

Got the following

CA Ceiling4.JPG

CA Ceiling5.JPG

Share this post


Link to post
Share on other sites

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".

 

Share this post


Link to post
Share on other sites

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... 

Labels.thumb.jpg.96dfad2018b0c505739e1371d24222af.jpg

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:

  1. 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).
  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).
  3. Set up a couple different room label text styles (one for the room name and another for the ceiling height).
  4. Overlap a couple layout boxes in layout using 2 different layer sets (one with nothing but room labels being displayed.
  5. 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.

Share this post


Link to post
Share on other sites

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?

 

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

 

Share this post


Link to post
Share on other sites

One thing that can help to identify when the macro isn't working:

  1. Select a room
  2. Open TMM
  3. Select the Ceiling Height Label macro
  4. If it shows "Evaluation Error" check the "Show Evaluation Error"

That will provide more detail on what & where the problem is.

Share this post


Link to post
Share on other sites

Thanks Joe, got the other files & put them in the folder.

See the attached error, I reloaded the Ceiling json macro after deleting it.

 

 

CA Ceiling6.JPG

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Member Statistics

    27474
    Total Members
    6254
    Most Online
    Chieftan08
    Newest Member
    Chieftan08
    Joined