AutoCAD Inventor :: Using ILogic To Change Model Tolerance
Jul 8, 2013
I need to change one dimension using iLogic. It changes due to the path taken to manufacture the part. In a nutshell majority of the time the "OD" has a +.004 / .000 tolerance and the model is drawn at the minimum size. There are cases when the "OD" has a +.005/-.005 tolerance and is modeled at the nominal size. I've learned some of the iLogic to make the change I'm after but not all. I'm having trouble setting ModelValueType to change the model size.
Trying to get the tolerance on a hole to be what I want. I changed the tolerance on the hole, but my idw did not change. When I went back and looked at the tolerance on the hole, it was back to the original value. No matter what I do, it will not change to what I want it to be in the part. Here is a short video.
The dimension I am changing is .9688 and it keeps jumping back to .9686 when I go back into the hole tolerance.
Tried other values too and they would not take either...
All the values I put in to set my tolerance are being rounded to three decimal places even though the value is four place and I am setting the dimension precision to four place.
For Example: I have a hole of diameter 2.0466. It is to have a tolerance of +.0005/-.0000. When tolerance.setToDeviation is called, the .0005 is strangely forced to .001 and is set as this in the part file. The precision value had already been set to 4 at this point.
I am using the following code in Inventor 2010:
'Create hole feature Call oCompDef.Features.HoleFeatures.AddDrilledByThroughAllExtent(oLinearPlacementDef, dDiameter, kExtentDirection) 'Get hole feature just created Dim oHole As HoleFeature Set oHole = oCompDef.Features.HoleFeatures.Item(oCompDef.Features.HoleFeatures.Count) ' need most recent index
I have noticed that as I increase my tolerance value in CONTACTS in the simulation settings my results will dramatically change.
My initial settings are 0.004" with SEPARATION as default. After completing the automatic constraints, I will manually bond all the necessary components such as nuts to bolts and welds to the plates.
Then if I change 0.004" to 0.5" and leave it as SEPARATION, to pick up clearance holes, etc., the result will resemble the way the assembly should behave.
But if I change the separation to 1.0" (and nothing else) then the simulation will run with results that are not correct, giving large deformations and very high stresses.
I made a 3D model with ilogic to control features to be suppressed or compressed. Because there are lot of features need to do so (need almost 4 to 5 min.) , when I run the rules, it came "Rule timeout" issue as pictures.
I used:
Feature.IsActive (myFeature) = status
to control the feature be suppressed or unsuppressed .
I was wondering if there was a command that will get the file name of the model referenced in a drawing?
The reason I want to do this is because I have various programs to automate drawings, but I have to manually edit the code if i want to switch between using the code on assembly drawings and part drawings.
If i can get the model reference, I can then use a bit of extra programming to extract the extension. (i.e. .ipt or .iam)
Autodesk Inventor Professional 2011 Windows 7 Enterprise, 64-bit
I currently have ilogic code that automatically saves a template Inventor dawing as a job drawing. However the problem I am having is when it does this save it takes forever as it seems to be also saving the linked model also. Is there a way to save this Inventor dwg without saving the linked model? The reason why I do not want this model save is because after the drawing is outputted the user is given options to write part numbers and dxf files if required which requires a model save anyway.
I wish I perform the following code with iLogic. Is it possible to change a model parameter to a reference parameter?
If My_Expression Then' My dimension "d0" is a Driven Dimension' or' My dimension "d0" is a Reference ParameterElse' My dimension "d0" is NOT a Driven Dimension' or' My dimension "d0" is a Model ParameterEnd If
I am using a number of sketches in a skeleton to control multiple solutions.
I am using case statements that apply values to my variables and create my solutions which is working fine however,
for clarity of what is being used in a given solution I want to turn on/off the sketches in my code. I have created a set of model views that when active properly turn off the visibability of the appropreate sketch.
While model view is among the things that can be selected for use in the code, so far as I can tell, I can not find a function that will allow me to set a view true so that it activates the view and my sketches turn off.
how to replace model reference using iLogic in inventor 2012. Basically I have a drawing file whose model reference needs to change with part number(iProperties) .
I've been struggling to perform replace model reference as there is no direct command given for it.
I have a spreadsheet and iLogic driven mater assy to generate different iterations.
I would like to change the scale of a base view on a drawing based on a parameter in my assembly. The idea is to get iLogic to change the view using a simple If / Else statement.
This is what I tried:
If Parameter("0 Generic Assembly v2.2.iam.BP") < 1570 Then ActiveSheet.View("VIEW1").Scale = 1/8 Else ActiveSheet.View("VIEW1").Scale = 1/10 EndIf
So basically the value of "BP" parameter (excel parameter in my assy) would drive the scale of the views. But its not working. Is it actually a sensible method? Can I use in the drawing environment the excel parameters in my assembly?
This is the error message I get when the rule is run:
"Error in rule: View Scale, in document: 0 Generic Assembly v2.2.idw
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))"
Also using the same thinking I use iLogic to populate the drg number field on the drawing based on an excel parameter. The rule works but does not always updates the drawing no upon the parameter change or update/rebuild commands.
I have a automated ilogic model that is then used within a 2D drawing, this 2D drawing then has dimensions on it referenced to the the model.
This model changes in its length the dimension associated with its length then changes but the dimension text then goes outside of the dimension boundary (does not stay central). Is there any code that can scan the dimensions and in effect tidy them up?
I have an ilogic rule created to do a save as .dxf and .pdf from the .idw file. It will then open the .ipt file without any issues. The problem I am having is that I also want it to do a save as .stp of the model after it opens the model. I get the following error.
Error in rule: Save As DXF PDF and open, in document: Save As DXF PDF and open.iLogicVb
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
I would like to be able to use iLogic to get the value of the Comment field of a model's parameters. I have some text there that I would like to display in a sketched symbol. The attached image illustrates what I am seeking.
I'm trying to put a little iLogic rule in my drawing template which triggers as soon as the drawing is opened. The rule asks the user whether the component he's making a drawing of needs to be painted or not. If it gets painted, the paint area (one side only or both sides) needs to be calculated. The result of this is then referenced by a text note in the title block.
I can do the radio boxes with the questions, as well as their If loops, but only when I'm in the model. Due to our, admittedly inefficient workflow, we never have time to specify "minor details" like paint area or spec during modelling, only when we get to drawing level. I'd like to put the iLogic rule inside the drawing template. I'm having trouble referencing the iProperties of the model from within the drawing's iLogic interface.
What I have so far is this rule, which I can run inside the model:
'set dummy variable equal to total areatotal_area = iProperties.Area'start radio box with questionsText1 = InputRadioBox("Will this component be painted?", "Yes", "No", Text1, Title := iProperties.Value("Project", "Description"))If Text1 = True ThenText2 = InputRadioBox("How many sides will be painted?", "Both sides", "One side only", Text2, Title := iProperties.Value("Project", "Description"))If Text2 = True TheniProperties.Value("Custom", "Paint Area") = total_areaElseIf Text2 = False TheniProperties.Value("Custom", "Paint Area") = total_area/2End IfElseIf Text1 = False TheniProperties.Value("Custom", "Paint Area") = 0End If
adding a line or two so that I can run the same rule, but from the drawing.
I'm trying to do this with iLogic, and i'm not getting anywhere. What I need, is to be able get to the iProperties of an associated model that is referenced into a drawing file. I want to make it easier to update the iProperties from the drawing file, without having to open the model file.
Factory Design Suite Ultimate 2012 AutoCAD 2012 | Inventor Professional 2012 | Vault Professional 2012
I then created a Custom iProperty which consisted of the following "formula": Finished Material Size = <Thickness> x <Width> x <Length> Lg.
eg. of Finished Material Result : Finished Material Size = 6 x 25 x 300 Lg.
The problem comes up when dealing with diametrical components as the above formula will only populate for square or rectangular parts. Which would work if I could use iLogic code to populate the Finished Material Size iProperty. I have tried but failed.
First I created another user parameter called "Geometry Type" which has a drop down selection of either "DIA" or "SQUARE, RECTANGULAR".I then created the following iLogic code to set 0 as the value for the "unused" size parameters
If PART_GEOMETRY = "DIA" Then WIDTH = "0"If PART_GEOMETRY = "DIA" Then THICKNESS = "0"If PART_GEOMETRY = "SQUARE, RECTANGULAR" Then DIA = "0" The part I just can't get to work is as follows.
I need some iLogic code which will populate the "FINISHED MATERIAL SIZE" custom iproperty with one of the following based on my "GEOMETRY TYPE" selection. "DIA" would return the following to "FINISHED MATERIAL SIZE": = Ø <Dia> x <Length> Lg.
While "SQUARE, RECTANGULAR" would return the following to "FINISHED MATERIAL SIZE": = <THICKNESS> x <WIDTH> x <LENGTH> Lg.I tried the following code but it does not work:
If PART_GEOMETRY = "DIA" Then iProperties.Value("Custom", "FINISHED MATERIAL SIZE")= "Ø"DIA "x" LENGTH "Lg."If PART_GEOMETRY = "SQUARE, RECTANGULAR" Then iProperties.Value("Custom", "FINISHED MATERIAL SIZE")= THICKNESS "x" WIDTH "x" LENGTH "Lg."
I've seen snipppets of code to get the Sheet name but is there a way to set it via code? I'm thinking it might be useful to set the sheet names to the chosen sheet format (as opposed to just 'Sheet').
I'm sprucing up my drawing template...
Rule #1 is for selecting sheet format (which title block/sheet size / orientation) Rule #2 is for setting iproperty values to populate the titleblock with info. (if required) Rule #1 was based on code from S.Bixler & inventortrenches Rule#2 was based on more code taken from here.
Issue between an i-assembly and i-Logic. So, I have an assembly that includes some extra components that are not always needed and therefore an i-Logic rule takes the decision whether these will be suppressed or not.
Of course this is not a problem however it turns out that I miss some info from BOM according to the suppressed parts ...and all these makes sense following the LOD etc.
A potential solution to keep up to date the BOM while you are excluding the needless components is to create an i-Assembly.
To keep that simple I turned my current Assembly to an i-Assembly and very successfully I excluded various components and of course I included some others by adding extra ROWS.
So far So good
Now I want to apply some dimensional boundaries by using i-Logic rules. According to them I want to allow this i-assembly to jump among these different ROWS that meet the right criteria.
Very rough thoughts led me to the following code...
For example...
If Width > 600 Then iPart.ChangeROW ("..." , "...") 'Row-1' Else iPart.ChangeROW ("..." , "...") 'Row-2' End if
The Problem is that the above code works fine, for a example, in case that I will place an i-part in my assembly... However I am looking to change the row of the actual assembly that as I mentioned before I turned it to an i-assembly
To make this even more clear I want to be able to manipulate my i-assembly with i-Logic rules while this is open in Inv. I don't want to change rows while this is placed as a component or sub-assembly in an another assembly...
I am using Inventor 2012: I have a table with different part numbers. I want to create an iLogic rule to change the color of second solid body in my part for a specific part number.
This is what I did.
If iProperties.Value("Project", "Part Number") = "F22111796" Then Feature.Color("plastic")= "Gray" ElseIf iProperties.Value("Project", "Part Number") = "F22111796V" Then Feature.Color("plastic")= "Gray (Dark)" ElseIf iProperties.Value("Project", "Part Number") = "F22111796N" Then Feature.Color("plastic")= "Gray (Light)" Else Feature.Color("plastic")="Gray" End If
However it does not change the color of the second solid body when I make the part number active.
I have a sheet metal part that I converted into an iPart and I set up different rows with different sheet metal styles. What I want to do is run an iLogic code to change to a specific row which in turn would change the actual material of that sheet metal part....I've tried the snippet iPart.ChangeRow but cannot get it to run the code. I'm not sure if I'm not doing something right or what...
I would like to know if it is possible to use iLogic to change the Hole Type from Through to Tapped as conditions dictate. Is this even possible? I already have a backup plan but wanted to check out all possibilites before I proceed. Using Inventor 2012 SP2.
Before using iLogic, I created lot of iAssembly and iPart. I could change iPart factory member when I need in iAssembly.Now, I want to move everything to iLogic.
how could I change the part by iLogic code?
For example:
I generated "Part1.ipt" and "Part2.ipt",...... (I have hundred of member)
In my assembly, sometimes, I need use Part1.ipt, sometimes I need use Part2.ipt.
Which is the iLogic Code I should to use?
Inventor 2009, WIN XP. Autodesk Inventor Professional 2013 (64 Bit) SP2 Windows 7 Professional Service Pack 1 Intel(R) Xeon(R) CPU E5645 12.0 GB Memory
I got this code earlier from Curtis_Waguespack, and i would like to add a setting... When i run this rule it Derives the assembly, but LOD is set to Master, i would like it to be set to my own (Configurator) LOD...
I don't seem to be able to find anything in this code, that defines LOD...
So far im doing ok with the standard ilogic code, but when it´s API or VBA code im lost.. which leads me to this.. i've been searching the forum back and forth to find a code that performs the feature "Shrinkwrap", and somehow everything i have found so far does not work... even the code example in Inventors help menu under programming, Therefore im trying to solve this with Curtis's code as staring point..
'set a reference to the assembly component definintion.'this assumes an assembly document is open.Dim oAsmCompDef As AssemblyComponentDefinitionoAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition 'define the path and file nameDim sPathandName As StringsPathandName = ThisDoc.PathAndFileName(False)
The attached part has some bad work features on it, but I don't care about that (easy fix). It also contains a rule that simply changes the material from "P AND O" (pickles & oiled) to "201 S/S", for some reason the faulty work geometery causes this rule to throw an "unspecified error". If you delete the bad work geometry the rule runs fine.
We have one ilogic rule with different types of User controled boxes. 1x InputListBox 2x InputBoxes Both InputBoxes appears in the center of the screen. The InputListBox appears in the upper left croner of the screen. That's not optimal for the user This problem only occurs when I call the rule via .net program in the User Interface. The Problem does not occur when I load the rule via runRule in the iLogic Rule Browser.