Dynamic Component Rotation/Mirror Bug

Let me start off by explaining the issue that spawned the creation of this component and finding these bugs. I’m working at a company that manufactures extruded profiles for walls and SketchUp is a program that shows great potential in allowing us to create a process that streamlines our workflow by generating our products through dynamic components and then exporting the data through the “Generate Report” tool in SketchUp into Excel which would automatically fill out technical sheets based on the data SketchUp supplied. However, a major issue in regards to this process is SketchUp’s inability to define if a components axis has been inverted (which happens when you mirror a component). This issue would thus result in the duplication of any extruded profiles with angled cuts (besides that of 0°) rather than producing two (or more) profiles with inverted machining.

This caused me to craft a component (an inserted Child to a Parent Component) that would allow me to detect if the component was mirrored or not by producing 4 points (X+, X-, Y+, Y-) that would extract their Global X and Y coordinates based on its Parents X,Y coordinates and Z rotation. These global coordinates could then be compared with one another to determine if X+ and X- had been inverted, or if Y+ and Y- had been inverted thus defining if the component had been mirrored or not.

I crafted the component with visual references that caused X+, X-, Y+, Y- to always point towards their Global Axis, however, this is what led me to the discovery of the aforementioned bugs:

1: SketchUp’s Dynamic Component Rotations don’t update when rotated and must instead be moved in order to trigger an update

2: When imputing constraints into a dynamic component, the rotation interface changes from ‘0’ to ‘0.0’. The original ‘0’ version is capable of caching the rotation of the component and updating once moved (as explained in the previous bug), however the constrained ‘0.0’ version does not cache this data and thus reverts the component back to its original direction once the block is moved.

3: SketchUp’s Dynamic Components convert their rotational values to a range between -180 to 180 rather than 0 to 360, this in turn can cause various issues when using the DC Trig Functions in conjunction with others such as the ‘ABS(absolute value)’ function as any value between 180 to 360 will revert to -0 to -180 (This may be more for convenience sake than an actual bug, but It can become rather annoying)

4: SketchUp Determines a DC’s Z rotation value based on the direction the DC’s X axis is facing. So, when mirroring a component over the Y axis, the DC’s X axis faces in the opposite direction, resulting in a DC Z rotation of -180. However, when mirroring over the X axis, the DC’s X axis stays in the same position, resulting in a DC Z rotation of 0 (in other words, absolutely nothing changes in a components information when mirrored over the X axis, however, its geometry is inverted)

5: Continuing on with the last bug… When mirroring a component, it’s still possible to rotate the block using SketchUp’s Rotate Tool. However, the error arises when manually imputing a value for the DC Z rotation inside the Components Options/Attributes window (after a block has been mirrored - thus inverted), when imputing values here, the components orientation is reverted back to its un-inverted (non-mirrored) state with the X axis pointing in the direction defined in the DC’s attributes.

All in all, SketchUp needs to fix the updating error when rotating a dynamic component, and add an X,Y and Z inversion attribute into their dynamic components in order to resolve the mirroring issues.

PS: If anyone has a solution to my ‘mirror detection’ problem, please leave a comment or suggest an extension as it would be a great help.

Test Block:
Compass Quads.skp (143.4 KB)

1 Like

Don’t use mirror in DC’s?

Haha, my friend … I thank you for your knowledgeable solution, and I would quite happily disregard these errors if it didn’t cause a rather significant problem for me. Unfortunately, I work in a company where time is money and every minute counts, so when modeling a project in a symmetrical architecture, the ability to mirror multiple geometries over an axis can potentially save hours and reduce the potential for errors.

The only possible solutions I have devised is to:

1: Create a drop down attribute stating whether or not the component(s) have been mirrored, however, I need to consider the potential for human error here as this attribute would need to be switched every single time you mirrored one or more components and when dealing with large projects with hundreds of components the risk that mistakes could be made becomes very high. This in turn makes this work around very undesirable.

2: Configure the component with a drop down ‘mirror’ attribute that would actually invert all of the users inputs, however, this solution results in heavier components as well as inverted user inputs (when the block is in its ‘mirrored’ state) and most importantly would mirror each component individually over its ‘insert point’ as opposed to a defined line or axis thus rendering this an undesirable work around as well.

I hope this explanation helps in understanding my dilemma, and I would kindly like to ask those replying to please only add constructive suggestions and solutions. Thank You

After a mirror require user to make the result unique then scale definition (context menu)
this will create a new definition that will correct axis after scale definition