I'm trying to play around with iLogic for creating dynamically dimensioned subassemblies. I've created my dimensioning rules that link to the parts I wish to change dimensions on.
And I've tested this in the SubAssembly I've created and all appears fine. However when I go to insert the sub assembly into the main assembly I get the following error:
Parameter: The component named "Bridge Spine:1" was not found.
I've noticed that the new sub assembly has created new parts with the extension -01 on the end of each part (As expected) It appears that this link is being lost in the rule for the new sub assembly. i.e the rule is looking for Bridge Spine:1 instead of Bridge Spine-01:1
What I am trying to do is insert a part into an assembly file using iLogic. I basically want to mimic Inventor’s “Place” command using ilogic, maybe something like this:
I am trying to set the appearance of sub-components in an assembly using iLogic.
Dim oDoc As Inventor.AssemblyDocument = ThisApplication.ActiveDocument Dim oCompDef As Inventor.ComponentDefinition = oDoc.ComponentDefinitionDim oCompOcc As Inventor.ComponentOccurrence 'parts in the assemblyFor Each oCompOcc In oCompDef.OccurrencesoCompOcc.Definition.Document.ActiveRenderStyle = oCompOcc.Definition.Document.RenderStyles("HVGM")Next
I have a code which I want to rotate a part. I have a text parameter 6 and 7. If one of the values is active I want to give the component a certain rotation.
Under the 'Hoekkoppeling' parameter is the angle constraint.
Below the
If Parameter ("KlemHoekstuk-01: 1", "KoppelingType") = 7 Then Hoekkoppeling = 60 deg ElseIf Parameter ("KlemHoekstuk-01: 1", "KoppelingType") = 6 Then Angle = -60 deg End If
I now get always an error on the second and fourth line.
I feel that the specify for the value is incorrectly.
I created a simple Part with some parameters to drive dimensions. Saved the part. I created an Assembly. Saved the assembly. Clicked Place iLogic Component. The Place iLogic Component window appeared Selected the Part. I can see the preview window (Part-01) & the parameter window... Used default values. Hit OK NO PART INSERTED! Using Inventor Pro 2014 64-BitLudesroc
How to modify the code below to delete suppressed parts in a pattern (entire pattern)?
Dim oComp As ComponentOccurrenceDim oComps As ComponentOccurrencesoComps = ThisDoc.Document.ComponentDefinition.OccurrencesFor Each oComp In oCompsIf Component.IsActive(oComp.Name) = False Then oComp.DeleteNext
Code works fine if there are single instances of the part. It throws a error when you have a suppressed pattern.
I have a wall of frames, if you will, and some frames within this wall are different sizes. When doing the BOM, I want to be able to combine anything that has the same stock number as well as the same cut length. The only way I have thought to do this so far is to cycle through each stock number and if the cut length is the same, I override the quantity of one and change the BOM Structure of the other to "Reference".
How can I change the BOM Structure to reference without selecting the part or going through the BOM Editor? Is there some VBA code I could utilize? I am striking out by solely using iLogic.
Is there code for changing the color (or other properties) of the visible edges of a component in a drawing view, the same way I can do it manually by right-clicking a component and choosing Properties?
I wrote this rule to change the color of each individual drawing curve:
Edit: Ignore the "<!". It's the only way I could get the iLogic code to successfully post in the message
Spoiler (Highlight to read)<!Dim drawViews AsDrawingView For Each drawViews In ThisApplication.ActiveDocument.ActiveSheet.DrawingViews occ3 = drawViews.ReferencedDocumentDescriptor.ReferencedDocument.ComponentDefinition.Occurrences.ItemByName("GF_Plenum:1") Dim newColor3 As Color newColor3 = ThisApplication.TransientObjects.CreateColor(0,255,255)
If I set this to true, then when I "place iLogic component", I don't get the form displayed or the parameter table or the model preview.
If set True, displays the form when placing this model as a component in an assembly. This setting affects Place Component and Place iLogic Component. If the template file has a form, this setting also affects Create In-Place Component.
The commented code does not work. I want to be able to open a part and change its size parameters before i open the assembly. this code will run as an external rule in a new empty file.
If i can do it without opening the part, that is even better. Test can I open a part, change a param, then close part.
Dim fname As String fname ="C:Workspacemy_progchanF_BB_L.ipt" Dim pDoc as PartDocument = ThisApplication.Documents.Open(fname,False) pDoc = ThisApplication.Documents.Open(fname)
These are just attempts to find a syntax that works. I need the method to change the parameter.
I have a simple code below trying to iterate through all the assembly component and copy the iProperties > Occurrece Name (i.e. "Part1:1") and paste it to iProperties > Project tab > Part Number field for each individual part in assembly.
' set a reference to the assembly component definintion. ' This assumes an assembly document is open. Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
'Iterate through all of the occurrences Dim oOccurrence As ComponentOccurrence For Each oOccurrence In oAsmCompDef.Occurrences Dim oName As String oName = oOccurrence.Name iProperties.Value(oOccurrence.Name, "Project", "Part Number") = oName MessageBox.Show(oOccurrence.Name, "iLogic") Next
The Debug message shows the correct output for every iteration, but when I check each part's properties they all have the Occurrence Name of the last part in the aseembly.
So I have been going round and round in circles on this one iam trying to use replace component within ilogic which is fine with switching one part for another but I want a drop down of parts so it replaces which ever one is active the problem I am having is establishing which one is active. So below is what I have so far but the problem is you cant seem to reference a part that is not in the assembly so I keep getting the error
The component named "Flange 1" was not found for example. I just need a way of establishing which one is currently in the assembly but with out referencing components that are not there.
If Component.IsActive("Flange 1")=True Then current = 1 If Component.IsActive("Flange 2")=True Then current = 2 If Component.IsActive("Flange 3")=True Then current = 3 If part = 1 And current = 2 Then Component.Replace("flange 2", "Flange 1.ipt", True) End If If part = 1 And current = 3 Then Component.Replace("flange 3", "Flange 1.ipt", True) End If If part = 2 And current = 1 Then Component.Replace("flange 1", "Flange 2.ipt", True) End If If part = 2 And current = 3 Then Component.Replace("flange 3", "Flange 2.ipt", True) End If If part = 3 And current = 1 Then Component.Replace("flange 1", "Flange 3.ipt", True) End If If part = 3 And current = 2 Then Component.Replace("flange 2", "Flange 3.ipt", True) End If
I found this code to create a custom iProperty in the current, open document:
Dim propertyName As String = "MyProperty"Dim propertyValue as String = "Test Value"customPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties")Try prop = customPropertySet.Item(propertyName)Catch ' Assume error means not found customPropertySet.Add("", propertyName)End TryiProperties.Value("Custom", propertyName) = propertyValue
I have a iLogic rule that goes through each component of an assembly, counts how many times it occurs in the assembly, and then assigns that value to an iProparty (i.e. it inserts the total quantity of the part in some iProperty). Currently, however, it assigns the value to a default iProperty value, "Authority". I'd like, instead, for it to assign it to a custom iProperty called "Total QTY". However, I don't know how to tell Inventor to do the above code for a component in the assembly rather than the assembly itself. Below is my entire code. I've labeled where I'm guessing the above code should go. How I'd modify the above code to create the iProperty in the component being processed by the rule at that point?
Current
''True comment: Begin '''Commented-out Begin '''PartDocumentObject = 12290''AssemblyDocumentObject = 12291Dim openDoc As DocumentopenDoc = ThisDoc.DocumentDim docFile As DocumentIf openDoc.DocumentType = 12291 Then''If the open document is an assembly:''For each document referenced in this document:For [code]......
I'm trying to create a rule in ilogic that would search through all child components (looking for both .ipt and .iam file types) looking for an ilogic rule within each child component with a particular name, and running that rule if it is found.
I am looking for a way to create an external rule that will allow me to turn off the visibility of bolt generator items in the model while I am looking at the drawing. Bolts may be buried several subassemblies (4 - 6) deep.
I'm finally wrapping up work on an iLogic Configurator project and have started to brainstorm the best workflow to get this "Smart Assembly" into the design group's hands. I had been anxiously awaiting the new "iLogic Design Copy" feature in IV2012, but just recently learned that users are unable to effectively rename any components with this command.
Is this really true? If we can add prefixes or suffixes, what's stopping us from changing the entire filename? We haven't upgraded to 2012 yet, but it seems like this may be a silly and unjustifiable restriction to a command that would otherwise save our designers hours of "file-management" (ie, manually renaming parts in Explorer, component replace in assy's, replace references in idw's, etc) each week.
Long story short, it seems that every workflow I've come across has had some sort of silly limitation that makes it undesireable for my application:
My top-level assembly contains all of the rules, and changes parameter values in the referenced skeletal parts. It also swaps standard parts for other standard parts as needed.I need access to rename ALL files (idw's, top-level assembly, subassemblies, and base components) while still maintaining/updating all internal hyperlinks between them.iLogic rules must be carried over to the new copied components (the existing "Copy Assembly" command strips the assembly of all rules). In light of the iLogic Design Copy's apparent shortcomings, any better workflow?
I need a way to run a rule which is saved in my top-level assembly using iLogic rule which is saved in a part file in the parent assembly.
I have even tried using an external rule in a txt file, but that gives the error "Component: This function can only be used in an assembly." - which makes no sense to me. I hope I am just missing something simple. I cant believe with all its other strengths, that iLogic would be so limited in that regard. Why is there not simply a snippet under the 'Run Other' that allows you to specify an assembly file and the rule name? (like there is for running a rule in a component from the assembly)
I want to be able to control the location/position of a component in an assembly. This is easy enough through the iProperties/Occurrence tab and then adjust the location of the X,Y, and Z offsets. Is this possible using iLogic? I have been unable to find a function to access via iLogic. Ultimately I am trying to translate a component about an axis not a pattern.
We are having an issue when we replace a component in Inventor Pro 2012. When we replace a component, the name in the browser does not update to the new component. We've even tried to close and re-open the Inventor assembly and that does not work. We end up manual double clicking the name in the browser and type in the new component name.
Inventor Product Design Suite Ultimate 2012 Dell Precision T7500 Workstation Xeon Processor 16 GB of RAM Nvidia Quadro FX 5800 Windows 7 x64
II need a way to tell if a component occurence is a virtual component.
I'm using a For Each loop to cycle through all of the components in an assembly, and if the component is itself an assembly to set the LOD to "Custom". I'm using the definition document descriptor object for this. It all woks fine until the loop comes across a virtual component which doesn't have a definition document, so I need a way to check if the component is virtual and needs to be skipped.Here's the
Option ExplicitImports Inventor.LevelOfDetailEnumSub MainiLogicVb.UpdateWhenDone = TrueDim doc As AssemblyDocumentDim oLOD As LevelOfDetailRepresentationDim oAsmCompDef As ComponentDefinitionDim oComp As ComponentOccurrenceDim oComps As ComponentOccurrencesdoc = ThisDoc.DocumentIf. [code]....
I am trying to make port rims for pipes that can be swapped in and out of an assembly. However, the ports will all be different sizes and located differently so I need the cut to be part of the port rim component, but affect the entire assembly it is part of. I've been trying to get this to work for the better part of a day now,Here's a picture of what im talking about. I'm running Inventor 2008 by the way.
Can't seem to locate the Inventor Material Library....under Default in Projects, the Inventor Material Library is highlighted in Red. Where I need to browse to inorder to locate it?