AutoCAD Inventor :: ILogic - Rule Driven Assembly
Apr 23, 2013
The setup is: I have a rule which first gets a number of user parameters via input boxes.This rule then runs a number of other rules, using:
iLogicVb.RunRule("Rule 1")iLogicVb.RunRule("Rule 2")iLogicVb.RunRule("Rule 3").Each of these rules control parameters, part/feature/constraint suppression etc. in the top level and subassemblies/parts based on the previously obtained user parameters.
All the rules have the 'Don't run automatically' option selected, so all should only run as intended when I manually run the first rule.When I run the first rule, I enter all the parameters, and the subsequent rules run.The problem is, the suppression states etc. in the subassemblies/parts do not update.
Looking at the parameters dialog box after the rules have run, all user parameters have updated with the new values.If I run the first rule again the subassemblies/parts update correctly.
It appears that the rules that control the suppression states etc. of the subassemblies run using the initial values of the user parameters, i.e. the values as they were before the user input is obtained, rather than the new values.This is confusing me, as the code is structured as follows:
user_parameter_1 = InputBox("User Parameter 1", "Input", "xx")user_parameter_2 = InputBox("User Parameter 2", "Input", "xx")iLogicVb.RunRule("Rule 1")iLogicVb.RunRule("Rule 2")
View 2 Replies
ADVERTISEMENT
Aug 2, 2013
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)
View 4 Replies
View Related
Dec 6, 2011
I want to simply set a custom iproperty as the Description in each part file within my assembly. I can do this easily at part level with ilogic but I want to be able to run the rule from the assembly level and all the parts run the rule. I am struggling to find a way to do this.
I think this may be the best method I have found but I think it must be far easier?
[URL].......
View 9 Replies
View Related
Jul 1, 2013
I have a parent assembly that contains multiple sub assemblies, two of which need to synchronize with each other.In the parent assembly, I have created a user form that controls the sizes and quantities of all the different sub assemblies.
Sub assembly 1 contains a bracket for supporting 4 rows of pipes.Based on the width selected from the main parent assembly, the length of this bracket can vary.
The spacing of the 4 mounting positions is also determined from the length of the bracket.Sub assembly 2 is an assembly containing all the pipes.The pipes are spaced apart to suit the bracket using a component pattern, and it is this distance that I want to control from the parent assembly.This is just one of the basic scripts I've tried.
Pipe_Spacing=Parameter("SubAssembly1:1", "Pipe_Spacing_A")
Parameter("Piping assembly:1", "Pipe_Spacing_B")=Pipe_Spacing
Pipe_Spacing_A is the spacing of the bracket
Pipe_Spacing_B is the component pattern in the piping assembly
Pipe_Spacing is the parameter in the parent assembly to be driven by the bracket parameters.
I have very little iLogic experience & have being learning as I go along with this project.My best guess is that the code can't loop back on itself. On a slightly different note, I have also noticed that the sub assemblies don't update properly.
If I adjust the width to X and regenerate the model, some of the sub assembly updates. To fully update, I have to go back into the user form, change the size to Y & then change it back again to X and then regenerate.
View 1 Replies
View Related
Apr 4, 2013
I want to use I logic to adjust an assembly constraint based on T/F value passed from a master sketch.
I have passed the paramater T/F and/or a user paramater as described in this thread using link (neet trick).. but when the code fires it only works on the true application and not the false.. if i open the rule and then close it the update button becomes available and when updated the false condition updates sucessfully. I have tried just re-running the rule to no avail. It seams that the only way I can get it to triger a false condition is to open the rule... close it and update.
If Parameter("iTrigger0101000") = 1 Thend37_Header1 = -.25 ind34_Header2 = -.25 inElseIf Parameter("iTrigger0101000") = 0 Thend37_Header1 = -.25 ind34_Header2 = 0.0 inEnd If
View 2 Replies
View Related
Oct 6, 2011
I Created an iLogic Rule that sets up some parameters.
I want to Automatically opens each and every Part in my assembly, run this Rule, and then save it without me having to do so manually.
View 8 Replies
View Related
Nov 17, 2011
I have a rule in the top assembly to update & want to run this as a final 'clean up' after various rules have run in sub assembly parts.
I have a rule within a part at the end of the line. I want this rule to goto the top assembly & run the 'Update' rule.
View 4 Replies
View Related
Oct 9, 2013
I have used Inventor for quite a while but never for much more than the odd 3D model.
I have recently created templates that allow me to use Inventor to create detailed fabrication drawings rather than relying on AutoCAD. But I have run across a question with regards to the BOM. Let me try and explain my issue.
I currently create assemblies for fabricated items. However, in the complete (or top level assembly) there may be multiple fabricated items (assemblies required). At the moment I create the BOM and manually edit the quantities required to reflect the number of assemblies (and resulting parts) that are required.
In my assembly file I created a parameter called "AssemNo" which is meant to reflect the number of assemblies required. In my part files I created a parameter called "AssemQty". I would insert the following iLogic code for each part in the assembly:
quantity - This.BOM.CalculateQuantity("Model Data", "PartNumber")*AssemNo
Parameter("Part Name:1", "AssemQty") = quantity
This works but it requires me to create that line of code for every part in my assembly. I know an iLogic code can be created to search an assembly and change parameters of all parts (see below as an example to copy Occurence name to iProperties >
' 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
Can the two be combined?
View 3 Replies
View Related
Oct 16, 2013
I created an iLogic rule that allows in a sheet metal part to the informations Length, widht and area of a flat pattern. This rule run and the iproerties are created (see attachment file).
Now, I will run this rule from an assembly file to create automatically, in all sheet metal components, theses iproperties.
Is it possible ? what must I change in this rule ?
View 1 Replies
View Related
Apr 1, 2013
I`m looking for the iLogic code that can change one parameter (user defined) for each (ipt) part in assembly (iam)
The one below doesn`t work.
Sub Main Dim oApp As Inventor.Application = ThisApplication Dim oAssy As Inventor.AssemblyDocument = oApp.ActiveDocument For Each oSubDoc as Inventor.Document In oAssy.AllReferencedDocuments On Error Resume Next Parameter(oSubDoc, "FH") = 15.26 Next End Sub
View 5 Replies
View Related
Jan 7, 2014
Is there a way to invoke the iLogic Rule Editor and pass it an existing rule name or external rule for editing?
View 4 Replies
View Related
Dec 9, 2011
I am working for customer with a simple item with his iLogic design. He has created a simple form to modify his iProperties. To modify the current material, a multi-value parameter was created and the following rule as a local rule;
"MultiValue.List("MATLIST") = iProperties.Materials
iProperties.Material = MATLIST"
He is now trying to make this an external rule but gets the following error
Error in rule: Mat2, in document: Mat2.iLogicVb
iProperties.Material: is probably a bad material name.
The more info tab says:
System.ArgumentException: iProperties.Material: is probably a bad material name.
at iLogic.CadPropertiesInRule.SetDocMaterial(Document doc, String matName)
at LmiRuleScript.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
View 2 Replies
View Related
Aug 19, 2013
how can I close an iLogic Form from either an iLogic Rule, or a VBA Rule (VBA is the Preferred method)?
View 5 Replies
View Related
Apr 10, 2012
I have an assembly I've put together in Inventor 2011. I tried to make an adaptive spring to use with a shock that goes in a car. I'd like the spring to change size as the shock extends and contracts.
I went through the process of creating an adaptive spring, and it worked, but I could only change the length of the spring by using the "Drive Constraint" feature, which only allows me to adjust the spring when I'm using the "Drive Constraint" menu. It plays like a movie. What I want is a part that just moves like you would expect when you push/pull the ends of the shock. I don't want to have to drive it like a movie.
So then I thought that I could just simulate a spring by making a series of rings (toroids). I could constrain the bottom ring and top ring to the shock geometry and then have the other rings position themselves according to the distance between the top and bottom rings.
SO, I have 5 rings. The bottom ring is grounded the top ring has a Limit Constraint that sets the top ring anywhere between 3 and 7 inches above the bottom ring.
How do I create a driven dimension on an assembly that will automatically update the distance between the top and bottom ring?
I would like to call that dimension "HEIGHT", and then I could use parameters to set the middle ring a distance (HEIGHT/2) above the bottom ring, I could set the ring below the middle to (HEIGHT/4), and I could set the ring above the middle to (HEIGHT*3/4).
I should then be able to move the upper ring up and down and the other rings reposition themselves automatically to keep even spacing between the rings on either side.
I tried making a sketch in the assembly and using the "Project Geometry" function to add the location of the upper and lower rings to the sketch. I then used the "Dimension" function to create a driven dimension between the upper and lower rings. When I finished the sketch the other rings all updated exactly as anticipated, but when I moved the top ring the projected outline did NOT move, so the other rings did not continue to update.
lease do NOT link me to adaptive coil video tutorials or explain how driven dimensions work when making parts. I am not looking for that, I am looking for how to create driven dimensions between two placed components in an ASSEMBLY.
View 9 Replies
View Related
Aug 31, 2011
In 2012 when in a sketch in an assembly all the stuff under "Format" is grayed out.
You cannot make a dimension driven, nor can you make a line construction or a centerline and you can't change a sketch point into a center point. Do I have some setting wrong?
View 8 Replies
View Related
Jul 26, 2013
I have a flange that I use iLogic and the parameters list to update the different styles. My problem is that my flange won't update until after I hit save and update. My other square flange is not this way. As soon as I change the parameter in my square flange it immediately updates. Is there anyway I can get my round flange to update immediately like my square flange? I attached pictures below.
View 1 Replies
View Related
Jul 22, 2013
I have 4 different sub assemblies , each with a common part , I need to line up all these common parts in my main assembly.
View 5 Replies
View Related
Sep 26, 2012
I'm currently trying to make an automated fence generator with Inventor 2012 driven by iLogic rules.
My model is done now, and my BOM information (description & part number) is set correctly.
Now is my problem some parts are not supposed to be in the BOM at a certain moment.
Example.
If fence_type = 1 Then
Beam-001 = default
Else If fence_type = 2 Then
Beam-001 = reference
Else If fence_type = 3 Then
Beam-001 = reference
End If
But what do write to set BOM status of a part?
Inventor 2013
View 5 Replies
View Related
Apr 18, 2012
I want to create a rule that will warn the user when the plate thickness they are using is not standard. I have already created a multivalue parameter for plate thickness, which lists all standard steel plate thickness's and also allows for custom values.
I was hoping I could create a rule that would prompt a dialogue box warning when the user creates a custom value for plate thickness.
I know this can be done, but like I said, Im bloody useless with iLogic and find it hard to come across relevent examples and/or tutorials online.
View 2 Replies
View Related
Oct 24, 2012
I'm currently using this rule for easy PDF making
SaveLoc = "C:Temp"FileName = ThisDoc.FileName(False)Revnr = " rev_" & iProperties.Value("Project", "Revision Number")PDFnaam = SaveLoc & FileName & RevnrThisDoc.Document.SaveAs(PDFnaam & (".pdf") , True)MessageBox.Show("PDF is aangemaakt in C:Temp", "Document creation",MessageBoxButtons.OK,MessageBoxIcon.Information)
The problem with this is that i want to save without lineweight? is there anyway to do this with this code?
View 2 Replies
View Related
Sep 5, 2012
I have an ilogic rule with multiple Subs. How could I run one specific sub contained in that rule from an iLogic form or another rule?
View 2 Replies
View Related
Jul 6, 2011
i have an iLogic rule in serveral files. Now this rule has to be deleted. This should be done with VBA. I can not find any function to delete a rule using VBA.
I found a function iLogicAuto.RunRuleDirect(rule), but not iLogicAuto.DeleteRule(rule) ...
I can not find any documentation for iLogic/VBA.
View 9 Replies
View Related
Jun 26, 2012
I have an iPart which includes iLogic Rule. When I change iPart by table, iLogic Rules are not triggered.
In iLogic Utilities, there is a button "Rules Triggered by Events", If I use "Any Model Parameter Change", the update need long time, looks like Inventor is "No Response". I like the way "Material Change", but I need "part Number" change to trigger the rules. How can I do it? I tried other events as After Open, Before Save, etc, they are does not work.
View 9 Replies
View Related
Jul 18, 2013
I have a rule setup for drawings. I need the rule to first determine if the there is a flat pattern view present. In other words, if there is no flat patter view, I want to the rule to stop.
I am very green to ilogic and VB. Running Inventor 2013.
View 2 Replies
View Related
Oct 5, 2011
I've caught glimpses of how to do this (For instance, this plugin (Inventor LinkParameters) [URL]...... when trying to actually find information on any documentation of how to get from point A to point B. I can't seem to find anything about ilogic automation / rule creation / ilogic in general, in the object browser at all.
I know code like this exists
Option ExplicitSub RuniLogicRule()Dim iLogicAuto As ObjectSet iLogicAuto = GetiLogicAddin(ThisApplication)If (iLogicAuto Is Nothing) Then Exit SubDim doc As DocumentSet doc = ThisApplication.ActiveDocumentDim ruleName As StringruleName = "Rule0"Dim rule As ObjectSet rule = iLogicAuto.GetRule(doc, "Rule0")If (rule Is Nothing) Then Call MsgBox("No rule named " & ruleName & " was found in the [code].......
(and even fixed the error it gave me due to the original code leaving something out) , but any info on the GetRule method is.
View 3 Replies
View Related
Sep 19, 2012
Is there any way to create a rule to create a substitute on my weldment files?
what I need is something like:
If this document file type is weldment then create shrinkwrap substitute, go to the file (substitute) read the custom iproperty "area" and write to this document custom iproperty "area for sand-blasting" activate LOD Master then delete substitute LOD.
The propose is for purchase department to know the area of the assembly (only the area of visible surfaces).
View 1 Replies
View Related
Oct 15, 2010
Is there any command/option to add a keyboard shortcut for ilogic rule?
Config :: Intel (R) Xeon (R) CPU E31245 @ 3.30 GHz, 16.0 GB, 64bit win7
Inventor 2013 and Vault Basic 2013
View 9 Replies
View Related
Oct 14, 2013
When i trying to create a new ilogic rule i get window with this error:
Spoiler (Highlight to read)System.InvalidCastException: Невозможно выполнить приведение [A]iLogic.CodeSnippets к [B]iLogic.CodeSnippets. Источником типа A является "Autodesk.iLogic, Version=17.0.13800.0, Culture=neutral, PublicKeyToken=null" в контексте "Default" в расположении "C:PROGRA~1AutodeskINVENT~1BinAutodesk.iLogic.dll". Источником типа B является "Autodesk.iLogic, Version=17.0.13800.0, Culture=neutral, PublicKeyToken=null" в контексте "LoadFrom" в расположении
[code]..........
View 4 Replies
View Related
Jun 17, 2013
I would like to make an External Rule that would make an iLogic Internal Rule (with the same code every time). I guess what I really need is a way to drive an Ilogic rule into every part that does not have the rule in the part already.
I know what you’re thinking and just using the External Rule doesn’t work for what I want to do. I need it to be an iLogic Internal Rule.
View 9 Replies
View Related
May 26, 2010
I have an iLogic rule that I want to add to several files that are already existing. Is there an "easy" way to do this other than opening each and every file, creating a new rule, pasting in the code and then saving the file? If I had a macro that would create the rule I could run it with KwikBatch.
Using R2010/11
View 9 Replies
View Related
Sep 26, 2011
Is there someway to launch an external iLogic rule with VBA?. I'd like to add a button to run the iLogic rule.
Inventor Pro 2013 (PDS Ultimate)
Vault Pro 2013
Windows 7 64
Xeon 2.4 Ghz 12GB
View 9 Replies
View Related