6 Replies Latest reply on Mar 23, 2016 4:42 PM by Dave Paul

    Can a "macro feature" be a constructed note?

    Dave Paul

      Is it possible for a "macro feature" to be a note that has calculated and constructed text?

       

      Dave

        • Re: Can a "macro feature" be a constructed note?
          Artem Taturevych

          Macro feature cannot behave as the note (you can have dimension with macro feature but not note). What you can do however is to create/update notes from within the regenerate method of your feature. You may associate your note either through macro feature selection or persist id stored in macro feature parameters.

            • Re: Can a "macro feature" be a constructed note?
              Dave Paul

              Thank you for your ideas.  Let me give these a try.

              • Re: Can a "macro feature" be a constructed note?
                Dave Paul

                OK, the persistent ID's seem to be the direction that will work the best.  Thank you for that idea.

                I am needing some help with re-selecting the objects with the persist id's.  I have collected the ID's, saved them to a file, read the ID's from the file, and I'm having an issue adding the objects to a selection set.

                 

                  swModel.ClearSelection2 True
                
                  intIndex = 1
                  Do While Not EOF(1)    ' Loop until end of file.
                    ReDim Preserve strFeatureData(intIndex - 1) As String
                    Input #intFileNumber, GetPersistID
                    strFeatureData(intIndex - 1) = GetPersistID
                    intIndex = intIndex + 1
                  Loop
                  Close #intFileNumber
                  
                  ReDim swObj(UBound(strFeatureData)) As Object
                  For i = 0 To UBound(strFeatureData)
                    strIDData = Split(strFeatureData(i), "|")
                    Set swObj(i) = GetObjectFromString(swApp, swModel, strIDData(1))
                  Next i
                

                 

                The swObj(i) is set to the correct object, but I do not know how to save that object and create a selection set that includes all the other objects.

                  • Re: Can a "macro feature" be a constructed note?
                    Artem Taturevych

                    I missed your question, sorry. Are you asking of how to select those objects or how to store them in a file rather than external file? If the later one you can use a 3rd party storage or macro feature parameters to store the data internally in the SolidWorks file.

                      • Re: Can a "macro feature" be a constructed note?
                        Dave Paul

                        Sorry for the confusion.  I have read the persist id's back from a file.  Using the persist id's, how do I select the objects and add them to a selection set?  I could have one id and I could have a bunch, so I need a loop.

                          • Re: Can a "macro feature" be a constructed note?
                            Dave Paul

                            I got it.  Used the AddSelectionListObject method.

                             

                              For i = 0 To UBound(strFeatureData)
                                strIDData = Split(strFeatureData(i), "|")
                                Set swSelObj = Nothing
                                Set swSelObj = GetObjectFromString(swApp, swModel, strIDData(1))
                                If Not swSelObj Is Nothing Then
                                  If strIDData(0) = swSelBODYFEATURES Then
                                    Set swFeat = swSelObj
                                    swSelMgr.AddSelectionListObject swFeat, swSelMgr
                                  End If
                                  If strIDData(0) = swSelNOTES Then
                                    Set swNote = swSelObj
                                    swSelMgr.AddSelectionListObject swNote, swSelMgr
                                  End If
                                End If
                              Next i