I'm looking at creating some Parametric models with Excel and ilogic
Anyone know if it’s possible to automate the changing of content centre components parts in a model using ilogic or some other method other than the traditional way of manually selecting the components in the assembly followed by right mouse click to change
As an example let say my model has some 1/2" hex bolts and I want to change them to 3/4" Hex Bolts is there a way to change these though a front end interface like and excel spreadsheet? or ilogic?
I think it is possible with iLogic, but it requires a lot of API code. I will look at it and try to post a solution.
Are you using Inventor 2011? I think there is a way in 2011, but I don't know about previous versions.
Here is a way to do it using iLogic in Inventor 2011. Most of the code is in an external rule, so that it can be re-used. This code is provided "as is".
Save the attached file (ContentCenterReplace.iLogicVb) to a directory on your machine. Add that directory to the list of External Rule Directories under Tools -> Options -> iLogic Configuration.
To use this method, you have to rename the component occurrence in the assembly Model Browser (this way it has a constant name and iLogic can find it). The attached screenshot (CCOccurrenceRename.PNG) shows how this looks in my sample model. The disadvantage of this is that you don't see the component size information in the tree. You have to right-click on the component and look at the iProperties.
Here's a sample rule:
Dim replacer As New ContentCenterReplace(ThisDoc.Document, ThisApplication, "en-US")
Dim familyName As String = "Fasteners:Bolts:Hex Head:Hex Cap Screw - Metric"
compo = Component.InventorComponent("Hex Cap Screw:2")
replacer.Replace(compo, familyName, CapScrew2Name)
Note the "en-US". If you use a different language in Content Center, you will have to change this. I haven't tested it with other languages.
The familyName is the complete path to the part, using a colon as the separator.
CapScrew2Name is a Text parameter in the assembly. In this case it's a multivalue parameter, with values such as
ANSI B220.127.116.11M - M10 x 70 - 15
You can use either the Part Number or the File Name from the Table View of the Content Center family.
Here's another example with hard-coded part numbers:
If (ScrewLength = 55) Then
replacer.Replace("Hex Cap Screw:1", familyName, "ANSI B18.104.22.168M - M10 x 1.5 x 55")
ElseIf (ScrewLength = 65) Then
replacer.Replace("Hex Cap Screw:1", familyName, "ANSI B22.214.171.124M - M10 x 1.5 x 65")
Has there been any other solution developed for this problem? Will this be a standard feature in 2012? I think this is an extremely usefull feature for Inventor.
I'm not sure if there's another solution. Did you try the external rule and sample internal rule that I posted? If so, are there any improvements or changes that you think it needs?
The only thing I am worried about is that this file will be traveling... So it will be used by many users on different computers. Will that file always have to be available in the correct path on any computer that it is used on. If its a one time thing then that will probably work if not I may need to find a different route.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register