Can't select rotation points I need to make component dynamic

I have a component,a door hinge, that I picked up at the hardware store.
I tried to model it as close to the real thing as my meager skills allowed.
I’want to make it a dynamic component…I think this is what I want… I don’t really know what I don’t know.
So when i include it in my models any doors I hang with it will open and close.Hinge_F179_001.skp (553.3 KB)

My difficulty is that I am unable to select the points about which rotation is to occur.
I used an extension (round corner) that chamfered the end of the pin of the hinge which makes it look like the real deal but now the end is just a surface…there is no circle to pick as a rotation point.
Because of the shape of my loops that should pivot around the pin I am struggling to set a pivot point for the other pieces of my component as well.
Could someone please take a look at my model and recommend how to make my hinge dynamic?
I would also add it was difficult to assemble for the same reasons so I’m unsure if things are lining up exactly either.
Seems there ought to be some tricks that I could sprinkle some hidden stuff around that would provide me with the geometry I need to line things up without such a struggle

Interesting idea. But door’s will have more than one hinge, and are usually thought of as child components of the door component. Behavior and functionality are inherited from parent to child, not the other way 'round. (We cannot ignore how SketchUp and dynamic components are programmed, because they are programmed in a class + subclass manner, using C++ with is exposed to the Ruby API, respectively.)

Secondly, the way that DCs are programmed in Ruby, for use with the Ruby DCInteractTool, users will be clicking the door, not the hinge(s), to fire the onClick rotation.

So either any door component will also need to be a DC, OR the door component with need to be inserted as a child component, of a hinge set DC component (which will expand the clickable boundingbox for the hingeset.)

Rotation: I believe DC rotation happens about the Z axis of the component’s origin, so the origin of the DC that is controlling rotation (ie, perhaps the “Hingeset”) should be the hinge pin center line.


If I was to begin drawing, I’d draw a construction line straight up and down the Z axis (although it is not really needed because you can always get an inference on the 3 axis.)
So I’d start drawing from the hinge pin center outward, and the component will naturally be located on that as the origin.

You save out each sub-component as their own file, and lastly insert the 3 sub-components into a new empty file, to create the master hinge component. Save that as well, and repeat (3 times) to create the base hinge set component. (The 3 hinges should be spaced one on top of the other up the z axis.)

(Moved this to the DynamicComponents category.)

You can change the rendering to Xray or Wireframe mode, so you can see the end loops of the hinge pin. You can get a center inference by hovering over one of the cardinal points of a circle’s edge loop. (Just make sure to select everything before switching to Wireframe.)

You should have drawn each of the sub-components with their origins at the center line of the hinge pin (or pin holes.)

But if you need to now move the components you can. Just select all and get an inference of the center (as I said above,) and move everything horizontally to an “onBlueAxis” inference.

I am a little sketchy on the object oriented restriction.
I was taught that in object oriented programming it didn’t matter who the parent or child was, the cow could give you a milk object or the milk object could un-cow itself but most folks would have the cow give milk to follow convention clarity and avoid confusion which I think that is what you are saying.
i drew the hinge first so I would know the gap to use between the door and the frame my plan was to add it (and 2 others) to a door.

I think my problem is that I can’t get an inference to the center of the arc that comprises my loop.
Even if I knew how to use the tool s4u-linetool I not sure how I would draw a construction line in the center of the arc.
Even if I turn on x-ray I can’t seem to get and inference to the center of the arcs of my loops.
It would seem I’ve broken the inference to the center of the arc somehow.
Is there a way to fix this?
Or do I redraw the whole thing around the construction line.
Note:Now when I drew the loops I drew them as they are not a perfect circles they are kind of ellipses but there is a perfect arc in part of the ellipse…does that make sense?
Do you have a guess what I did to end up in this sorry state, so hopefully I can avoid it next time?

Not first understanding the basic functions of inferencing and using SketchUp’s modeling tools, before attempting to tackle something complex.

Back to basics:

SketchUp User Guide: Introducing Drawing Basics and Concepts

As I said, DCs will rotate around the component’s origin.

So either you need to draw the component around the model origin, before making it a component, or be able to use inferences, to change the components axis (right-click “Change Axis”) after it is a component. (The latter will only correct the “In Model” component definition, not the component file in your local collection on disk.)

Now the hinge must be made up of 3 sub-components. The pin and the frame leaf which would not rotate, so they’d be wrapped into a component attached to the frame.

… and the door leaf, which will rotate with the door. So I’d put 3 of them into a hinge set component, and that into a “door wrapper” component (which has the same origin as the hinges set.) Into this wrapper I’d insert a door component.

The wrapper is what the user clicks on with the DC Interact tool, so it needs to have a “OnClick” attribute (as given above.) The wrapper and it’s sub-components, the door and the door side hinge leaves, will swing open. The hinge pins, the frame side hinge leaves, and the door frame will remain stationary.

It is always hard to envision things with words alone. Posting a cropped image from a screen shot helps.

Phillip, are you still using SketchUp 15.3 ? SketchUp 16 has an overhauled inferencing system.

I’m using the latest version of SU 16.0.19912.

I’m not sure how to tell you that the inference process (whilst I can make it work just fine on other stuff I draw) seems to have stopped working for this part.
I suppose that should have been my original question.
I think if I could rotate on part of the hinge around the center of the arc that makes up the loop of the hinge I could do the other stuff required to animate the part.
But the inference engine will not inference/reference the center of what I know is an arc at least it was an arc when I drew it… it is like I un-arced my arc and turned it into to something that is no longer and arc…does that make sense?
I’ll try to record what I’m trying to do and post that but I’ve got a raft of meetings the rest of today.
I am certain you are not understanding the trouble I’m having with the inference engine.
Thanks for your help thus far I certainly appreciate your help.

That is not the latest. 16.1 was released last February 29, 2016.
> SketchUp Application Release Notes

Well, make a component of it and save it out to a SKP file, and then post it here in this thread. (If you’re on Windows you can drag and drop allowable files right into the post editbox.)

EDIT: Sorry, I see you’ve posted a component in the 1st post.

You might have exploded it into just a series of edges.

there is a circle within the pin head to pin join which is accessible in X-ray mode, a line can be drawn to form an axis reference from that center,

Then used the lines end point as a start to re-align axis of the loose hinge leaf and other parts to suit. Then as Dan says use animate about that axis

DC hinge.skp (415.5 KB)
animate left side on click (I have taken the liberty of changing the axis to suit by own preference, but you can change to suit)

Hi pcmoor & Dan

there is a circle within the pin head to pin join which is accessible in X-ray mode, a line can be drawn to form an axis reference from that center,
That circle is there but I can assure you that is is not in the center of the loop of either hinge loop below because I had no way to move the pin to the center of the arc of the loop because I was unable to reference the center of the arc of the loop.
I gave it my best shot but I was just eyeballing it till it looked right but of course the reason I use CAD is so things will be right not give the appearance of being right or looking right!

I did take Dan’s advice and upgrade to the latest version of SU
But there was no joy there either.

So I reasoned I could not infer to the center of the loop was because I had used poly lines to sketch an exact copy of my hinge.
Where did my poly lines come from you ask?
I originally drew the outline for the face in AutoCAd and imported a dxf because the 2D sketching capability of SU in my opinion is quite weak.
(I also reckoned the free hand tool in SU is the equivalent to plines in AutoCAD.
I’m an old hand at AutoCAD drawing complex shapes in 2D and importing it into SU is easy peasy for me.)

So I redrew the pieces in SU from scratch.
This time I used only circles and straight lines no free hand stuff to make sure there were no poly lines mucking around.
Whilst I’m a stickler for drawing things as they are exactly if at all possible as it has saved me much grief in the past I decided I had to let it go this time.
When I tried to assemble them into a component that animated the hinge rotating I thought I had solved my problem.
But the only reason it appeared this way was because I was selecting the center loop of the three loop piece not the two loop piece.
With the three loop piece, the center of the loop, is in the same plane as the top of the hinge.
The inference engine seems to be happy to work out what I wanted in that case.
Try as I might when I tried to select the center of the loop on the two loop part there was no joy.
I reckon it is because the center of the arc that I want to align on is not in the same plane as the top of the component. (It is the only theory I’ve got)
But by this time I had thunk it through and realized that I could calculate the distance in X & Y from opposite the corner of the hinge and get the center of the loop back to the origin.

Yeah yeah the better approach would have been to draw the pieces around the origin and that certainly was my intent but some where in the process (as my skills are still very weak) I moved both parts when I had intended only to move the three loop.
The moral of the story is to always draw the rotation portion of components around the origin.
But in my opinion the inference engine is weak, it should logically be able to do what I am attempting, as even the old hands sometimes move things off the origin and need the ability to restore order.
If I knew how to report a bug I would list this as a bug that needs fixing.

I’ll post the .Hinge_Stanley_F179_003.skp (935.3 KB)
.skp any suggestions or critiques are always appreciated as my skills are still quite low in SU but I was able to get it to animate when clicked on and it appears to be in fairly close alignment…maybe someone could check this???
Thanks again for the help I am very grateful.
Now I plan to add couple to my door and make the hinge work when the door is clicked on…we’ll see how the passing down (inheritance eh Dan) of clicks goes.