Content Center - Family Table - Custom Column Not Working - iLogic

Content Center - Family Table - Custom Column Not Working - iLogic

willAM42F
Contributor Contributor
807 Views
23 Replies
Message 1 of 24

Content Center - Family Table - Custom Column Not Working - iLogic

willAM42F
Contributor
Contributor

Hi there,

 

The company I work for is switching to a new ERP system and is applying a new company part number to all materials and items used in our designs. Previously, the part number had a loose format. For this change, I've been tasked with applying this unique, sequential part number to every row of every family in the custom Content Center libraries that we have. Between the number of families we use and the variety of materials we use in each family, there are almost 700 families that need to have this unique part number added to them. This task would be cumbersome, time consuming, and prone to error if I was to do it manually for each family.

 

The two questions I have are:

- What's the fastest way that you can think to do this (iLogic, automation, custom column, etc.)?

- I've been trying to use the Custom Column feature in the Column Properties of the Family Table to create a sequential list of numbers in a column without success. I haven't gotten it to generate a sequential list. It usually creates a single value equal to the Default value. What am I doing wrong?

 

I'm running Inventor 2024.3.3 on Windows 11.

 

Thanks in advance for any help you're able & willing to provide!

0 Likes
Accepted solutions (1)
808 Views
23 Replies
Replies (23)
Message 2 of 24

Michael.Navara
Advisor
Advisor

Hi @willAM42F 

This part of API is very poorly documented. Most of objects are hidden and not for public use and you can use it at your own risk. 

 

But to your question. Here are few methods which can be handy.

At first, you need to know which families you want to edit. You can print its name and internal name to the iLogic log window.

Sub Main()
    PrintFamilies(ThisApplication.ContentCenter.TreeViewTopNode, 0)
End Sub

Sub PrintFamilies(node As ContentTreeViewNode, indent As Integer)
    Dim indentString = New String(" ", indent * 3)
    Logger.Debug("{0}{1} [{1}]", indentString, node.DisplayName, node.InternalName)
    For Each contentFamily As ContentFamily In node.Families
        Logger.Debug("{0} {1} [{2}]", indentString, contentFamily.DisplayName, contentFamily.InternalName)
    Next

    For Each childNode As ContentTreeViewNode In node.ChildNodes
        PrintFamilies(childNode, indent + 1)
    Next
End Sub

 

If you have the internal name of the family, you can create custom column with sequential numbers in it.

At first you need to get ContentFamily by its internal name.

Function GetFamilyByInternalName(node As ContentTreeViewNode, internalName As String) As ContentFamily

    'Look for family in current node
    For Each contentFamily As ContentFamily In node.Families
        If contentFamily.InternalName = internalName Then Return contentFamily
    Next

    'Recursively look in child nodes
    For Each childNode As ContentTreeViewNode In node.ChildNodes
        Return GetFamilyByInternalName(childNode, internalName)
    Next
    Return Nothing
End Function

 

Then you can add the new column with numbers. Value of variable internalName in this sample is just a placeholder. You need to put your own.

Sub EditFamily()
    Dim internalName = "f0446dbf-6021-4cf7-90a6-aedaf4f9d6ee"

    Dim ccFamily As ContentFamily = GetFamilyByInternalName(ThisApplication.ContentCenter.TreeViewTopNode, internalName)

    'Create new column
    Dim ccColumn = ccFamily.TableColumns.Add(
        "CustomColumn",
        "CustomColumn",
        ValueTypeEnum.kStringType
        )

    'Set column values
    Dim i As Integer = 1
    For Each ccRow As ContentTableRow In ccFamily.TableRows
        ccRow.Item(ccColumn).Value = i
        i += 1
    Next

    'Save changes
    ccFamily.Save()
End Sub

 

Few notes:

Use this code sample wisely, because there is no undo! Always backup your libraries before any test.

This code omits error handling.

You need to update this code to your needs. For example how to ensure unique numbers across families.

You can't create custom column twice.

Message 3 of 24

willAM42F
Contributor
Contributor

Hi, @Michael.Navara,

 

Thanks for the reply. This code is intimidating to say the least. When I'm back on that project, I'll try to work through it and see if I can make it work with my libraries.

Do you know of any other approaches that might be less risky? Or anyone who has tried to do this in the past?

