sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Don't DC to rotate even if parent component does

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    5 Posts 3 Posters 1.4k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DavidBoulderD Offline
      DavidBoulder
      last edited by

      I have two children DC's that I want to always keep their orientation. So if someone rotates the model, I want my DC's to snap back to their original orientation. Kind of like face me, but instead of being tied to the camera, I want them tied to the model orientation.

      Has anyone done this before?

      --

      David Goldwasser
      OpenStudio Developer
      National Renewable Energy Laboratory

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        Maybe something like this would work?

        RotX: =-parent!RotX RotY: =-parent!RotY RotZ: =-parent!RotX

        Hi

        1 Reply Last reply Reply Quote 0
        • Chris FullmerC Offline
          Chris Fullmer
          last edited by

          If their axis is not aligned to the parent's axis though, it is also going to require computing x,y,z values. Rotating the parent will change their rotation AND their location.

          Lately you've been tan, suspicious for the winter.
          All my Plugins I've written

          1 Reply Last reply Reply Quote 0
          • DavidBoulderD Offline
            DavidBoulder
            last edited by

            Thanks, that works great, although I'd love an auto-redraw. As is the user has to go back in and change an attribute to do this (or context click/redraw).

            So if I add this component in through a ruby script, can I place an entity observer on it that will redraw it if it is moved rotated (vs. only when the component itself is changed.)

            I need to learn more about observers. If they are global, or tagged to specific entities.

            --

            David Goldwasser
            OpenStudio Developer
            National Renewable Energy Laboratory

            1 Reply Last reply Reply Quote 0
            • DavidBoulderD Offline
              DavidBoulder
              last edited by

              @unknownuser said:

              If their axis is not aligned to the parent's axis though, it is also going to require computing x,y,z values. Rotating the parent will change their rotation AND their location.

              Chris, I missed this as it was just about when I made my last post. I'm not too concerned about the location of the children moving. I am more concerned about keeping the child on the same rotX,rotY,rotZ rotation as the top level model axis; by this I mean rotX,Y,Z all = 0

              So I have two big issue with my setup right now.

              1. First is that this only works if my parent is a top level component/group. If someone places it inside of a group then I lose my bearings. If I know they need it inside a group I can setup a DC group that itself would pass information. So there would be a grandparent/parent/child setup. But I don't want to have to rely on this.

              2. My second problem is that my child can handle rotations on any axis, but it has trouble with more than one. So I'm ok if I change rotX, or rotY, but not rotX & rotY.

              I have attached a file with two instances of my component. One is top level one is inside of the group. So if you select all and rotate, only one will fix itself. And you have to use the interact tool or right click to REDRAW() for it to update.

              OK, I take that back. This is where things get odd. I base my calcualtsion off what I think the parents rotX,Y,Z are based on, and the odd things is a "REDRAW" by clicking on the interact while the parent is nested in a grandparent, doesn't give the same results as when I REDERAW when I have gone into the grandparent.


              rotation problem.skp

              --

              David Goldwasser
              OpenStudio Developer
              National Renewable Energy Laboratory

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement