Imperial units issue

Hi forum,

I am having a problem that I did not expect to have and it is related to drawing units. I have set in my Civil 3D file imperial units but when I start developing my Dynamo script, I do not have same units.

Here I will show you a sample for a single polyline. I select the polyline in the Civil 3D file and in Dynamo and you´ll see that I am not getting neither the length nor the coordinates with same format. I want to have my Dynamo script in Imperial units too. Any advice? Thank you in advance.

HI

Have a look at the link, it may help you

Capture

Hi @hosneyalaa ,

Thank you for your response but it does not seem to work fine for my case. Please find attached a screenshot:

I am looking for to get the same format as I have in Civil 3D drawings. @Paolo_Emilio_Serra1 , have you ever faced this issue before?

Thank you so much,

Juan,
I’m guessing your Civil 3D drawing is in either architectural or engineering units, which are both inches. Civil 3D likes only feet or meter units.
Dave

1 Like

@JMCiller the drawing units are inches, so the values shown in Dynamo are correct.
14’-11 33/64” = 179.51”

2 Likes

Thank you for the responde @mzjensen . I see your point in the sample I shared in the post. However, I was testing with just one single polyline setting the drawing units to feets and see the outcome that I get from Dynamo. I carried out this tasks just to double-check and test it out again.

As you can see here, I have set DWG units to feet:
image

Then I pick this polyline and I measure the length in Dynamo to double-check that results are fine and are shown as in the property toolbar in Civil 3D:

You can see I am not getting same lengths in Dynamo and Civil 3D having the units set in feet. Based on Civil property toolbar, that polyline length is 4’1.63’’. Why am I getting that 49.6262 length in Dynamo and Civil 3D dimension tag? why I cannot see 4’1.63’’?

Thanks in advance.

Does the length type have to be set to Engineering? If that is set to Decimal then I think everything should agree.

Regarding the dimension, it can display units differently depending on the formatting. So if you drill down into the settings for the dimension you should be able to change things so you get feet and inches just like the properties window.

But then in Dynamo, I think it will stay in inches unless you change the length type to Decimal in the unit settings. But regardless what the unit settings are in Civil 3D, I don’t think you’ll be able to get any node to output feet and inches because that would be a string output and not a double. I don’t think that would be desirable either since you couldn’t do any further mathematical operations with the value. The values have to be stored internally as some base data type (double, int, etc.) and then they are just formatted at the end as needed. If you look around the forum there are lots of examples of DesignScript or Python to format numbers as feet/inches, perhaps that will work?

1 Like

Hi @mzjensen . Sorry for the delay.

I just wanted to understand how Dynamo works with different units system set in the Civil 3D drawing. Now, I see it is a little bit messy… and I agree with you. I may work always in inches and then apply the node to transform inches into feet as I have to get an Excel sheet with data in feet.

Don´t you think this is a good point to include in Camber roadmap? :wink:

Hi @JMCiller,

From what I understand, Dynamo itself is unitless and will match the host application internal units. Regarding AutoCAD units, I think the Engineering and Architectural length types in the Unit Settings will assume that each drawing unit is one inch. But the others (Decimal, Fractional, and Scientific) can be used with any real-world unit.

Here’s a summary when drawing a line with length of 12 units:

AutoCAD UNITS Length Setting Value Displayed in AutoCAD Value Displayed in Dynamo
Architectural, Engineering 1’ 12
Decimal, Fractional, Scientific 12 12

And again with a line of 144 units:

AutoCAD UNITS Length Setting Value Displayed in AutoCAD Value Displayed in Dynamo
Architectural, Engineering 12’ 144
Decimal, Fractional, Scientific 144 144

These two OOTB nodes could help with conversions:

UnitsNodes

What are you envisioning? Maybe a node that converts a double into a string output with feet and inches? Feel free to add anything you think of here! Or even contribute code if you want to write it yourself… :wink: