- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
iLogic AddContentCenterPart
Good evening everyone!!
I was in the process of writing a bit of code where I can automate placement of content center parts. The code works on an internal rule but when I copy the exact rule to an external one it says it can't find the content center family
SyntaxEditor Code Snippet
Dim NozzlePath As String = "Tube & Pipe:Fittings:Couplings" Dim NozzleFamily s String = "ASME B16.11 Half Coupling Threaded - Class 3000" Dim componentB = Components.AddContentCenterPart("Nozzle1", NozzlePath, NozzleFamily, {"ND", "3" }, position := Nothing, grounded := False, visible := True, appearance := Nothing)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When running in an external rule, you have to explicitly specify the language that you're using for the path and family. To do that, add this line to the top of the rule:
Components.ContentCenterLanguage = "en-US"
More info here.
It would be a good idea for iLogic to provide a more specific error message in this case. We should be able to do that in a future release.

Mike Deck
Software Developer
Autodesk, Inc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having a similar issue with the new
Components.AddContentCenterPart
Ive got it to place the pipe in, but I am only able to place in the content centers default length, ie. 50" long
as we know, Inventor default content center has the PL parameter set to an expression of [0.001;;;50] which I know is where the 50 is coming from. I feel like I'm missing a step, or maybe it's not possible at the time to place an expressional part such as a pipe.
This is some test code, it is placing the 1st component but when I uncomment the 2nd one @ 20" it won't place it.
SyntaxEditor Code Snippet
Dim componentA = Components.AddContentCenterPart("occNameA", "Tube & Pipe:Conduits:Pipes", "ASME B36.10M Pipe", {"Size_Designation","3 - Schedule 40" ,"PL",50}, position := Nothing, grounded := False, visible := True, appearance := Nothing) 'Dim componentB = Components.AddContentCenterPart("occNameB", "Tube & Pipe:Conduits:Pipes", "ASME B36.10M Pipe", ' {"Size_Designation","3 - Schedule 40" ,"PL",20}, ' position := Nothing, grounded := False, ' visible := True, appearance := Nothing)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
That's right: it's not possible at this time to add a part with a custom size. As it is, the function will add it as a Standard part, with the default size. We should be able to support custom parts with variable sizes in a future release.

Mike Deck
Software Developer
Autodesk, Inc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is it currently possible to add a sub-assembly into an assembly and then from that top-level assembly run a rule that could use the Components.Add to the sub-assembly?
Something similar to this maybe?
SyntaxEditor Code Snippet
If openDoc.DocumentType = kAssemblyDocumentObject Then For Each docFile In openDoc.AllReferencedDocuments FNamePos = InStrRev(docFile.FullFileName, "\", -1) docFName = Mid(docFile.FullFileName, FNamePos + 1, Len(docFile.FullFileName) - FNamePos) If docFile.IsModifiable = True Then assemblyDoc = openDoc assemblyDef = assemblyDoc.ComponentDefinition Dim componentA = docFile.Components.Add("nozzle 1", "C:\Users\Public\2019\PIPES\PIPEC2-40-8.ipt",
position := Nothing, grounded := True, visible := True,
appearance := Nothing) End If Next End If
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This has been implemented within Autodesk Inventor 2024. Please review the Inventor 2024 What's New article here. For more information regarding how you may leverage the feature, and please review this page. Thanks!
River Cai
Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com