3 Replies Latest reply on Jan 21, 2010 12:09 AM by M. PremKumar

    Feature recognize

    M. PremKumar



      I need Solution that how to generate fwAutomaticRecognitionOptions while importing parasolid file...using api



      Thanks & regards



        • Re: Feature recognize
          Deepak Gupta

          You must have SW professional to get this working.


          Recognizing Features Automatically (VB6) example from API help


          Sub main()

          Dim swApp As Object

          Dim sample As Object

          Dim Part As Object

          Dim boolstatus As Boolean

          Dim inp As Boolean


          Dim str1 As String

          ' Get the SolidWorks object

          Set swApp = CreateObject("SldWorks.Application")


          ' CLSID of FeatureWorks : 16B0AE50-0817-11d7-A7F8-0006299907FB

          ' Get the FeatureWorks object

          Set sample = swApp.GetAddInObject("FeatureWorks.FeatureWorksApp")


          Dim varOut As Variant

          Dim var1 As Boolean

          Dim unused As Integer

          Dim options As Long


          unused = 0

          Dim str1 As String

          ' Get the SolidWorks part document

          Set Part = swApp.ActiveDoc

          ' Select the faces to fillet

          boolstatus = Part.Extension.SelectByID("", "FACE", 0.1023433561252, 0.06999999999994, 0.05499949188089, False, 8, Nothing)


          ' Turn on the specified automatic feature recognition options

          option = fwChamfils + fwExtrudeOption

          varOut = sample.RecognizeFeatureAutomatic(option )


          ' Create the recognized features

          createOption = fwAllowFailFeatureCreation 'Option to allow creation of features with reubild errors

          var1 = sample.CreateFeatures(createOption)

          End Sub



            • Re: Feature recognize
              M. PremKumar

              Hi Deepak ,


              Thanks For Your Reply...Currently i m using SW Premium .Is there any diff in SW Pre and SW Pro...?


              And i already used this code ....but not working.... for feature work addins ,is there ref. to be added?


              Set sample = swApp.GetAddInObject("FeatureWorks.FeatureWorksApp") ..............object not called


              Thanks and Regards


                • Re: Feature recognize
                  Deepak Gupta
                  You should have at least Pro version to have feature Works but as as you have Premium version you have all the add in which are available with pro version. I haven't checked and not sure but have the FeatureWorks added in via Tools > Add Ins before running this macro. Check if that makes a difference.