sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    State of Observers ?

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 311 Views 2 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.
    • O Offline
      oajfh
      last edited by

      Hi all.

      A feature I've been thinking about in a project is synchronising an item in SU with another item in another program.

      Sending information to and from isn't a problem. What I'm curious about is the Observers I should use.

      Since no Observer (as far as I've seen) keeps directly track of entity positions or orientations, one way I could think of that'd enable me to do so would be by combining a Tool Observer (OnButtonUp and OnButtonDown) and an EntityObserver (OnEntityChange), and making sure the right tool is selected. That way I could send a transformation information whenever the user completes a move, scale or rotate action.

      Does this seem like the most natural way to you ? Are there any latent bugs (seems like Observers have had problems in past versions, I can't seem to find more recent information) or potential problems to this approach (I've read up on a few common pitfalls but don't know much more) ?

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        @oajfh said:

        ...Tool Observer (OnButtonUp and OnButtonDown) ...

        There is not a ToolObserver class in the API.

        The onButton.. callbacks are part of the abstract Tool class, not an observer class.

        @oajfh said:

        ... and an EntityObserver (OnEntityChange), ...

        Write a quick test observer and see if it fires when you move an object.

        @oajfh said:

        Does this seem like the most natural way to you ? Are there any latent bugs (seems like Observers have had problems in past versions, I can't seem to find more recent information) or potential problems to this approach (I've read up on a few common pitfalls but don't know much more) ?

        Welcome the foggy world of SketchUp API Dcoumentation. Where nothing is really certain, and all are kept in limbo.

        I'm not here much anymore.

        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