Hi guys,
I have a pattern that patterns a number of wall panels into a room, depending on the width of the room.. I have a cut that runs along the top to take the slope of the room that cuts the panels to the height of the room at various points.
When i change the width, the number of components in the pattern change, but the cut will ignore them until I add participant manually.. I dont want to do this manually.
I have trawled the net but to no avail.. Can anyone help with this??
Thanks
Mike
i am currently having a very similiar issue with crossmembers in a structure that require holes for a conduit. The crossmembers are part of a changing rectangular pattern. as the pattern is changed new members are not included in the extrusions forming the holes. i have figured out how to address the individual members of the pattern but cant seem to figure out how to make them participate in the weldment preparation...
attached is a picture of the crossmembers with the sweep forming the holes highlighted
These sort of questions tend to get a better response when posted here: Inventor Customization.
I’m not really certain what you’re attempting to describe in your scenario. Could you provide a screenshot (or screenshots) detailing what it is you’d like to accomplish, what is going wrong, and what you do to fix it?
As for Stephanbotes, who did include a screenshot (though it does not seem to show any patterns in the browser :-/) it looks as if you could save yourself the trouble of having two patterns, by simply moving those cuts to the part models themselves. If the cuts become part of the part model, then you won’t have to worry about keeping the quantities of the patterns in check and save yourself a little time.
All in all, using iLogic to add members to a pattern probably isn’t what would actually helpful. Altering how your patterns are being made, or adding in a parameter (containing a formula for member quantity calculation), or even simply reusing a parameter that has been made available from the pattern you’d like to base your cuts on all seem like the direction that should be looked at.
Please post more information and any part / assembly files that you can. If they are 2012 or lower, I can look at them sooner. If not, please post the version that you’re using and I, or somebody else, will look at them later ;).
Hi everyone,
As I understand it, the request is to automate the process with which we add and assembly feature participants, as described at these links:
http://help.autodesk.com/view/INVNTOR/2015/ENU/?guid=GUID-967D97A2-C508-4B16-850F-F5A05637BB0B
http://www.inventortales.com/2014/01/controlling-component-participation-in.html
http://inventortrenches.blogspot.com/2011/05/isolate-before-assembly-features.html
I did a quick search, but did not find anything in the API that exposes this ability. I might have missed it though.
I did just find this Control Definition command:
AssemblyAddFeatureParticipantCtxCmd
If I can come up with a working example I'll post back later.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Hi everyone,
A bit more digging turned up some more information in the API. Here's an example that is looking for an assembly feature named "Extrusion 1", and an assembly component occurence named "Arbor_Frame:1". Change the names to fit your needs in order to see it in action.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmDoc= ThisApplication.ActiveDocument
Dim oDef As AssemblyComponentDefinition
oDef = oAsmDoc.ComponentDefinition
Dim oAssemblyFeatures As Features
oAssemblyFeatures = oDef.Features
'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oDef.Occurrences
If oOccurrence.Name = "Arbor_Frame:1" Then
oOcc = oOccurrence
Else
End If
Next
Dim oAssemblyFeature As PartFeature
'Iterate through all of the assembly features
For Each oAssemblyFeature In oAssemblyFeatures
If oAssemblyFeature.Name = "Extrusion 1" Then
'add the occurrence to the feature
oAssemblyFeature.AddParticipant(oOcc)
Else
End If
Next
Hi everyone,
Here is another example that adds all of the components of a pattern called "Component Pattern 1:1" to the assembly feature called "Extrusion 1".
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim oAsmCompDef As AssemblyComponentDefinition oAsmDoc= ThisApplication.ActiveDocument Dim oDef As AssemblyComponentDefinition oDef = oAsmDoc.ComponentDefinition Dim oPat As OccurrencePattern oPat = oDef.OccurrencePatterns.Item("Component Pattern 1:1") Dim oAssemblyFeatures As Features oAssemblyFeatures = oDef.Features Dim oAssemblyFeature As PartFeature 'Iterate through all of the assembly features For Each oAssemblyFeature In oAssemblyFeatures If oAssemblyFeature.Name = "Extrusion 1" Then 'look at the pattern elements Dim oPatE As OccurrencePatternElement For Each oPatE In oPat.OccurrencePatternElements 'look at the pattern element contents Dim oOcc As ComponentOccurrence For Each oOcc In oPatE.Occurrences 'add the element contents to the feature oAssemblyFeature.AddParticipant(oOcc) Next Next End If Next
After Curtis had initially posted and I started to understand what the problem was, my brain started to get an idea on how to maybe fix it. However, due to work and other obnoxious things such as lava arrows / laser swords, I was unable to write anything up and my brain was left yearning. It would also now seem that Curtis has provided not one but TWO (!) super keen suggestions that may or may not fix the problem all of you are having.
Despite that, I have finally found a little time to get this stuff out of my brain and have attached a file of the resulting iLogic code. While it does an alright job of accomplishing the task at hand (adding missing participants), I feel like the dynamic nature of it may be a good starting point for someone else to come along and do something more with it in the later days if they so choose. Just remember that this will only add participants already added into a Pattern, and will ignore everything else!
Remember to save your work before you try it 😉
PS: I didn't comment any of my code because A) It's midnight & B) I'm a jerk.
When I tried using Curtis' code as iLogic code in an existing assembly, I received this error "The parameter is incorrect." What kind of problem does this error message usually indicate? I've seen it often before in other code.
The line that throws the error is: oAssemblyFeature.AddParticipant(oOcc)
I've message boxed both oAssemblyFeature.Name and oOcc.Name to confirm that oAssemblyFeature is referencing a real feature in my assembly and oOcc is a real occurrence in my assembly. Both of them are, so I'm not sure what is producing the error.
Steve
Curtis posted two code solutions. Are you having trouble with both of them?
Also, try the iLogic attached to the text file in my post above and see if it might work.
Firstly I want to thank everyone for their contributions to the thread. You guys have been really helpful.
Secondly I have code below that solves my original question (at least for me)
Sub jchannelSweepParticipationAdder(ByVal oOcc As ComponentOccurrence,ByVal oSweep As SweepFeature) Dim oSubOccProxy As ComponentOccurrenceProxy oOcc.CreateGeometryProxy (oOcc.SubOccurrences(1), oSubOccProxy) oSweep.AddParticipant (oSubOccProxy) End Sub
The sub allows one to add members of a variable sized occurence pattern to a sweep feature in the parent assembly. It seems like a big part of the issue was the inability to include the subassemblies in the occurence pattern in the sweep feature. This is fixed by creating proxies of the subassemblies that can then be added to the sweep feature.
While this by and large solves the problem it is not yet perfect as it works well within the assembly where the rule resides but throws the "invalid parameter" error when the assembly containing the rule is included in another assembly and the rule is then triggered from the new parent assembly. I am not entirely sure what causes this behaviour as the rule still seems to execute correctly despite the error.(so im just kind of living with it right now)
I was able to develop an iLogic routine to add all the relevant participants to the cut whenver the iAssembly row changed and the components changed using Table Replace. That works fine in the model, but it's not help for creating drawings of al the different states for this reason: When I manually change rows, the iLogic routine runs; but if I use "Generate Files" then it does not run the routine before saving the generated files. So in the end, only the iAssembly row that was last active gets the extruded feature. And the others are not participants because their iParts were absent form the assembly when the file was saved.
I wish there was a way to set assembly features to always contain all active parts in the assembly without having to manually add or remove participants. That would solve my problem altogether.
Steve
the way that I have managed to get it to work despite the errors is to simply run the code before and after save which requires the whole assembly to be updated and saved twice.
That being said that is a rather crude solution. I would also agree that at least from my humble perspective the problem would readily be solved by including everything in the feature automatically (maybe with the ability to explicitly exclude certain subassemblies).
So I wanted to use this to add only 2 different participants to the cut, is this possible?
@Nauld1 wrote:
So I wanted to use this to add only 2 different participants to the cut, is this possible?
Hi Nauld1,
Here is a quick example.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim oAsmCompDef As AssemblyComponentDefinition oAsmDoc = ThisApplication.ActiveDocument Dim oDef As AssemblyComponentDefinition oDef = oAsmDoc.ComponentDefinition Dim oAssemblyFeatures As Features oAssemblyFeatures = oDef.Features 'Iterate through all of the occurrences Dim oOccurrence As ComponentOccurrence For Each oOccurrence In oDef.Occurrences If oOccurrence.Name = "MTG SIDE:1" Then oOcc1 = oOccurrence ElseIf oOccurrence.Name = "MTG SIDE:2" Then oOcc2 = oOccurrence End If Next Dim oAssemblyFeature As PartFeature 'Iterate through all of the assembly features For Each oAssemblyFeature In oAssemblyFeatures If oAssemblyFeature.Name = "Extrusion 1" Then 'add the occurrences to the feature oAssemblyFeature.AddParticipant(oOcc1) oAssemblyFeature.AddParticipant(oOcc2) End If Next
We are attempting to make this code work for a pattern within a pattern. So far we've come up with the following but it gives us a "The parameter is incorrect" error:
SyntaxEditor Code Snippet
Dim oAsmCompDef As AssemblyComponentDefinition oAsmDoc= ThisApplication.ActiveDocument Dim oDef As AssemblyComponentDefinition oDef = oAsmDoc.ComponentDefinition Dim oPat As OccurrencePattern oPat = oDef.OccurrencePatterns.Item("Component Pattern 1:1") Dim oAssemblyFeatures As Features oAssemblyFeatures = oDef.Features Dim oAssemblyFeature As PartFeature 'Iterate through all of the assembly features For Each oAssemblyFeature In oAssemblyFeatures If oAssemblyFeature.Name = "Extrusion 1" Then 'look at the pattern elements Dim oPatE As OccurrencePatternElement For Each oPatE In oPat.OccurrencePatternElements 'look at the pattern element contents Try 'New code starts here Dim oPat2 As OccurrencePattern oPat2 = oDef.OccurrencePatterns.This Dim oPatE2 As OccurrencePatternElement For Each oPatE2 in oPat2.OccurrencePatternElements 'back to Curtis' code until end try Dim oOcc As ComponentOccurrence For Each oOcc In oPatE2.Occurrences 'add the element contents to the feature oAssemblyFeature.AddParticipant(oOcc) Next Next Catch End Try Next End If Next
Hi all ,
i would like to know if its possible to get only a range of element to add as a participant occ.
for example :
i have a skeleton where i position a rectangural sketch
i only want to let involve the participants according the sketch width.
Thx in advance !
I know this is an old post, but it is relevant to what I am working on. I am trying to in corporate the code (.txt file you provided) but I don't see where I can substitute my parameters/variables into the code. Could you please give some incite as to what I am missing?
PS
I am not a super coder as yourself, so please be gentle.
Can't find what you're looking for? Ask the community or share your knowledge.