I am trying to enter some material ordering info into an external spreadsheet, and have that info reflected in a text box within an idw drawing file.
My method is as follows:
Obtain a numerical value (250) from an external Excel spreadsheet (sample.xlsx).Assign this value to a parameter (abc) in an idw file (Materials Ordering.idw).Insert parameter abc I made into a text box within the same idw file.
I made a set_parameters rule, and the ilogic text of the above example is as follows:
'Open File and Scan line - Part = Impeller Casing Flange i = GoExcel.FindRow("sample.xlsx", "Sheet1", "Part", "<=", "Impeller Casing Flange") 'abc = Material Width abc = GoExcel.CurrentRowValue("Material Width")
I had no problems with the first two steps, after checking the parameters I could see that parameter abc is being updated successfully.
However, I am having trouble with the third step. In the format text dialog box, I can see a drop box for components, but I can't find a reference to the idw file in there.
My question is, am I going the wrong way about this? Should I have assigned the parameters to a component instead of the idw file?
I want to import the parameters from the .ipt file into the .iam file using a rule from iLogic (unless there is another way to do it?)
I pinched the code from the example hand rail iLogic part that comes with inventor and tweaked it to suit. After inputting the code shown in the image, when I click OK I get a 'fatal error' of some sort.
I have lots of files that are linked either by length, height, etc.. Is there an option to delete all linked parameters. I would also like to keep the part history (cuts and extrudes).
I wonder if there is an option to delete all at once like iLogic option-"delete all rules" or should be deleted individually.
I'm having some difficulties with iLogic and reference parameters.
I have made a tube with a weird shape and I want to measure the longest length. So I have to cut the tube in a certain angle in relation with the center to measure the length.
The problem is that this angle is really hard to calculate.
So I tried making a rule where I can make my angle shift x degree and then measure the longest length. If the measurement is larger the previous measurement the angle will shift x degree again until the measurement is smaller than the previous.
So I made my starting angle 0 degree, I know this is for a fact not the longest length. And then I tried this rule. (before making a While rule).
And I noticed that on screen the measurement changes. But the reference - parameter stays the same. So it gives me the measurement on the starting angle & after rotating it again gives me the starting angle.
How can I get the parameter to update itself in between?
Dim measurement_length As DoubleDim measurement_length2 As DoubleMessageBox.Show("Start angle ", "My iLogic Dialog", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)angle_measurement_spec = 0RuleParametersOutput()InventorVb.DocumentUpdate()measurement_length = [code].....
I would like to save parameters marked as Key to an XML-file (from an Inventor addin, VB.NET):
Dim addIn As ApplicationAddIn = m_inventorApp.ApplicationAddIns.ItemById("{3bdd8d79-2179-4b11-8a5a-257b1c0263ac}") 'iLogic addin addIn.Activate() Dim iLogicAddin As Object = addIn.Automation iLogicAddin.ParametersXmlSave(invDoc, "c: emp ext.xml", iLogicAddin.XmlSaveOption.KeysOnly) This doesn't run: "Public member 'XmlSaveOption' on type 'iLogicAutomation' not found."
In the attached file there is a User Parameter, "Antal_ledekasser". Inventor has calculated its value to 2.
If you do the math by hand then you see the value should be 5.
Rebuild doesn't force recalculation.
There is an iLogic rule in the part, but this also fails to force recalculation: iLogicVb.UpdateWhenDone=True InventorVb.DocumentUpdate() ThisDoc.Document.Rebuild2 ThisDoc.Document.Update2
Manual work around is to change the formula, then the value is recalculated.
iLogic work around is to change a parameter-value - and run the rule TWICE.
Question: How do I force a real rebuild, that actually wil recalculate parameter-values the first time I run the iLogic rule?
Background: The attached file is a little subset of the skeleton in a large assembly that is controlled by iLogic. The rules are placed in the topassembly, and writes vaules to the skeleton-file.
After writing values to skeleton-parameters I try to force them through with this iLogic RuleParametersOutput() InventorVb.DocumentUpdate() iLogicVb.RunRule("Skeleton", "Update")
Later in the process I use calculated values to decide which components should be active. But my logic fails because my decisions are made on faulty values.
I did manage to get the updating work in 2011. But after migrating to 2012, it seems impossible to have it update correct. The user has to run rules several times, and doing manually updates to get a correct model.
I want to export reference parameters to an excel table using i-Logic
I found the function GoExcel.CellValues("filename.xls", "Sheet1", "A2", "A10") = MultiValue.List("d0")
It looks like the syntax calls for the file location and name if the xls file is not open and if open is not supposed to be required.
I have entered it both ways and with and with out the target file open and with the function GoExcel.Open("pathFilename.xls","sheet1") and continue to get the error:
we couldn't find C:AbellAbell VaultWorkSpaceDEVELOPMENTAC100-0100MRLTEST Table.xls. Is it possible it was moved, renamed or deleted?
Also, I was expecting that to fill in the sheet cell's would be MultiValue.List("d0","d1","d2")
but the system give me an error that says
Error on Line 3 : Overload resolution failed because no accessible 'List' accepts this number of arguments.
iLogic code question concerning how Place iLogic Component and retain the ability to push parameters from the subassemblies to the parts after being renamed.
I have ASSEMBLY.iam containing:
SUBASSEMBLY-01:1.iam SUBASSEMBLY-02:1.iam and sometimes SUBASSEMBLY-02:2.iam
each SUBASSEMBLY.iam contains PART1.ipt and PART2.ipt which have variable LENGTH and WIDTH. LENGTH and WIDTH are entered manually at the SUBASSEMBLY.iam and are infinitely variable.
To transfer the parameters I'm using iLogic code in the SUBASSEMBLY:
Issue 1: When I place the SUBASSEMBLY as an iLogic Component, the parts are renamed to PART1-01.ipt which renders my Parameter transfer useless. What am I missing on writing this code so it can find the new part name?
Issue 2: I like the automatic renaming that happens with Place iLogic Component. Is there a better way to handle this automatically through Place Component -> Save & Replace?
I am looking for information on the option parameters, any documentation?
I found some code to query what parameters there are (Rule: GetTranslatorOptions), just not sure what the enumerations are for some.
Specifically: ExportUnits, Resolution
Using Rule:ExportSTL
I have changed the Export Units from 1 to 4 and do not see any change to the STL ASCII output.. not sure what this parameter does... Expected it to be an enumeration of the drop-down box that you see during "manual" exporting.
I have this little iLogic snippet that writes out the name and value of all parameters in active document.
doc = ThisDoc.Documentparams = doc.ComponentDefinition.Parametersnames = New List(Of String)values = New List(Of String)For Each param In paramsIf Len(param.Name)>4 Thennames.Add(param.Name)values.Add(param.Value.ToString)ElseEnd IfNextMultiValue.List("ParamsList") = namesMultiValue.List("ParamsValues") = valuesGoExcel.CellValues("COVER.DEFAULT.PARAMS.xlsx", "Sheet1", "A2", "A400") = MultiValue.List("ParamsList")GoExcel.CellValues("COVER.DEFAULT.PARAMS.xlsx", "Sheet1", "B2", "B400") = MultiValue.List("ParamsValues")GoExcel.SaveGoExcel.Close
The problem is it ignores the parameter's units and assumes cm for length and rad for angular. I need another nested IF - Then that says:
IF param.Values.'UnitType' is "in" THEN param.Value = param.Value/2.54 Else If param.Values.'UnitType' is "deg" THEN param.Value = param.Value*360/2/3.14159 End If
Is there a way to work with parameters on a suppressed assembly using iLogic.Everything works fine, but when I suppressed a part ilogic rule give me an error: Parameter: The component named "xxxxx:1" was not found.
Is there a standard command or command sequence that allows for the changing of a parameter, say length, of a component from within an assembly. I'm looking to compile a code that allows for a template to be created, then that template will do changes based on text box input and then save out the modified parts with new part numbers.
I need import all new params, rules and forms from a new template to older parts. I'm trying to use an external rule to create a new iproperties and import params from xml file but I can't assign these parameters with these iproperties.
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 have two user parameters saved in a part template that are tied to the part volume and an overall estimated part weight. The user parameter Pc_Volume is the volume in cubic feet and calculated by pulling the part mass (in cubic inches) and converting to cubic feet via ilogic rule. This is then automatically run via event triggers before a file is saved and if the part geometry has changed to keep the volume up to date. These are exported because they get pulled into iproperties of our drawing files as well as used to create a parts lists showing the volumes and weights.
I have the property formats of the user parameters set to Number and to unitless and the unit display turned off so it does not show on the parts list, with a precision of 0.000 for Pc_Volume. The Pc_Weight is set the same way however with a precision rounded to the nearest whole number.
These are created this way so when we use the part file as the template when we select "Make Components" to separate our parts and tie them to an assembly all the files are then updated and the information saved for exporting.
The problem is, the Pc_Volume always comes in rounded to a whole number. The Pc_Weight Does as well, but that doesn't bother me since we want it to do that anyway. If I would go into the part file after it's created, double check the precision and then re-run the rule the volume will show up with the correct precision in the exported parameters. I don't want to have to open each partfile however to get this to update.
Attached are images of the parameters, ilogic rule, and exported results.
how to delete iLogic forms from Inventor 2013 parts/assembly using VB.net 2010?
I am able to delete all the rule using "Activated_iLogic.DeleteAllRules(PartDoc)" but "Activated_iLogic.DeleteAllForms(PartDoc)" or "Activated_iLogic.DeleteForm(PartDoc, FormName)" does not give me the result I was expecting and Google is not showing any result related to this.
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 know how to add user parameters with ilogic, but i would like to dete them as well. I've tried to use the delete option as mentioned in the API but I cann't get it working in ilogic.
In 2009 Inventor iLogic, we have a button to delete all parameters and rules. But now, in 2013 Inventor iLogic, I only find a button to delete all rules. Where is the button to delete all parameters?
How can I delete one Sketched Symbol from my Drawing ? It wont be in use in any sheet, i just need to delete it and the recreate with my code, so by this way the symbol is updated.
The other part of the code is created already, just need this part to delete. I found some ways but just delete the symbol from the sheet, not the source symbol. How can i delete it then ?
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 made an Part with iLogic rules, let's call it "iLogicPart". The rules inside could create lot of different part by my input.
I want save the different parts to different name as "Part 1", "Part 2", etc. I used SaveAs to get them.
My question is: I want to delete all rules and parameters in the saved parts as "Part 1", "Part 2". And I have lot of features (the name is hard to track) which are inactive, I want to delete them at same time too.
I could manually do so, but I want to use rule to do so automatically.
My goal is to open have people go into a central assembly file, type in their specific parameters and the various part files update within the assembly. I wish to do this without the need for an excel sheet, but when I try to link the parameters from the assembly file to the part files, it will not allow me to insert these parts. I get an error about an "assembly can not be placed into itself."
Iparts will not work as this has an infinite amount of sizes.
I linked an excel (2010) file with an inventor (2011) .ipt and none of the parameters are showing inside inventor. I was leaving the file external but I embed it also as a trouble shooting step and nothing still. I have no spaces in excel sheet. Is there something special i need to be doing inside excel or inventor?
I would like to have a rule that will add specific user parameters to a part file. These parameters need to be formatted so the width, depth and thickness will control the description of the part.
IE:
Width=4
Depth=2
Thickness=3/16
DESCRIPTION = TS <Width>X<Depth>X<Thickness>
I would like to format each parameter so that the: