# DC apparently ignoring End User units and input with units

**URL:** <https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451>\
**Category:** Dynamic Components\
**Created:** [August 3, 2017, 9:01pm UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451 "2017-08-03T21:01:12Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_mcclenahan](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/john_mcclenahan/32/135377_2.png) [@john\_mcclenahan](https://forums.sketchup.com/u/john_mcclenahan)\
**Post date:** [August 3, 2017, 9:01pm UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/1 "2017-08-03T21:01:12Z")

</div>

I’m trying to develop a dynamic component for a model railway harbour wall, where I want to use mm as the model units and as the units for input.

I’ve set the model units to mm with one decimal, and checked Display Units Format in the Model Info/Units window.

I have set all the input parameters to Text, User can edit as a textbox, and Display in End User Model units.

Yet even when I input a length value as (say) 50mm, the component is redrawn as 50cm.

Why? Is this just another of the DC’s numerous irritating bugs? I’ve tried saving the component and reopening it. Makes no difference.

 ![image](https://global.discourse-cdn.com/sketchup/original/3X/1/c/1ca3f884eb216127476dad5f35e48b3dd6604997.jpg)  
[Harbour wall DC.skp](https://forums.sketchup.com/uploads/short-url/iyoc29bnhrSke3veMRoahpvoyQ6.skp) (149.2 KB)

Or do I just have to work in cm?

[LATER]  
I’ve tried changing the input settings to input as Decimal Number, and Display in mm. Still won’t give me sensible results.

I wanted to make it a dual-unit DC to work in either inches or mm. Seems I can’t even get it to work in one lot of metric units. What am I doing wrong, or expecting wrongly?

---

<div class="post-metadata">

**Author:** ![john\_mcclenahan](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/john_mcclenahan/32/135377_2.png) [@john\_mcclenahan](https://forums.sketchup.com/u/john_mcclenahan)\
**Post date:** [August 3, 2017, 11:40pm UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/2 "2017-08-03T23:40:37Z")

</div>

Well, curioser and curioser.

I’ve sort of got it to work, using model units of cm.

But the sizes of components simply don’t respect the input sizes either as I drew them, or as defined their size in an input text box and redrawn.

A component that is supposed to be set with a LenX of 1.8cm is drawn as approximately 0.7cm - looks as if the X length input as 1.8 and displayed as 1.8cm in the Component Options is being divided by 2.54 before being drawn.

In Component Attributes, for example, the PilingHeight is shown as 1.9685 (presumably inches converted from 5cm). But the actual height drawn for the component is 1.97cm. This is crazily mixed up.

 ![image](https://global.discourse-cdn.com/sketchup/original/3X/f/b/fbfa94f81559ed8bc092230b9cac6b38535ae775.jpg)  
[Harbour wall DC.skp](https://forums.sketchup.com/uploads/short-url/j2yiFRkKCavwhDQpr5iZxgWhRzj.skp) (1.2 MB)

If I want this to work in either imperial or metric units, how on earth do I deal with this?

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [August 4, 2017, 6:45am UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/3 "2017-08-04T06:45:46Z")

</div>

Yeah, DC gets quite confusing, when dealing with units. Bottomline is that it interprets text standard as inches. Best to toggle all units to inches, for this is SketchUp 's ‘native’ unit.  
For changing the units in model info to take place, you would have to ‘reactivate’ the Components Options dialog, it does not ‘redraw’ instantly.

 ![Harbor](https://global.discourse-cdn.com/sketchup/original/3X/0/f/0ffdf568ec11f63c0d7b24bf9a91d08008284da9.gif)

[Harbour wall DC.skp](https://forums.sketchup.com/uploads/short-url/5eJNPdNRghpZsZE4JZUPUZXvhfx.skp) (1.7 MB)

---

<div class="post-metadata">

**Author:** ![eneroth3](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/eneroth3/32/1222_2.png) [@eneroth3](https://forums.sketchup.com/u/eneroth3)\
**Post date:** [August 4, 2017, 7:37am UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/4 "2017-08-04T07:37:21Z")

</div>

Short answer: don’t bother use DCs, it’s not worth it because of the many bugs.

---

<div class="post-metadata">

**Author:** ![john\_mcclenahan](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/john_mcclenahan/32/135377_2.png) [@john\_mcclenahan](https://forums.sketchup.com/u/john_mcclenahan)\
**Post date:** [August 4, 2017, 7:46am UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/5 "2017-08-04T07:46:15Z")

</div>

I’m coming to that conclusion, at least when trying to use metric units

A pity. IF they would work, they would be useful.

---

<div class="post-metadata">

**Author:** ![eneroth3](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/eneroth3/32/1222_2.png) [@eneroth3](https://forums.sketchup.com/u/eneroth3)\
**Post date:** [August 4, 2017, 9:11am UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/6 "2017-08-04T09:11:26Z")

</div>

> [@john\_mcclenahan](#):
>
> A pity. IF they would work, they would be useful.

Indeed! In my opinion DCs had the potential to be the greatest feature of SketchUp but because of how badly it was made it’s very far from being that.

---

<div class="post-metadata">

**Author:** ![MichaelW](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/michaelw/32/37029_2.png) [@MichaelW](https://forums.sketchup.com/u/MichaelW)\
**Post date:** [August 4, 2017, 9:34am UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/7 "2017-08-04T09:34:37Z")

</div>

> “I’m trying to develop a dynamic component for a model railway harbour wall, where I want to use mm as the model units and as the units for input.”

For model units, I will suggest using “cm” as you have mentioned in your second posting. There is no “mm” option. The units for input by users can be in “mm”. This is the limitation of DC.

![image](https://global.discourse-cdn.com/sketchup/original/3X/e/9/e9ab24f7580faf2df47003b57285de2e50a0fad7.png)  
Units: Centimeters

![image](https://global.discourse-cdn.com/sketchup/original/3X/7/1/71ad7f6cb92d541562c9122553840d36edb118ff.png)

 ![image](https://global.discourse-cdn.com/sketchup/original/3X/0/7/07188ce13d15dbad9dbbdb8113b8bb9d8405aeb4.png)

The component option box will display either imperial or metric units, depending on the type of templates used in the preference.

There is a way to toggle between imperial and metric units with the extension from Matt666.

> **[SketchUp Plugins | PluginStore | SketchUcation](https://sketchucation.com/pluginstore?pln=Matt_Toggle_Units)**
>
> SketchUp Plugin and Extension Store by SketchUcation provides free downloads of hundreds of SketchUp extensions and plugins

This will only display the different units on the model. The input will still be based on the template that the user selected.

---

<div class="post-metadata">

**Author:** ![john\_mcclenahan](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/john_mcclenahan/32/135377_2.png) [@john\_mcclenahan](https://forums.sketchup.com/u/john_mcclenahan)\
**Post date:** [August 4, 2017, 9:43am UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/8 "2017-08-04T09:43:54Z")

</div>

Thanks, all. And particular thanks to @MichaelW for showing that it CAN be done! But even his is drawing the component the wrong size.

I might give it one more go, based on Michaels version.

I’ve posted a feature request to get DCs to work properly and fix the numerous known bugs and other quirks, of which the inconsistency in handling non-inch units is one of the worst.

---

<div class="post-metadata">

**Author:** ![pcmoor](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/pcmoor/32/3427_2.png) [@pcmoor](https://forums.sketchup.com/u/pcmoor)\
**Post date:** [August 4, 2017, 10:32am UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/9 "2017-08-04T10:32:20Z")

</div>

As per @MichaelW you need to choose centimeters in the drop down units, inches if using inches, but not text, as the value of text is assumed to be in inches  
there are scaling issue with your collection of sub components, this probably was produce with the various stretching as changes were made, its good practice to build DCs without changing the original values, always returning to them after testing before adding another formula, otherwise the various subs can get out of sync (out of scale)

I suggest you use groups for the subs, as there is over 1 MB of collected component rubbish for the 150kb component  
Can you post a true scaled set of groups without any formula, then I will give it a go using metric

---

<div class="post-metadata">

**Author:** ![john\_mcclenahan](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/john_mcclenahan/32/135377_2.png) [@john\_mcclenahan](https://forums.sketchup.com/u/john_mcclenahan)\
**Post date:** [August 4, 2017, 1:05pm UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/10 "2017-08-04T13:05:23Z")

</div>

Thank you, Philip.

I will do as you ask later this afternoon or early evening - I’m busy or out until then.

I have been trying NOT to change the original sizes, and several times found I had to Reset Scale for sub components even so. And even after doing that, a Redraw would shrink everything back by the 2.54 factor and draw lengths in cm where the internal DC attribute was (I thought) in inches. It’s been an exercise in frustration so far.

In principle, CAN one write a DC that works equally well in either inches or metric units? If so, do you know if a good example, or better, tutorial? The Help references I found don’t even mention the issue, let alone explain a work around for the quirks.

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [August 4, 2017, 4:05pm UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/11 "2017-08-04T16:05:12Z")

</div>

> [@eneroth3](#):
>
> Short answer: don’t bother use DCs, it’s not worth it because of the many bugs.

Sure, it is buggy, but I can’t give up…

> [@MichaelW](#):
>
> For model units, I will suggest using “cm” as you have mentioned in your second posting. There is no “mm” option. The units for input by users can be in “mm”. This is the limitation of DC.

It is not the **only** limitation…, but I can’t give up…

> [@MichaelW](#):
>
> The component option box will display either imperial or metric units, depending on the type of templates used in the preference.

This will not display the units correctly in a metric template , **as long as you use text** for units ;

> [@pcmoor](#):
>
> but not text, as the value of text is assumed to be in inches

and :

> [@MikeWayzovski](#):
>
> Bottomline is that it interprets text standard as inches.

You can see this in your picture :  
 ![07188ce13d15dbad9dbbdb8113b8bb9d8405aeb4_1_603x500](https://global.discourse-cdn.com/sketchup/original/3X/8/8/88fcd09abf5c3cd19a19b6fca59ddcf72c4ea030.png)  
What really ‘bugs’ me is the PileSpacing dimension… @john_mcclenahan Have you altered it manually ?

I can’t give up…

> [@john\_mcclenahan](#):
>
> If I want this to work in either imperial or metric units, how on earth do I deal with this?

Try the file I uploaded and, since you are on a Mac and I am not sure if it works directly on Windows ( @pcmoor ?) :

> [@MikeWayzovski](#):
>
> For changing the units in model info to take place, you would have to ‘reactivate’ the Components Options dialog, it does not ‘redraw’ instantly.

cheers 🙂

---

<div class="post-metadata">

**Author:** ![john\_mcclenahan](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/john_mcclenahan/32/135377_2.png) [@john\_mcclenahan](https://forums.sketchup.com/u/john_mcclenahan)\
**Post date:** [August 4, 2017, 6:50pm UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/12 "2017-08-04T18:50:18Z")

</div>

> [@MikeWayzovski](#):
>
> What really ‘bugs’ me is the PileSpacing dimension… @john_mcclenahan Have you altered it manually ?

No, I hadn’t.

But I HAVE been trying your amended version, and adapted it slightly. I see you have set all the Units to inches, and find it puzzling that it works that way, but apparently it does - with one exception (more later about that).

I wanted to make it scaleable using the scale handles in the X or Z directions, and have succeeded, though with another quirk appearing.

I wanted the X length to be a whole multiple of the PileSpacing, and that was easy, using an example from the Help Centre ([https://help.sketchup.com/ko/article/114568](https://help.sketchup.com/ko/article/114568)) to make a component snap to a specific length.

And I wanted the Piling Height to snap to a whole number of mm. So I tried putting in the formula  
`PilingHeight = Round(Current("LenZ") - EdgingHeight)`  
before noticing that you had set all the units to Inches.

This rounded the height to the nearest inch, but displayed it in mm.

So I thought: the units are inches, if I multiply them by 25.4. they will convert to mm, so this ought to do the trick:  
`PilingHeight = Round(25.4 * (Current("LenZ") - EdgingHeight)/25.4) `

And it simply doesn’t work - or else my logic is wrong here?

[EDIT - Yes it is! Should divide before multiply. But when I fix that, it still doesn’t work, and rounds to whole inches, or tenths of inches, If I give it a second parameter to round to one decimal.  
`PilingHeight = Round((Current("LenZ") - EdgingHeight)/25.4,1)*25.4 `

When I changed the units for PilingHeight to cm, removed the 25.4 factor, and round to 1 decimal of cm, it DOES work correctly - the PilingHeight correctly snaps to the nearest 1mm.

So I thought: why not make ALL the attribute units into cm?

Tried that - doesn’t work. Changed (for example) PileSpacing to cm. Goes crazy again, and shrinks everything by the (surprise!) factor of 2.54 again.

**This is simply nuts.**

Anyway. I now have a DC that does what I set out to do, which was to make it easy to explore alternative designs of length, height, and pile size of harbour wall in a small model railway layout being developed by a friend, using inputs in mm.

A VERY BIG THANK YOU MIKE! I’d have given up long since without your help.  
Here’s the version I’m going to go with.  
[Harbour wall DC.skp](https://forums.sketchup.com/uploads/short-url/wUbXN8YocyKErlrlRq63ShX0lE4.skp) (2.5 MB)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sketchup/original/3X/f/2/f2a121500b085ed60806607a82720b092d800bb3.png) [@system](https://forums.sketchup.com/u/system)\
**Post date:** [November 4, 2017, 10:50am UTC](https://forums.sketchup.com/t/dc-apparently-ignoring-end-user-units-and-input-with-units/49451/13 "2017-11-04T10:50:31Z")

</div>

Closed on November 4, 2017, 10:50am UTC

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.
