4 Replies Latest reply on Oct 1, 2013 7:46 AM by Jacob Corder

    Help Needed, I Need to add fillets to a temporary Body which is revolved.

    Jacob Corder

      I am in the final stages of releasing my massive Solidworks Addin. I have 1 more thing to address, Adding Fillets or the appearance of a fillet to a temporary body using Modeler

       

      See attached images for description.

      the yellow Body is a temporay body i am using for a preview much like solidworks hole wizard does.

      The Feature to the left is a body2.BodyOperatons2 body cut done using macrofeatures. as you can see on this feature, not the yellow Body, that there are 2 gray fillets added. i added these manually for display purposes.

       

      I am using the data from the Edge that is used in the feature fillet.

      which gives me the axis for a revolved surface or to create a torodial surface.

       

      i have the information i need to create fillets but i dont know the exact route.

       

      I cannot use any featuremanager functions, only Modeler functions will work here along with Curve and surface trimming. i am creating The Temporary body from Modeler.CreateBodyFromCone and Modeler.CreateBodyFrom Cylinder.   Once i learn CreateBREPBody ill be using that.

       

      Body2.AddConstantFillets Does not work as this is a temporary ("SHEET") body

       

      3 options i can see are as follows

       

      CreateBREPBody3, Cant quite get it figured out.

       

      2 Methods of creating the Torodial/Arc Revoloved Surface

       

      Modeler.CreateTorodialSurface

      Trim The Surface to the two adjacent faces to the edge to be filleted

      Create a body with the 2 adjacent faces from the Edge to be filleted

       

       

      Modeler.CreateArc

      Modeler.CreateLine x 2

      Revolve these 3 Items with Modeler.CreateRevolutionSurface "Which is in the api but not in the API Help"

      Then add the filleted body to my tool body

       

      Any other route ideas would be awesome. I have been building this addin for almost 1 year now and i need to get it released.

       

      Thanks for your help.

       

       

      Below is an overview of what this application does, its not relevent to this question.

       

      I have all the data for all of our machine shop tooling in a SQL Database.

       

      This Program passes information to FeatureManager.CreateMacrofeature3

       

      the COMServer recieves the new feature and creates these temporary bodies which it then does a Operations2 body cut to the body that is to be modified.

      Any time the SQL Database is updated,  all features are immediately updated at the next rebuild.

       

      Tolerances are embeaded in the feature for hole callouts and drawing callouts.

       

      The Features geometry cannot be changed as there are not any sketches, nor dimensions

       

      The system also real time quotes the cost to manufacture the part.

       

      Features can be stacked on eachother and the hole callouts on the drawing are automatically updated.

       

      Features are added in seconds and new ones are found by a form in a new tab in the FeatureManager Tree. Finding the next feature takes seconds.


      Adding New features takes less than a minute.

       

      Any feature can become any feature by a quick replace feature function.

       

      Library components from Enterprise PDM are automaticall found by selecting a feature in the Assembly.

       

      They Can then be dragged onto the feature for auto mating or double clicked and this application automatically mates them.

       

      plus lots of other things i cannot share.

        • Re: Help Needed, I Need to add fillets to a temporary Body which is revolved.
          Artem Taturevych

          IBody2::AddConstantFillets method is applicable for temporary solid bodies. Modeler::CreateBodyFromCone and Modeler::CreateBodyFromCyl returns temporary solid bodies. This method can be used here. Here is the sample which is working fine for me:

           

          Dim swApp As SldWorks.SldWorks

          Dim swModel As SldWorks.ModelDoc2

          Dim swModeler As SldWorks.Modeler

           

          Sub main()

           

              Set swApp = Application.SldWorks

           

              Set swModel = swApp.ActiveDoc

             

              Set swModeler = swApp.GetModeler

             

              Dim dCylParams(7) As Double

              dCylParams(0) = 0: dCylParams(1) = 0: dCylParams(2) = 0

              dCylParams(3) = 0: dCylParams(4) = 0: dCylParams(5) = 1

              dCylParams(6) = 0.1: dCylParams(7) = 0.1

             

              Dim swTempBody As SldWorks.Body2

             

              Set swTempBody = swModeler.CreateBodyFromCyl(dCylParams)

             

              swTempBody.AddConstantFillets 0.01, swTempBody.GetEdges

           

              swTempBody.Display3 swModel, 0, 0

             

              Stop

             

          End Sub

           

          ____________________________________________________

          Regards,

          Artem Taturevych, Application Engineer at Intercad (Australia)

           

          translationXpert – add-in to translate SolidWorks models

          myIntercad an integrated tool for SolidWorks Professionals

          LinkedIn SolidWorks API Education Group

            • Re: Help Needed, I Need to add fillets to a temporary Body which is revolved.
              Jacob Corder

              I tried that before but ill try again. The api help says addconstantfillets does not work on sheet bodies. Is a sheet body and a temporary body not the same? Thanks ill let you know what I come up with.

                • Re: Help Needed, I Need to add fillets to a temporary Body which is revolved.
                  Artem Taturevych

                  There are several different body types by different criteria:

                   

                  1) By geometry:

                  • Solid bodies – bodies which have the volume. For example extruded cube.
                  • Surface (sheet) bodies – bodies which do not have a volume but area only. For example single planar surface
                  • Wire – bodies as a curve. For example helix/spiral. Bodies have length only.
                  • Point body (not supported in SolidWorks).

                   

                  2) By visibility/accessibility

                  • Regular/constant bodies. Bodies which appear in the Feature Tree and serialized/stored with the model. For example body you see after creating the extruded feature
                  • Temporary bodies. The bodies used for modelling or preview purposes. Are only alive while the pointer is alive.

                   

                  3) Etc.

                   

                  The temporary body can be sheet, solid or wire. As well as regular body can be sheet, solid or wire.

                    • Re: Help Needed, I Need to add fillets to a temporary Body which is revolved.
                      Jacob Corder

                      Thanks Artem. Sometimes I think you developed solidworks, you have the answers to everything.

                      So I was doing it incorrectly before. I was getting an edge and passing it to the function. I had to do this to make it work.

                      Tempbody is a temporary body2

                      RadiusInMeters is a double value

                       

                      Dim EdgeObj as object

                      Dim edges(0) as edge

                      Edges(0) = EdgeToFillet

                      Edgeobj =edges

                       

                      Tempbody.addconstantfillets (RadiusinMeters, edgeobj)

                       

                      And boom. I tried this months ago when I was new to programming. Solidworks Api help said it can't be done with that function as the body was a temporary body, so I took their word for it. They even added a note in the api help because of my question. Although I may not have explained it correctly as I had never written any computer code before this solidworks addin.

                       

                      Thanks for the explaination of the bodies also. That clears things up.

                       

                      Im so happy because the alternative would have been horrible.