1 Reply Latest reply on Nov 3, 2014 7:50 AM by Yong Ning

    In Title Block table →Why GetSpecificFeature is nothing???

    Yong Ning

      00.jpg

      '' In Bom, follow code → Set SwBomFeat = SwFeat.GetSpecificFeature → is True

       

      Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

      Dim SwFeat As Feature, Str

      Private Sub ll1()

          Set SwApp = Application.SldWorks

          Set SwModel = SwApp.ActiveDoc

          Str = "Bill Of Materials3"

          Set SwFeat = SwModel.FeatureByName(Str)

        Dim SwBomFeat As BomFeature, SwAnn As TableAnnotation, Tmp

          Set SwBomFeat = SwFeat.GetSpecificFeature

          Tmp = SwBomFeat.GetTableAnnotations

          Set SwAnn = Tmp(0)

          With SwAnn

             Debug.Print .Title, .RowCount, .ColumnCount

          End With

       

      End Sub

      ********************************

      Question

       

       

      01.jpg

       

      Set SwTitleFeat = SwFeat.GetSpecificFeature → is Nothing ??????????????

       

      Private Sub ll2()

          Set SwApp = Application.SldWorks

          Set SwModel = SwApp.ActiveDoc

          Str = "Title Block Table2"

          Set SwFeat = SwModel.FeatureByName(Str)

        Dim SwTitleFeat As TitleBlockTableFeature, SwAnn As TableAnnotation, Tmp

          Set SwTitleFeat = SwFeat.GetSpecificFeature

          Tmp = SwTitleFeat.GetTableAnnotations

          Set SwAnn = Tmp(0)

          With SwAnn

             Debug.Print .Title, .RowCount, .ColumnCount

          End With

      End Sub

       

      Why ??

       

      Set SwTitleFeat = SwFeat.GetSpecificFeature → is Nothing

        • Re: In Title Block table →Why GetSpecificFeature is nothing???
          Yong Ning

          Why → TitleBlk.TitleBlockTableFeature.GetFeature → result is  true

              Set SwFeat = TitleBlk.TitleBlockTableFeature.GetFeature

           

          ***************************

          Private Sub ll3()

              Set SwApp = Application.SldWorks

              Set SwModel = SwApp.ActiveDoc

            Dim SwSelMgr As SelectionMgr

              Set SwSelMgr = SwModel.SelectionManager

            Dim TitleBlk As TitleBlockTableAnnotation, Tmp

              Set TitleBlk = SwSelMgr.GetSelectedObject6(1, 0)

            Dim SwFeat As Feature

              Set SwFeat = TitleBlk.TitleBlockTableFeature.GetFeature

              Debug.Print SwFeat.Name

              Stop

              Tmp = TitleBlk.TitleBlockTableFeature.GetTableAnnotations

              Set SwAnn = Tmp(0)

              With SwAnn

                 Debug.Print .Title, .RowCount, .ColumnCount

              End With

           

          End Sub