0 Replies Latest reply on Jan 11, 2016 7:30 PM by Yong Ning

    How to define  feature typename of Fill Pattern?

    Yong Ning

      Private Sub ll()

         Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

            Set SwApp = Application.SldWorks

            Set SwModel = SwApp.ActiveDoc

         Dim SwFeat As Feature

            Set SwFeat = SwModel.FirstFeature

            Do While Not SwFeat Is Nothing

               Debug.Print SwFeat.Name, "→Feature GettypeName→", SwFeat.GetTypeName

               Set SwFeat = SwFeat.GetNextFeature

            Loop

       

      End Sub

       

      Result is → Fill Pattern1 →Feature GettypeName→     APattern

       

       

      5.jpg

       

       

       

      6.jpg

       

       

      Question, How to define p typename???

       

      Dim p As LocalLinearPatternFeatureData  ' As LocalCircularPatternFeatureData  'FlatPatternFeatureData

            Set p = SwSelMgr.GetSelectedObject5(1)

       

      Private Sub ll()

         Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

            Set SwApp = Application.SldWorks

            Set SwModel = SwApp.ActiveDoc

         Dim SwSelMgr As SelectionMgr

            Set SwSelMgr = SwModel.SelectionManager

         Dim p As LocalLinearPatternFeatureData  ' As LocalCircularPatternFeatureData  'FlatPatternFeatureData

            Set p = SwSelMgr.GetSelectedObject5(1)

            ''???????

            Stop

       

      End Sub

       

      Any Method to get Number of Holes. | SOLIDWORKS Forums

      https://forum.solidworks.com/message/240997#240997

       

       

      How to get the Fill Pattern’s Count? | SOLIDWORKS Forums

      https://forum.solidworks.com/message/367518#367518

       

       

      2014 SOLIDWORKS API Help - Create Fill Pattern Example (VBA)

      http://help.solidworks.com/2014/english/api/sldworksapi/create_fill_pattern_example_vb.htm

       

       

      help.solidworks.com/SearchEx.aspx?q=IFillPatternFeatureData&sort=&version=2016&lang=english&prod=api

      http://help.solidworks.com/SearchEx.aspx?q=IFillPatternFeatureData&sort=&version=2016&lang=english&prod=api