Convert Dynamic Component to Auto Glue

Just vested two days trying to figure this one out. Wondering if there are any other better solutions out there from the DC Community. Don’t think a Ruby Plug-In would be of help. Perhaps I’m wrong. This is the workflow:

Convert Dynamic Component to Auto Glue
(While keeping the DC Attributes)

• Create a NEW Component with the Auto Glue feature.

• Get INSIDE this New Component (Dble Click)

• Import the Regular DC Component INSIDE the new Auto Glue component

• ROTATE the DC along the X-Axis as needed to match the Cut/Glue Plane on the New Compo.

• The New Compo is now the PARENT Component

• COPY All Parameters from the DC’s former Parent Component onto the New Parent Component.

This includes Size, Custom Parameters and such.

• Copy the NAME on the DC’s Former Parent Component

• Explode the DC so that its Parent Component gets deleted.

• Paste the NAME from the original DC’s Parent to the NEW Parent Component.

This is important so that parameters in the former Parent get properly referenced when transferred to Child Components now that the Parent Component has been redefined.

• Most but NOT all of the Auto Glue’s GREEN Axis will now control what used to be the BLUE Axis on the DC and Vice versa.

Some Child parameters that were previously referenced off the DC’s Original Parent Compo are now read from the new Auto Glue Parent Compo where THE BLUE AXES NO LONGER EXISTS!

• All RED (X) Parameters should remain unaltered.

Kind Regards and a Happy New Year to All
Nino

Yes you are correct, ie you’re wrong. Such automation must be performed using SketchUp’s APIs which means an extension.

But all that aside, why not simply edit the DC definition and set it’s glue to properties as needed ?
(This can also be done via Ruby API calls.)

I think the original problem was that I modeled the window Upright and when it came time to Auto-Glue, the Axes were going the wrong way.

Found this:

Gluing and cutting planes can turn the axis origin sideways. When you create a component, you can set both gluing and cutting planes. When a component glues to only vertical surfaces, the blue (Z) and green (Y) axes are swapped: LenZ has a length value for the green axis, and LenY ’s value is what’s typically the blue axis. For example, if you want to constrain a gluing component that glues to vertical surfaces, such as window, to a specific height, your formula needs to constrain LenY , not LenZ .

At: https://help.sketchup.com/en/sketchup/making-dynamic-component

Nino

That is confusing help text.


Basically, when you model a gluing component, within it’s entities collection the XY plane is the cutting plane.

So for a window meant to snap to vertical walls, you model it lying down along the XY plane. Often a modeler will as a last step move the window (or door) geometry down into the XY plane so that the it cuts the wall face some where in the middle of the component.

Afterward when such a component is placed into a house model, it will be lying flat when attached to the cursor until the user drags it near some kind of face. If it’s a vertical face and it is set to snap to such face, then the PlaceComponent Tool will flip the instance into the correct orientation.

Right. An Auto-Glue Compo is modeled Lying Fiat (X & Y Axes) but if the author does not anticipate that need, and starts the window model orientation like a window stands in real life (vertically), that’s when the proposed “conversion” comes to play.

Nino

Yea, so do it manually once, resave the definition and your done forever.