sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Determining Corner Points

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 665 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.
    • medeekM Offline
      medeek
      last edited by

      I've been thinking about adding an edit feature into the Truss Plugin so that a user can click on a truss or roof assembly and edit all of the parameters rather than having to delete and recreate the geometry with the plugin.

      The only problem I am having with this is I need to some how store or retrieve the corner points that were originally selected when the truss assembly was created. This is normally pretty simple except what if the user creates the truss assembly and then later moves it to a new location. Now if they go back and edit the truss assembly within the plugin the assembly will be recreated at the original points and not at the new location.

      Any ideas on how to deal with this?

      Nathaniel P. Wilkerson PE
      Medeek Engineering Inc
      design.medeek.com

      1 Reply Last reply Reply Quote 0
      • sdmitchS Offline
        sdmitch
        last edited by

        Perhaps by creating an attribute record when the truss is created.

        truss.add_attribute("This Truss Type","First Point",pt1)
        truss.add_attribute("This Truss Type","Second Point",pt2)

        Then you can retrieve the creation data using

        pt1=truss.get_attribute("This Truss Type","First Point")

        Nothing is worthless, it can always be used as a bad example.

        http://sdmitch.blogspot.com/

        1 Reply Last reply Reply Quote 0
        • medeekM Offline
          medeek
          last edited by

          This had occurred to me but the problem arises when the assembly (group) is then moved or rotated to a new position post creation. The stored points are no longer valid. I need some way of accessing their absolute positions regardless of how to truss assembly is moved.

          Nathaniel P. Wilkerson PE
          Medeek Engineering Inc
          design.medeek.com

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            Are the original pt1 and pt2 created in the model.active_entities context ?
            If pt1 is always the ORIGIN then you really only need pt2 ?
            Why not use a transformation ?
            You can store the initial truss.transformation.to_a as an attribute with the truss.
            Then... when you next need to assess the current truss location/rotation just get the current truss.transformation and then modify [transform!] it OR even the saved point [or 2 points] - having adjusted it by the transformation that was stored as it was created - recreated from the attribute array back into a transformation.
            http://www.sketchup.com/intl/en/developer/docs/ourdoc/transformation

            TIG

            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