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.
Note that I changed the sample code to use a parameter named BarLength (it was previously PipeLength).
You asked Cean if he wanted the part as stancard or custom. Can you explane the differences and an example of use for each?
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.
HI Jim, one difference is they are saved in different folders. Standard parts sit in content center. Custom ones sit in your project folder.
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.
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.
Could you please show a line of code which will swap content centre nuts?
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 B188.8.131.52M Nut:1". Also, create a Text parameter named NutType. Make it a multi-value parameter, with possible values:
Access a broad range of knowledge to help get the most out of your products and services.