• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Section Plane

Scheduled Pinned Locked Moved Developers' Forum
14 Posts 3 Posters 651 Views
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.
  • P Offline
    Pout
    last edited by 17 Sept 2010, 13:17

    From the API:
    ***"The SectionPlane class contains methods to get and set the plane for the SectionPlane in a model. Note that there is no way to get a SectionPlane object using Ruby. You must manually create a section plane with the Section Plane Tool in SketchUp and then query the entities array to find the SectionPlane object. This class was primarily added for compatibility with a third-party software product.

    One workaround that does work: you could create a SketchUp model that contains nothing but a SectionPlane, then import that as a component into whatever model you wish to add a SectionPlane to."***

    But, it's impossible to create a section plane in an empty drawing. Correct?
    What i want to do is:
    Automatically generate a section plane for each group (highest level) or component instance in a model.
    Group that section plane with that group or component instance so the plane only cuts that specific entity.

    A work arround could be: let the user create 1 section plane and copy that.
    But maybe there is a better, more logic way?

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 17 Sept 2010, 13:23

      In TT_Lib I have a wrapper that load a component with a section cut from the subfolder of the library.
      But! There is more problems with sections cuts:
      No way to set or get the active cut.

      SectionCuts = PITA

      Thomas Thomassen β€” SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • P Offline
        Pout
        last edited by 17 Sept 2010, 13:27

        i was just looking into that set/get active cut
        when you make a copy one of them gets set as non-active, so that is not an option.
        I'll have a look into that TT_Lib

        PITA? Like in FUBAR? πŸ˜„

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 17 Sept 2010, 13:57

          Pretty much.

          @pout said:

          i was just looking into that set/get active cut
          when you make a copy one of them gets set as non-active, so that is not an option.
          I'll have a look into that TT_Lib

          My TT_Lib only inserts - no get/set. 😞

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • T Offline
            TIG Moderator
            last edited by 17 Sept 2010, 14:06

            Even if you set the section-plane inside the imported component as active, when you explode the component the section-plane ceases to be active ?

            TIG

            1 Reply Last reply Reply Quote 0
            • T Offline
              thomthom
              last edited by 17 Sept 2010, 14:09

              @tig said:

              Even if you set the section-plane inside the imported component as active, when you explode the component the section-plane ceases to be active ?

              Yes.

              Thomas Thomassen β€” SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • P Offline
                Pout
                last edited by 17 Sept 2010, 14:17

                well there goes my idea of letting a section plane move over a period of time for each individual group/instance 😞
                back to the drawing board!

                1 Reply Last reply Reply Quote 0
                • T Offline
                  thomthom
                  last edited by 17 Sept 2010, 14:21

                  mhm another show stopper... 😞

                  Thomas Thomassen β€” SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

                  1 Reply Last reply Reply Quote 0
                  • P Offline
                    Pout
                    last edited by 28 Nov 2011, 11:27

                    For verification:

                    It is impossible to create a section plane through the ruby API
                    Its is impossible to move (transform!) a section plane through the ruby API
                    It is possible to delete a section plane through the ruby API (erase!)

                    Is this correct?

                    Thx!

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      thomthom
                      last edited by 28 Nov 2011, 11:33

                      Aye, a SectionPlane inherits Sketchup::Drawingelement - so all the methods of Sketchup::Drawingelement and Sketchup::Entity is available.

                      ` Sketchup::SectionPlane.ancestors

                      [Sketchup::SectionPlane, Sketchup::Drawingelement, Sketchup::Entity, Object, Kernel]`

                      The only thing is that you don't get any methods that relates to how a sectioncut function other than being able to get or set the plane.

                      Thomas Thomassen β€” SketchUp Monkey & Coding addict
                      List of my plugins and link to the CookieWare fund

                      1 Reply Last reply Reply Quote 0
                      • P Offline
                        Pout
                        last edited by 28 Nov 2011, 12:17

                        ThomThom,

                        you got me a bit confused now.
                        I seem to be unable to move (translation) a section plane by the blue axis through API.
                        But since it is an entity, i should be able to do it?

                        thx

                        1 Reply Last reply Reply Quote 0
                        • P Offline
                          Pout
                          last edited by 28 Nov 2011, 12:25

                          ok, a bit in shame I confees that I can move a section plane but only by certain axis.
                          I do have to do it like this though:

                          ent=Sketchup.active_model.selection[0] # a sketchup section plane
                          vector = Geom;;Vector3d.new 0,0,-3
                          t = Geom;;Transformation.translation vector
                          Sketchup.active_model.entities.transform_entities(t,ent)
                          

                          ent.transform! or ent.transformation does not work

                          Now, let's say i have 2 groups, each with a section plane in them.
                          First one i want to move -3 over z-axis, the other one -1 over z-axis.
                          This can be done?

                          But auto-creation of a section plane for (and in) each group is not possible i suppose

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            thomthom
                            last edited by 28 Nov 2011, 12:38

                            @pout said:

                            ent.transform! or ent.transformation does not work

                            ent.transform! and ent.transformation is not part of Sketchup::Entity or Sketchup::Drawingelement. They are part of Sketchup::Group and Sketchup::ComponentInstance.

                            @pout said:

                            Now, let's say i have 2 groups, each with a section plane in them.
                            First one i want to move -3 over z-axis, the other one -1 over z-axis.
                            This can be done?

                            Entities.transform_by_vectors
                            http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#transform_by_vectors

                            @pout said:

                            But auto-creation of a section plane for (and in) each group is not possible i suppose

                            "Auto-creation"?
                            You can only add a section plant to a model by inserting a component with a section plane and then exploding the inserted instance. Bit of a hack. But you won't be able to activate it.

                            Thomas Thomassen β€” SketchUp Monkey & Coding addict
                            List of my plugins and link to the CookieWare fund

                            1 Reply Last reply Reply Quote 0
                            • P Offline
                              Pout
                              last edited by 28 Nov 2011, 12:53

                              ThomThom, thx for the answers!

                              With auto-creation I mean this:
                              The creation through ruby of a section plane in each of the 20 groups that are in the model.

                              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