Autodesk Inventor
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Changing C/C component Automation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Cean,
Here is a new version of the content center rule. It has a new option to place a part with custom parameters as a Standard part. The sample rule (AddContentCenterBar.txt) has a new line of code:
replacer.CreationMode = FileCreationMode.AsStandard
(Other options available are:
replacer.CreationMode = FileCreationMode.AsCustom
replacer.CreationMode = FileCreationMode.ByFunctionName ' this is the default. )
I modified the sample code to work with the content center family that you are looking at. This family uses a different custom parameter (B_L) to set the length (as compared to the pipe which uses PL).
To see the parameter name, place a component manually and look at the Table View. Hover the mouse over the column header to see the internal name of the column. This is the parameter name that is required for the code.

Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.
Re: Changing C/C component Automation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Note that I changed the sample code to use a parameter named BarLength (it was previously PipeLength).

Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.
Re: Changing C/C component Automation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Mike,
You asked Cean if he wanted the part as stancard or custom. Can you explane the differences and an example of use for each?
Thank you
Jim
Inventor Premium 2013 SP1.1
Vault 2013- plain vanilla version
HP G71 notebook
celeron cpu w\ 4gb RAM and 64 bit system
Win 7 home premium
Ya, my boss has me running my personal machine at work.
Re: Changing C/C component Automation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Mike,
All good for custom part now. The flat bar is also good for standard, no matter I use "PL" or "B_L", or even omit it.
But the pipe still can't show correct length when placed as standard part.
Thanks
Cean
HI Jim, one difference is they are saved in different folders. Standard parts sit in content center. Custom ones sit in your project folder.
Re: Changing C/C component Automation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Cean,
Can you post your complete rule that demostrates the failure to set the length of the pipe component? Please attach it as a text file. That makes it easy for me to work with it.

Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.
Re: Changing C/C component Automation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Here it is. Thx
Re: Changing C/C component Automation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Cean,
Your rule works on my system. It creates a pipe with length PL = 200 in.
On your system, you might have to manually delete old pipe parts in your Content Center directory. The old version of the rule probably created parts with the wrong length. The new version won't overwrite these: it doesn't know that they are obsolete. Once you delete them, the rule can generate new versions.
I think an old part would also explain the behavior you saw with the bar part. When you use "PL" instead of "B_L" for the bar part: if the part with that name already exists, it won't try to regenerate it. If it did, you would see that "B_L" is required. Please try deleting your existing bar parts (only delete the recently generated ones: don't delete any that are being used in other assemblies) and generate new ones. I'm pretty sure that you will find that "B_L" is required to set the length of the bar part.

Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.
Re: Changing C/C component Automation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Mike,
Cleaned the folders and all right now. The code is so cool now.
Thanks for all the help.
Cean
Re: Changing C/C component Automation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello
Could you please show a line of code which will swap content centre nuts?
also posted:
http://forums.autodesk.com/t5/Autodesk-Inventor/iL
Many Thanks
MES
Re: Changing C/C component Automation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Mark,
See the sample rule in the attached file SwapNut.txt. It will select a different member row within a family. With modifications, it could select a different family. To make it work in an assembly, you need to change the name of the nut component (the component name in the Model browser, not the file name) to "Ansi B18.2.4.2M Nut:1". Also, create a Text parameter named NutType. Make it a multi-value parameter, with possible values:
M3x0.5
M4x0.7
M5x0.8

Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.