0 Likes
Message 4 of 24

bradeneuropeArthur
Mentor
Mentor

I have created myself an add in that adds new properties and property values to all our standard cc parts. We have had also hundreds of them that need to be handled. This manual task would take weeks to finish. With this tool only a few hours.

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 24

willAM42F
Contributor
Contributor

Hi, @bradeneuropeArthur,

 

That's a creative solution and one that I might try if I ever have the time to learn how to create add-ins and create one myself. Yours wouldn't happen to be in the Autodesk App Store, would it?

0 Likes
Message 6 of 24

bradeneuropeArthur
Mentor
Mentor

Could you give me the propertyname that needs to be added and the property value that needs to be in these CC family parts?

 

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 7 of 24

bradeneuropeArthur
Mentor
Mentor

Is this the idea you are searching for.

I did a quick test with my code a bit modified.

Added in this case "COMPANY_PARTNUMBER" to the Family with a unique string value.

bradeneuropeArthur_0-1737156149247.png

If something like that is what you mean but than as a loop through each and every read/write family I could help you with a add-in.

 

 

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 8 of 24

willAM42F
Contributor
Contributor

Hi, @bradeneuropeArthur,

 

The property names that I'm trying to revise are FILENAME and PARTNUMBER. The value that I'm trying to put in those properties is in the format 12-34567, where 12 is a category and 34567 is a sequential number. PARTNUMBER is pretty easy since I can make it an expression of the FILENAME as it is by default, I believe.

0 Likes
Message 9 of 24

willAM42F
Contributor
Contributor

Hi, @bradeneuropeArthur,

 

The format that I need to set the property to is sequential and looks more like this: 

willAM42F_1-1737479230974.png

The first two digits are the category of the part. The last 5 digits are simply sequential numbers.

0 Likes
Message 10 of 24

bradeneuropeArthur
Mentor
Mentor

This means that file name and part number are the same, and the sequence as above. You are aware that you only can do that in a custom family. I will prepare a add in for you doing this.

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 11 of 24

willAM42F
Contributor
Contributor

Hi, @bradeneuropeArthur,

 

That's right. I've been working with custom Content Center libraries to make the changes that I need to the BOM descriptions, materials, custom iProperties, etc.

 

I appreciate your help with the add-in!

Message 12 of 24

bradeneuropeArthur
Mentor
Mentor

Could you give me a list or overview what to put in?

or is it really 14-10000 till 14-99999?

 

 

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 13 of 24

willAM42F
Contributor
Contributor

Hi, @bradeneuropeArthur

 

The exact format that is planned for the hardware is still not finalized. What is certain is that there will be a 2 or 3-digit category number, followed by a 5 or 6-digit sequential number separated by a dash. There are four and really only two likely possible formats: 12-345678 or 123-45678.

 

Will there be flexibility to customize the format or do I need to tell you exactly what it will be beforehand?

0 Likes
Message 14 of 24

bradeneuropeArthur
Mentor
Mentor

Sure that is possible.

That is the reason I ask before come with a concept.

 

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 15 of 24

willAM42F
Contributor
Contributor

Hi, @bradeneuropeArthur,

 

I wanted to give you a quick update about our part numbering system. We'll almost certainly be going with the 2-digit category number followed by a 5-digit sequential number separated by a dash (e.g. 12-34567).

Message 16 of 24

willAM42F
Contributor
Contributor

Hi there, @bradeneuropeArthur,

 

I just wanted to check in and see if you've managed to come up with an add-in concept for assigning part numbers to items in the Content Center? We're close to the point of needing a solution for how to do that, so I'm trying to weigh my options.

 

I really appreciate all the time you've spent helping me with this!

Message 17 of 24

bradeneuropeArthur
Mentor
Mentor

Yes sure.

I will gather what I have now, ok.

Than let's see what works for you.

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 18 of 24

bradeneuropeArthur
Mentor
Mentor

Would this be what comes into the right direction for you?

 

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 19 of 24

willAM42F
Contributor
Contributor

Hi, @bradeneuropeArthur,

 

Thanks for gathering what you have.

 

And I'm sorry, I don't follow your question. What are you asking when you say, "Would this be what comes into the right direction for you?"?

0 Likes
Message 20 of 24

bradeneuropeArthur
Mentor
Mentor

watching the movie?

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