Is what I am after after first solving how ro enter feet and inches into the command line.
the original dim was in ft inches, I have my dims as inches,
I needed a quick way of entering my sirte measurements of feet and inches into Rhino, without messing about with a calculator feet x 12 + inches.
so I have ended up with inches and having to manually type the feet inches in brackets for each one.
so how do I get that feet and in inches in brackets as shown ?
and I will be using X’XX"" method. as others fail me.
In my experience you shouldn’t have to calculate anything in the command line. Rhino will do it for you. Say units of my file are decimal inches.
I can type
13.125"
1’1-1/8"
333.375mm
33.3375cm
and they all create a line the same length.
I think you could possibly replace dimension text from inch only format with feet and inches using a script. Surely not the perfect solution because it won’t be realtime unless you do this in Grasshopper.
I’m not a coder but Copilot suggests this:
def decimal_to_feet_inches(decimal_inches):
feet = int(decimal_inches // 12)
inches = decimal_inches % 12
fraction = round(inches - int(inches), 3) # Round to the nearest 1/8 inch
fraction_in_inches = int(inches) + fraction
return feet, fraction_in_inches
def to_fraction(decimal):
# Converts the decimal part to the nearest fraction
numerator = int(round(decimal * 8))
if numerator == 8: # Special case: if rounding gives a whole number
return "1"
if numerator == 0:
return "0"
return f"{numerator}/8"
def format_feet_inches(feet, inches):
int_inches = int(inches)
fraction = to_fraction(inches - int_inches)
if fraction == "1":
int_inches += 1
fraction = "0"
if fraction == "0":
return f"{feet}'{int_inches}\""
return f"{feet}'{int_inches}-{fraction}\""
# Example usage:
decimal_inches = 62.125 # Example input: 5 feet 2 1/8 inches as a decimal
feet, fraction_in_inches = decimal_to_feet_inches(decimal_inches)
result = format_feet_inches(feet, fraction_in_inches)
print(result) # Output: 5'2-1/8"
Hi,
That spaghetti scares the pants off me.
I am not a coder and faced with having to do all that , I just run away, as a 2 day job becomes , a lot longer., worse still if a 1 say job heas become a weeks job, then that on top.
Are we saying 25ft 7.625 inches is not possible at all or just not possible in brackets ?
I may have to forego the inches and just have 25ft 7.625 inches as the only displayed number.
I will soon wake up from this wacky dream,
how can a serious CAD prog not have feet and decimal inches ?
and we are at V8
Its bad enough I cant even buy a feet and decimal inches retracting tape, so when out measuring up RAF aircraft, I have to do all in mm and then convert back home, but if its 1ft 11.9 or 1ft 11.95 and the measurement sits between the two, on site I could have measured again and seen that it was .9 or .95, usually whole sub divs such as .4 or .3 etc, not always though.
Items built to decimal inches need a decimal inch ruler on them.
but to not be able to show 2ft 11.7 inches is NUTS.
Is that how it is in solidworks, or catia ? or fusion360 ?
I think looking in the Help under Annotation Styles will get you 90%+ of what you are trying to do. Under Length Units, you need to use Inches-Decimal for your primary units, then use Inches-Feet&Inches for your Alternate Units. You can set the fractional linear resolutinon there, too. The alternate units in brackets will show fractional inches, but the primary units will show that in decimal inches, but without the explicit “inches”.