How does Frame Generator identify members?

How does Frame Generator identify members?

JhoelForshav
Mentor Mentor
1,909 Views
13 Replies
Message 1 of 14

How does Frame Generator identify members?

JhoelForshav
Mentor
Mentor

Hi,

I wonder which property whithin the part frame generator uses to identify this value? When you click "Change" in the Design-tab and select a component the current size gets pre-selected.

 

FrameGeneratorSIZE.PNG

 

I've tried changing PropertySets.Item("Content Library Component Properties").Item("MemberId") but it has no effect on the pre-selection.

0 Likes
Accepted solutions (1)
1,910 Views
13 Replies
Replies (13)
Message 2 of 14

bradeneuropeArthur
Mentor
Mentor

Hi,

 

For these files inventor uses additional property sets with properties!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 14

JhoelForshav
Mentor
Mentor

Hi @bradeneuropeArthur

I thought that might be the case...

Are you sure there's no way to access them through API?

0 Likes
Message 4 of 14

bradeneuropeArthur
Mentor
Mentor

yes you can.

By searching for the Property:

Design Tracking Properties >>  Size Designation  = *****

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 14

JhoelForshav
Mentor
Mentor

My code to change a frame member identifies the selected occurrences family and member id, then lets you select a new member id from that family. Then it changes all the mapped parameters and properties according to the family table to those of the new member id. So I already change the size designation property. This has no effect on the pre-selected size in the change command 😞

0 Likes
Message 6 of 14

JhoelForshav
Mentor
Mentor

I believe it has something to do with this:

section designation.PNG

ContentTableColumn.HasPropertyMap returns false for my column with internal name SIZE however.

I cant find "Section Designation" in any propertyset in the document. The closest I've gotten to find anything that seems to have something to do with this is the property "Categories" in Design Tracking Properties. I copied this property value (a very long string) from one occurence of size "UPE 100" to one of size "UPE 300". Still no result...

Message 7 of 14

bradeneuropeArthur
Mentor
Mentor

Try it this way, I am searching too!

 

Design Tracking Properties >> Categories	 ConstantValue="THIS SCHOULD BE YOUR VALUE><ParamToTemplate CategoryParameter="//CategoryParameter[@InternalName='****************']" ConstantValue="3"/><ParamToTemplate 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 8 of 14

bradeneuropeArthur
Mentor
Mentor

You are searching in the same direction!

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 9 of 14

bradeneuropeArthur
Mentor
Mentor

It could be possible that the name is from the Content Center Family table via the internal property within the file.

You could test it to disable the Content Center from using...

if the result is empty then, then this is a value that is populated from the table and not form the file it selves.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 10 of 14

JhoelForshav
Mentor
Mentor

This is very intetesting!

I did as you said. Created a new project file with no library included and opened the file from there. This resulted in this:

bild1.PNGbild2.PNG

When selecting the change command the list does not populate at all. Then when i select the frame member I get the Size designation as Size. Category, Standard and Family are also auto filled after the member is selected. I selected a member that has already been changed by my code.

 

So now it in fact is the size designation.. However the size designation contains " -0,001" . According to my family table that is correct.

bild3.PNG

But when a member is changed or placed with content center the value in the list does not contain this "0,001".

Also then i think the value comes from the key-column "Variety" with internal name "SIZE". So in other words it is not the size designation in that case.

 

This is some confusing stuff...

Message 11 of 14

JhoelForshav
Mentor
Mentor

If I place a member via Frame Generator and then suppress that members row in the family table it is Design Tracking Properties -> Size Designation that controls the name of the member in the dropdown list when i try to change it with Frame Generator... If it does exist in content center however I get the name from here:

section designation.PNG

Somewhere in the partdocument the information about which row to read the SIZE from must exist...

I thoght it should be "Content Library Component Properties" -> "MemberID" but it's not...

0 Likes
Message 12 of 14

JhoelForshav
Mentor
Mentor

OK... So i tried placing two different members of different sizes. Then selected one of them -> component -> replace, and selected the other one. After that chose it with the change command. To my surprise the old size value (from the component i replaced) was pre selected. This must mean that the information is not stored in the parts after all.

 

Maybe it's stored somewhere in the Frame assembly or in the Frame Reference Model...

0 Likes
Message 13 of 14

bradeneuropeArthur
Mentor
Mentor
Accepted solution

Maybe these are stored in attributes!

You could check if there are attributes defined!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 14 of 14

JhoelForshav
Mentor
Mentor

