How to get ActiveFamilyMember Name of Part or Assembly

 

HI ,

1. How to get ActiveFamilyMember Name of a Part or an Assembly

opened in SolidEdge?

for assembly, I can getit from the window caption, but not for parts.

2. How to get LastSaved ActiveFamilyMember Name of a Part or an Assembly from revision manager or FileProperties?

With StructuredStorage, I can get info about Assemblies Family Members, but not wich one was active the last save.

Thanks in advance for any info,

Best regards

Massimo

 

Posted by: Massimo Magris
Post date: 3/13/2009 12:16:53 AM

2 REPLIES

RE: How to get ActiveFamilyMember Name of Part or Assembly

HI,

 

is not possible, SE Api does not have this functions.

 

Regards

Massimo

 

Posted by: Massimo Magris
Post date: 3/16/2009 10:38:16 AM

RE: How to get ActiveFamilyMember Name of Part or Assembly

 

Hi,

there is a workaround for Part. It's not a beautiful code because I'm not a programmer but it works me fine.

doc = objapp.ActiveDocument

        families = doc.FamilyMembers

        pocet_variables = doc.FamilyMembers.FamilyVariableCount

        For counter2 = 1 To count_variables

            obj_variable(counter2 - 1) = doc.FamilyMembers.FamilyVariable(counter2)

            value_variable(counter2 - 1) = obj_variable(counter2-1).Value

        Next

        For counter2 = 1 To families.Count

            family = families.Item(counter2)

            family.Apply()

            identity = False

            For counter = 1 To count_variables

                IfNot (value_variable(counter - 1) = family.Variable(counter).Value) Then

                    counter = count_variables

                Else

                    identity = True

                EndIf

            Next

            If identity Then

                ' It's right member FOP

                searching_member = family.Name

                counter2 = families.Count

            EndIf

        Next

Vaclav

 

Posted by: Vaclav Blahnik
Post date: 4/28/2009 10:19:18 PM