Gr8trim4u

Formatting Dimensions in Object specific Labeling

Recommended Posts

Good morning all. I need some assistance in formatting my label dimensions. I want to go from this to feet and inches(not decimal)

 

I have searched the videos and no avail.

 

TIA 

Anthony Hayes 

2018-01-17 (1).png

2018-01-17.png

Share this post


Link to post
Share on other sites

If you want to change your default for all dimensions, see Mick's answer below.

 

 

ct1.thumb.jpg.44a7145b70284c2dc4e2ba0d5caec6bd.jpg

Share this post


Link to post
Share on other sites

From decimal to x' y 1/2" my default is in decimal inches. I cannot find the DBX to change it.

 

Share this post


Link to post
Share on other sites

ct1.thumb.jpg.f6e04be9af11206672961a0a14160fde.jpg

 

You need a macro to do this. 

 

Do you know how to create and then use a macro?

 

This does the Length value only, but may easily expanded to do Depth as well.

 

------------

 

# Function to convert 1.125 to 1 1/8
# rounds to nearest 16th
def f(i)
  if i == 0 then
    inches=0
    return "#{inches}"
  else
    inches = i.floor
    frac = (i.remainder(inches)*16).round.quo(16)
    case 
      when frac == 1
        return "#{inches + 1}"
      when frac == 0
        return "#{inches}"
    else
      return "#{inches} #{frac}" #.gsub!(" ",".")
    end
  end
end

 

array = length.divmod(12)
s = "#{array[0]}" + "' " + "#{f(array[1])}" +'"'
 

 

Share this post


Link to post
Share on other sites

Thank You  Eric!!!!

 

I will incorporate!!!

 

Seems there should be a setting that allows you to change the format without a macro. 

Share this post


Link to post
Share on other sites

There is ....Eric simply misunderstood what you were trying to do, cos I know he knows this....... change the Primary Format to fractions not decimal places after making it Feet and inches  ie:  '-"

 

 

Capture42.JPG

Share this post


Link to post
Share on other sites

Mick, I imagine you are correct. I thought this was changing a single object, not changing a global setting.

Share this post


Link to post
Share on other sites

See the attached photo Mick's Suggestion. I am trying to show the Floor joist with lengths assigned.  I am till getting a decimal return.  

2018-01-17 (3).png

Share this post


Link to post
Share on other sites

That formatting is only for Dimensions, not for Object Labels.  It requires a custom macro to modify the Labels to ft.in.  I sell a "Framing Labels" macro package that will do that.  The price for that package is $50.00 and it will Label any Framing Member (Rafters, Joists, Beams, Studs, etc.)

Share this post


Link to post
Share on other sites

It will show inches for sure but I think you have unchecked the "default dimensions" box under label , so still have decimals showing....

 

 

47.JPG

Share this post


Link to post
Share on other sites
2 hours ago, solver said:

Mick, I imagine you are correct. I thought this was changing a single object, not changing a global setting.

 

***EDIT

Nope apparently not :)  you were right :)  your code above works (thx) as he wants the Joist label in Ft-Inch , my way only gives inches by the looks of it...

 

* make below the last line above and it will show the Type of Lumber or TJI as well ...you could also add depth x height if desired

 

s = "#{array[0]}" + "' " + "#{f(array[1])}" +'"' + "' " + " " + type_name

 

 

 

M.

Share this post


Link to post
Share on other sites
44 minutes ago, Gr8trim4u said:

Joseph

 Will it work on x10?

 

Thx for the heads up.

 

Anthony

 

Of course.  Macros are for the most part version independent.

Share this post


Link to post
Share on other sites
3 hours ago, solver said:

------------

 

# Function to convert 1.125 to 1 1/8
# rounds to nearest 16th
def f(i)
  if i == 0 then
    inches=0
    return "#{inches}"
  else
    inches = i.floor
    frac = (i.remainder(inches)*16).round.quo(16)
    case 
      when frac == 1
        return "#{inches + 1}"
      when frac == 0
        return "#{inches}"
    else
      return "#{inches} #{frac}" #.gsub!(" ",".")
    end
  end
end

 

array = length.divmod(12)
s = "#{array[0]}" + "' " + "#{f(array[1])}" +'"'
 

 

 

Wow.

 

While it's fantastic that there are people here willing to help figure this stuff out, I'm dismayed that it requires such arduous programming to do things that should be easily accessed by the average user.

 

Does CA actually think contractors in the field are working with decimal inches?? This program should have easily-accessed ft-in designation for EVERYTHING... OOB.

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

    27483
    Total Members
    6254
    Most Online
    Reboreb
    Newest Member
    Reboreb
    Joined