4 Replies Latest reply on Feb 8, 2018 7:27 AM by Nilesh Patel

    Has anyone used ISkechSegment::SplitEntity method

    Nilesh Patel

      Hi All,

       

      I would like to splint the sketch entity (e.g. line or arc) in the middle and I am planning to use ISketchSegment::SplitEntity method which has 6 parameters as per the screenshot below.

      I understand first three parameters which are the co-ordinates of the point where you want to split the sketch entity but I am struggling to understand last three parameters. I have tried "0" as last three parameters but it doesn't work. There is no example provided in the API help.

       

      Any help would be appreciated.

       

      Thanks in advance.

       

      Regards,

      Nilesh

        • Re: Has anyone used ISkechSegment::SplitEntity method
          Jacob Corder

          Try -1 -1 -1

          Or the same values as x y z.

          I don't know as you pointed out there is no example. So let us know what you find out.

           

          What I would do is record a macro. And see what the macro says.

            • Re: Has anyone used ISkechSegment::SplitEntity method
              Nilesh Patel

              Hi Jacob,

               

              The recorded macro uses IModelDoc2::SplitOpenSegment which is obsolete now and ISketchManager::SplitOpenSegment is the latest method.

               

              I am using this method in one of my macro which splits all arcs in the middle from the selected sketch which radius is bigger than user specified value. I have attached a part and a macro. You an see in the part that I have 4 arcs which has radius of 15 mm. I have 'IF' condition to check whether the arc radius is bigger than user value.  If I run the macro and specify the value of 15 into input box, it should not process any arcs but some reason it splits 3 of the arcs. It also prints both values into immediate window. Both values are same (which means arc radius is not greater) but still 'IF' statement returns true. If you change any dimension of the sketch, the macro behaves differently. Not sure whether I have made any mistake in the macro or this is a bug. I would like to use ISkechSegment::SplitEntity method to see if that gives me different results. I guess i won't make any difference because "IF' condition returns true and it will split the arc.

               

              If you have a time, play with the macro and let me know how it behaves for you.

               

              Thanks for the response.

               

              Regards,

              Nilesh

              • Re: Has anyone used ISkechSegment::SplitEntity method
                Nilesh Patel

                Figured out that you can specify either  -1 or 0 as last three parameters and it will work. But the arc needs to be selected first. I was not selecting the arc previously.

                 

                Even if I use ISkechSegment::SplitEntity, the macro still behaves strangely.