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

    Polygon Positioning Tool

    Scheduled Pinned Locked Moved Developers' Forum
    13 Posts 4 Posters 1.8k Views 4 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.
    • sdmitchS Offline
      sdmitch
      last edited by

      @medeek said:

      I've got the polygon positioning tool mostly worked out for my foundation plugin. However, when the user enters in a value for the length of the segment (VCB_VALUE) then the subsequent line selection does not properly infer the X and Y axis.

      There are two problems as I see it.

      1. You are using @ip1 and @ip to set the line color but, when you enter a length, @ip1 is no longer valid since the point it represents has changed. I think you should use the last to values of the @pts array to set the color.

      2. Expecting the user to get within 0.0001 of the first point to close is way to restrictive.

      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

        I replace the set color line with:

        view.set_color_from_line(@pts[@lastpointcount], @pts[@pointcount])

        however the behavior is identical.

        I agree the .0001 is probably too restrictive. What I should probably do is insert a temporary guide point (add_cpoint) and then delete it once I jump back to my main program out of the tool or as the tool terminates. This way the user has something to snap to in order to close out the polygon.

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

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

          @medeek said:

          I replace the set color line with:

          view.set_color_from_line(@pts[@lastpointcount], @pts[@pointcount])

          however the behavior is identical.

          I too find it odd that entering a length suddenly causes the axis inference to change its' behavior. The tooltip seems to think that @ip1 is still valid while, if you zoom in and move the mouse very slowly, the correct inference will occur. After that everything is back to normal until the next length entry.

          Very strange indeed and an obvious bug in Sketchup.

          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

            Yes it is strange. If you enter a value then the next line won't infer the axis, but if you then click the mouse and begin another line the inference returns to normal. The whole tool thing is still somewhat of a black box to me so I don't really understand it fully but this certainly has me confounded.

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

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

              Nat, use 2 space characters for indents. Tabs will not come out well in the forum code blocks.

              I'm not here much anymore.

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

                I've been using tabs for indents since 1999, getting me to change now is not easy. You can probably tell that I like a lot of whitespace in my code, easier to read.

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

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

                  That is okay (whitespace). I use Notepad++ which automatically replaces TAB with spaces. Each language can have a different indent spacing. (I'd think most editors can [or should] do this.)

                  I'm not here much anymore.

                  1 Reply Last reply Reply Quote 0
                  • G Offline
                    Garry K
                    last edited by

                    I totally agree. I use Notepad++ as well and I do not use tabs.

                    The main reason is everyone can set their tabs differently - but spaces are spaces so the reader gets to see what you want them to see.

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

                      I tried Notepad++ a couple years ago but something about it perturbed me so I went back to my basic Windows Notepad, I may revisit it.

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

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

                        @medeek said:

                        ... so I went back to my basic Windows Notepad, ...

                        How do you know what encoding it saves the file it ?
                        How do you know what type of line ending characters it uses ?

                        These are things easily set with a real code editor.

                        In addition code editors use color lexing to help you spell keywords correctly, match up the begins and ends of code blocks, etc. They also can use autocomplete features to help fillout method calls.

                        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