AutoCAD Inventor :: ILogic Function To Change Decimal Marker From Full Stops To Commas
Apr 5, 2013
e.g. 25,00mm instead of 25.00mm.
I have a huge list of drawings I need to apply this update to. Updating Styles isn't really an option as we haven't enough consistency in the styles we have used.
Inventor 2013 Certified Professional
Autodesk Inventor Professional 2011
Windows 7 Enterprise, 64-bit
I found out that if you have a dimension that is keyed you cannot use the custom property format in the fx. so how do I get ilogic to convert to fractions rounded to a 32nd.
When I put this (see below) in my code it changes my custom iproperty to a yes-no
I did, a couple of months ago, a part with a rule containing some input boxes. It worked without a bug and set it as a specific template, on Inventor 2012.
I tried to reuse it as a template without changing its rule on Inventor 2013. When the input box pops out and ask the value it needs, if I type "0.2" it says that "string's conversion "0.2" in a 'double' type isn't valid". But if I type "0,2" I have absolutely no problems.
ilogic function to update local styles to match Style Library?
I have a snippet of code that, on a drawings, deletes the current parts list (if one exists), then inserts a new parts list which I want to be up to date with the Style Library.
Autodesk Inventor Professional 2011 Windows 7 Enterprise, 64-bit
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'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...
For an autocad assignment, we have been given a drawing in engineering notation (feet and inches) and have to draw it with SI units dimensions. Doing the drawing was fine, BUT, I drew it in inches and thought that I could change it to millimetres.
I have used the units command initially to set up engineering. Then after drawing returned to units to change to decimal. Dimensions turned out in inches regardless. I also tried the scale command to alter the scale, then dimension , still no luck. I went into the annotation menu got to modify primary units and alternate units and still no luck. Not even my tutorial teacher knows how to do this.
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)
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.
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.
Is there a way to control what the Base Quantity is in Document Settings using iLogic. I want to be able to use a form to change it to a parameter I have created.
I am trying to change the titleblock definition of a drawing when I run my custom ilogic code. Currently (and for the past few years) the drawing name is defined by the drawing properties part number but when I run my code I would like the drawing name to be defined by the model properties part number as shown below:
Currently the textbox for the part number is configured as below:
And I'd like to change it to this:
The code I have to find the part number is as follows:
Dim x = 1 Dim oTxtBox As Inventor.TextBox For Each oTxtBox In oDrawDoc.ActiveSheet.TitleBlock.Definition.Sketch.TextBoxes If oTxtBox.Text = "<PART NUMBER>" Then oStuff =
I want my browser name using iLogic particular change to the part number. I fill in my iproperties, the part number. Then the browser name has to take over the part number.
But i get an error.
doc = ThisDoc.Document Dim oCC As ComponentOccurrence For Each oCC In doc.ComponentDefinition.Occurrences OccName = oCC.Name oCC.Name = iProperties.Value("Project", "Part Number") Next
I want to be able to change the header on a PL in a drawing using iLogic.
I'm able to "find" the PL(s) on a drawing but can't seem to figure out how to access the header property My goal to to change the header to show the P/N of the assembly/part it's created from.
My Current code is below:
doc=ThisDrawing.Document oBOMs=doc.DrawingBOMs
For Each oBOM In oBOMs MessageBox.Show("Found a PL", "Title") Next oBom
In between the for/next loop is where I want to access the current BOM and change it's header depending on the related .iam/.ipt.
I am looking for a rule that will search assembly down all levels and find .ipts with the material of plywood and when found change all plywoods to color Clear - Light.