Hi @bradeneuropeArthur 

 

I found an attribute for the specific path in the skeleton in the frame members document.

Then in the frame assembly i found an attribute describing the members in the frame with skeleton path, family and family row! With this code i could match the skeleton path from the specific frame member to the section of the assemblies attribute describing that member. Replacing the row number for the member in the assemblys attribute did the trick.

 

The code could use a bit of cleaning, but at least it works now 🙂

 

Imports Inventor
Public Class Form1
    Dim invApp As Inventor.Application = GetObject(, "Inventor.Application")
    Dim oDoc As AssemblyDocument = invApp.ActiveDocument
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        CustomMember_ChangeRow()
    End Sub

    Sub CustomMember_ChangeRow()

        Dim i As Integer

        Dim oAsmDoc As AssemblyDocument
        oAsmDoc = invApp.ActiveDocument
        Dim oAsmDef As AssemblyComponentDefinition
        oAsmDef = oAsmDoc.ComponentDefinition
        Dim oOcc As ComponentOccurrence
        oOcc = invApp.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "välj balk")
        Dim oDef As PartComponentDefinition
        oDef = oOcc.Definition

        If oDef.IsContentMember Then
            MsgBox("this sample works with the custom CC member only")
            Exit Sub
        Else
            Debug.Print("It's a Custom CC member")
        End If

        Dim oDoc As PartDocument
        oDoc = oDef.Document

        Dim oProps As PropertySet
        oProps = oDoc.PropertySets.Item("Content Library Component Properties")

        Dim oProp As Inventor.Property
        oProp = oProps.Item("FamilyId")
        Dim FamilyId As String
        FamilyId = oProp.Value
        Dim oContentCenter As ContentCenter
        oContentCenter = invApp.ContentCenter
        Dim oFamily As ContentFamily
        oFamily = oContentCenter.GetContentObject("v3#" + FamilyId + "#")
        oProp = oProps.Item("MemberId")
        Dim MemberId As String
        MemberId = oProp.Value
        Dim newRow As Integer



        newRow = InputBox("Current Family row is " & MemberId _
            & vbNewLine & vbNewLine & "New Family row:",
            "New Family Row:", MemberId)

        Dim oRow As ContentTableRow
        oRow = oFamily.TableRows.Item(newRow)
        Dim nCol As Integer
        Dim oColumn As ContentTableColumn

        Dim oPar As UserParameter
        Dim oCustomProps As PropertySet = oDoc.PropertySets.Item("Inventor User Defined Properties")

        For Each oPar In oDef.Parameters.UserParameters

            If oPar.DrivenBy.Count = 0 Then

                nCol = -1
                For i = 1 To oFamily.TableColumns.Count
                    If oFamily.TableColumns.Item(i).InternalName = oPar.Name Then
                        nCol = i
                        Exit For
                    End If
                Next
                If nCol <> -1 Then


                    oColumn = oFamily.TableColumns.Item(nCol)

                    If oColumn.KeyColumnOrder > 0 Then

                    Else
                        Dim units As String
                        units = oColumn.Units

                        Dim oCell As ContentTableCell
                        oCell = oRow.Item(nCol)

                        Dim value As String
                        value = oCell.Value & " " & units

                        oPar.Expression = value


                        Try
                            oCustomProps.Item(oPar.Name).Value = value
                        Catch ex As Exception

                        End Try
                    End If
                End If

            End If

        Next

        oProp = oProps.Item("MemberId")
        oProp.Value = newRow
        oProp = oProps.Item("Member Revision")
        oProp.Value = CreateGuid()


        For i = 1 To oFamily.TableColumns.Count
            oColumn = oFamily.TableColumns.Item(i)
            If oColumn.HasPropertyMap = True Then
                Dim setid As String = String.Empty
                Dim propid As String = String.Empty
                Dim units As String
                units = oColumn.Units

                Try
                    If oColumn.InternalName <> "PARTNUMBER" Then
                        oColumn.GetPropertyMap(setid, propid)
                        Dim oExpression As String = oColumn.Expression
                        oExpression = Replace(Replace(oExpression, "&", ""), Chr(34), "")
                        Dim inS As String = oExpression
                        Dim oColl As New Collection

                        Dim s As String
                        Dim j As Integer, k As Integer
                        Do
                            j = InStr(1, inS, "{")
                            k = InStr(1, inS, "}")
                            If (j = 0) Or (k = 0) Then Exit Do
                            s = Mid$(inS, j + 1, k - j - 1)
                            If s <> "" Then
                                Call oColl.Add(s)
                                inS = Mid$(inS, k + 1, Len(inS))
                            End If
                        Loop Until s = ""

                        Dim ss As Object
                        For Each ss In oColl
                            Try
                                Dim oParam As UserParameter
                                Try
                                    oParam = oDef.Parameters.UserParameters.Item(ss)
                                    s = oParam.Expression
                                    Debug.Print(s)
                                    s = Microsoft.VisualBasic.Left$(s, InStr(s, " ") - 1)
                                    Debug.Print(s)
                                Catch
                                    s = ""
                                    For colIndex = 1 To oFamily.TableColumns.Count
                                        If oFamily.TableColumns.Item(colIndex).InternalName = ss Then
                                            s = oRow.Item(colIndex).Value
                                            Exit For
                                        End If
                                    Next

                                    Debug.Print(s)
                                End Try
                            Catch
                            End Try
                            oExpression = Replace$(oExpression, "{" & ss & "}", s)
                        Next

                        Try
                            oDoc.PropertySets.Item(setid).ItemByPropId(propid).Value = oExpression &
                                If(units IsNot Nothing, " " & units, Nothing)
                        Catch
                            oDoc.PropertySets.Item(setid).Item(propid).Value = oExpression &
                                If(units IsNot Nothing, " " & units, Nothing)
                        End Try

                    End If

                Catch
                    MsgBox("Failed to update: " & oColumn.InternalName)
                End Try
            End If

        Next

        ChangeAttributes(oOcc, newRow, FamilyId, GetPathID(oOcc))

        oDoc.Update()
        oDoc.Save()

        oAsmDoc.Update()
        oAsmDoc.Rebuild2()
        Beep()
    End Sub

    Function GetPathID(oOcc As ComponentOccurrence) As String
        Dim oDef As PartComponentDefinition = oOcc.Definition
        Dim oDoc As PartDocument = oDef.Document

        Dim FGPaths As String = oDoc.AttributeManager.FindAttributes("com.autodesk.FG*", "Paths", "*").Item(1).Value
        Return FGPaths.Split("""")(1)
    End Function
    Sub ChangeAttributes(oOcc As ComponentOccurrence, newRow As Integer, FamilyID As String, oPath As String)
        Dim oParent = oOcc.ContainingOccurrence
        While True

            Dim AttributesEnum As AttributesEnumerator = oParent.Definition.Document.AttributeManager.FindAttributes("com.autodesk.FG*", "Frame.Skeletons", "*")

            If AttributesEnum.Count > 0 Then
                Dim oS As String = AttributesEnum.Item(1).Value
                Dim StartIndex As Integer = oS.IndexOf(oPath)
                Dim oNewContent As Integer = oS.IndexOf("MonikerForNewContent", StartIndex)
                Dim oNumber As Integer = oS.IndexOf(FamilyID, oNewContent)
                Dim oMember As Integer = oS.IndexOf("#", oNumber) + 1
                Dim oIntegers As Integer = 1
                While True
                    If IsNumeric(oS(oMember + oIntegers)) Then
                        oIntegers += 1
                    Else
                        Exit While
                    End If
                End While
                oS = oS.Substring(0, oMember) & newRow & oS.Substring(oMember + oIntegers)
                oNewContent = oS.IndexOf("MonikerForCC", StartIndex)
                oNumber = oS.IndexOf(FamilyID, oNewContent)
                oMember = oS.IndexOf("#", oNumber) + 1
                oIntegers = 1

                While True
                    If IsNumeric(oS(oMember + oIntegers)) Then
                        oIntegers += 1
                    Else
                        Exit While
                    End If
                End While
                oS = oS.Substring(0, oMember) & newRow & oS.Substring(oMember + oIntegers)

                AttributesEnum.Item(1).Value = oS
                Exit While
            Else
                Try
                    oParent = oParent.ContainingOccurrence
                Catch
                    MsgBox("Error")
                    Exit While
                End Try
            End If
        End While
    End Sub

    Private Function CreateGuid()
        ' Returns a unique Guid on every call. Removes any cruft.
        ' https://msdn.microsoft.com/en-us/subscriptions/sh9ete15(v=vs.84).aspx
        ' http://stackoverflow.com/questions/968756/how-to-generate-a-guid-in-vbscript
        CreateGuid = Mid$(CreateObject("Scriptlet.TypeLib").GUID, 2, 36)
    End Function

End Class