Since I create sheet metal files in Inventor 2014, the subtype of this parts is not always the same. Migrated files from an earlier version have the right ID.
So my add-in to detect sheet metal parts fails.
I use the
If IV.ActiveEditDocument.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
I have an iLogic rule in which I'm trying to set three user parameters for the gage of each leg of a steel angle. I want Inventor to set the gage based on the length of each leg. Here's the table I referenced for gages: [URL].
In my code, I have a sub called DetermineGage which takes the leg length, whether it's the short leg or the long leg, and determines the gages that should belong to that leg. Inside of that sub it calls on a sub called ApplyGage which then applies the determined gage to the rule's gage variables. The main sub then grabs those variables and applies those values to the actual user parameters.... In theory.
The rule executes ok with no errors, but doesn't change the value of the user parameters; they're always "0". As best I can tell, the "oGage" variables I used in the rule don't even get assigned the correct value, which makes me think the DetermineGage and ApplyGage subs can't even access the oLegLength or oGage parameters to read or set them. I don't want to use global parameters because I've heard that can make programs very unstable over time and is just bad practice. How can I make these variables accessible to all subs IN THIS RULE, no more no less?
Sub Main()Dim oLegShort As Double = Min(G_W,G_H)Dim oLegLong As Double = Max(G_W,G_H)Dim oLegLength As DoubleDim oGage As DoubleDim oGage1 As DoubleDim oGage2 As Double'Short Leg:oLegLength = oLegShort'Call DetermineGages sub to set oGage variables:DetermineGages()On Error Resume Next'If gage parameter does not equal true gage, set it equal:If Parameter("ShortLegGage") <> oGage ThenParameter("ShortLegGage") = oGageEnd If'Assume error means gage parameter does not exits. Create and set equal to true gage:If Err.Number <> 0
I am working on creating a new part file Template. Any useful and productive iLogic functions those are already available.
A while ago, I had seen one that would simply triger when part was checked in or saved. It would check if the material feild was utilzed or forgotten at Default.
share if there are any good iLogic functions that we might benefit from.
C1 Inventor Professional 2013 Vault Collaboration 2013
how the internals of Inventor / iLogic are working.
We have multiple instances of Inventor running on a 12 core workstation so we can push configurations through concurrently - each Inventor instance is assigned its own processor affinity and each instance has its own project which points to seperate directories of Inventor models.
Everything seems to work OK when there are up to 5/6 working concurrently, but as soon as there are more than 6 the iLogic functions seem to grind to a halt - note that the rules are external rules.
For example, this function took 11 seconds to complete when there were 10 concurrent orders processing. :
Parameter("BLANK", "EDGE_FRT_ACTIVE") = "YES" Similarly these functions took 11 seconds in total to complete :
When I run these with less that 6 concurrent Inventor processes, they're are almost instant.
I just don't know where the bottleneck is. I've ruled out :
- Processor (each core never reaches above around 60%)
- RAM (we've got 48GB of RAM, with about 15GB free at worst)
- Disk (disk IO is busy, but it doesn't look like it's the bottleneck)
- Graphics (Inventor is in silent mode, with no UI, so graphics activity is minimal)
From the tests I've done it seems to be the iLogic functions that are the bottleneck. My next port of call is to change the iLogic functions to actual API calls, but I suspect I'll get the same results.
So, my questions :
Is Inventor queing these iLogic API calls somehow (note we're creating a unique instance of the Inventor.Application COM object for each processing thread) ?
Is there an issue with using external rules with nultiple instances?
I used to have an A1 printed sheet of all of the ilogic commands, functions, syntax or whatever you call them. It was all nicely grouped and colour coded etc
Unfortunately I have since moved jobs and lost this and neither me or google can find this again, any copy or link? it may have been a pdf or excel format.
I got here on in my templates, two types of weight - net and gross. I've changed the main property MASS of each PART to be the GROSS weight, so when i have one assembly i always get the total gross weight.
And when i wanna get the NET, I open the BOM, show the proper column with this net weight and then export do XLS to sum all of then..
Now the doubt is, to get the things easier, is there a way to put some code in the assemblies, that could sum all the properties "X" from each part and sub assembly to get the total net weight ?
I got here on in my templates, two types of weight - net and gross. I've changed the main property MASS of each PART to be the GROSS weight, so when i have one assembly i always get the total gross weight.
And when i wanna get the NET, I open the BOM, show the proper column with this net weight and then export do XLS to sum all of then..
Now the doubt is, to get the things easier, is there a way to put some code in the assemblies, that could sum all the properties "X" from each part and sub assemblie to get the total net weight ?
I would like to set the custom property format for all user paramters from an iLogic code. This is what I've come up with. It runs, but it does not seem to alter the custom property format. What am I doing wrong here?
Dim propertyName1 As String = "Mortise"Dim propertyName2 As String = "Cut Length"customPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties")Try prop = customPropertySet.Item(propertyName1) prop = customPropertySet.Item(propertyName2)Catch ' Assume error means not found customPropertySet.Add("", propertyName1) customPropertySet.Add("", propertyName2)End Try'output the custom iproperties and update the fileRuleParametersOutput()InventorVb.DocumentUpdate()'set iProperties 'iProperties.Value("Custom", "Mortise") = ""'update fileiLogicVb.UpdateWhenDone = True
This code creates custom iProperties if the iProperty isn't found. I'd like to add another iProperty called "Resaw" with a Yes/No property type. Is there a way of doing this the way I have things started here?
I have a part number that i want to defined in custom properties.
Then would it be possible to call it out in Ilogic? that way in any drawing doesn't matter where the part number will always be the same for that part when i balloon and the same in the BOM.
When using Inventor with Vault, we have a problem when categorizing custom content center parts in Vault. In short, custom content center parts are incorrectly categorized as "Content Center" and automatically released - as there is no property that we can use to identify these files.
I need iLogic code to trigger when custom content center files are created/saved, wich adds the following custom iproperty "IsCustomContentCenter=True".
for file naming format i use numbering scheme rule.
in the vault browser is eazy to show the description from each part, search by description etc.
but when ia want to select from inventor, for example i want to replace component from vault or add component from vault. i can't see this description.
my question is, how to show the description in the file browser from inventor?
I'm linking an excel file to an .ipt file with iLogic code determining if the Material type is a certian value it will find the correct material thickness. These file work great when working on them thru Vault but when I "Save As Template" and create this file where our other template files are located (not Vault) this fuction does not work. I have realized that I had to place the a copy of the excel file in the same file folder as the template ipt, but even this does not fix the issue.
I recieve this error:
Error in rule: Material, in document: Part6
'MWW Materials (Inventor).xlsx' could not be found. Check the spelling of the file name, and verify that the file location is correct.
If you are trying to open the file from your list of most recently used files, make sure that the file has not been renamed, moved, or deleted.
It seems completly countintutive that just saving the file as a template file would cause this not to work when all files that are required are located in the same file folder. Maybe I need a reference to the excel document within the iLogic code.
I'm trying to use iLogic Design Copy to copy an assembly and all its associated parts to another directory. The assembly contains content center parts. Inventor warns me that the destination file of one of the CC parts (and 18 others) will be overwritten. When I go ahead and copy anyway, the copying process stops at that specific CC part. The Design Copy Progress dialog box states there is an error copying that CC part. When I close the Design Copy Progress dialog box, Inventor crashes.
The error copying the CC part: I'm allowed to use content center parts in iLogic Design Copied stuff, right? I searched some related topics and I'm under the impression that Inventor keeps the CC parts in its own directory and shouldn't be trying to overwrite them.
We are implementing the vault and do not want to have to rename each file with design copy.
Any way where the filename of a part will change according to either assembly pararmenters or iProperties?
Another question I had would be involving a rule that would rename each ipt within an assembly by giving at a suffix/prefix once the assembly is completed.
Is there a way I can open an idw file using ilogic? I would like to put the rule into a form, so that I can click a button in the form to open the idw for my assembly.
Inventor 2014 HP Pavilion dv6t-6b00 Intel Core i7 2670QM AMD Radeon HD 6490M 8gb RAM Windows 7 64 bit 3Dconnexion SpaceExplorer
I seem to have my task accomplished, but Inventor crahes on me after it is done.
Here is how my iLogic works.
' Deleting the suppressed parts from the assembly Dim compDef as AssemblyComponentDefinition compDef = ThisDoc.ComponentDefinition Dim compOcc as ComponentDefinition For Each compOcc in compDef [Code] ........
Now as soon as the last line is executed, Inventor crashes.
But when I go to the save file part (C:MyPath), both the parts and assembly files are saved and if I open it, they work just fine.
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 have an iLogic that runs to create parts and assemblies. These parts and sub-assemblies are for a range of library components which are either part(s) or assemblies or and assemblies composed of parts) and sub-assemblies as well. This iLogic is mostly done despite I have limited knowledge in this area. At the beginning it opens a text file (.txt) by the command line:
ThisDoc.Launch("L:\_Nov 02Info and Input GuideLines.txt")that offers guidelines and instructions.
I would like to how can I close (exit) this text file at a point within or end of the current iLogic because, it opens a several files of the same every time I run the iLogic otherwise.
Is it possible in iLogic to select a file in a dialog box or a browser ?
I need to replace the 3d model on a drawing. I have to ask the user to select the new file to use. How can I select the file using a dialog box or a browser ? The best should be a combobox with the list of opened files, and a button to browse on the disk, like when you create a view.
My goal is to have a message box open as soon as an assembly file is opened so that other users will be warned/ notified of linked parameters. My assumption is that an iLogic rule would be the best way to handle this.
I can create the message box, but when I looked through the iLogic snippets I didn't find any way to trigger the box at opening the file.
I use Inventor 2010 with the iLogic Extension. My question is probably more VB.NEt-related than Inventor-related.
For my parts I usually have a main *.ipt that can receive input parameters and does some calculating with them. Then there are several 'slave' *.ipt that use the calculated parameters of the main.ipt. I would like to keep that structure. Using iLogic the slave.ipt's do some calculation, too, based on an external *.Vb-File. I load that file into the rules of the slave.ipts by using (for example) AddVbFile "External.Vb".
My question is if it is in any way possible to have it so that the name External.Vb can be dynamic? I tried using a new iLogic String parameter and storing the name of the external VB-File there so that I would have a Parameter Name = "External.Vb" and then use AddVbFile Name. But that sadly didn't work at all. My External.Vb is supposed to be unique for every copy of my assembly and having to write the correct name into the rule by hand is tedious.