AutoCAD Inventor :: ILogic Rule To Print String To Parts List?
Mar 5, 2013
I am trying to make an iLogic rule that gets mutliple strings from different places, and prints them to a user property in the Parts List.
My ultimate goal is to print the drawing number, sheet number and the item column value to the user property with the format being...
"XXXXX-X-X"
So far, i can get the drawing number from an iProperty and the sheet number easily. But im getting stumped on obtaining the item coloum value and printing it to the same row.
This is what i have so far...
Dim DWGNUM As String = iProperties.Value("custom", "DWG Number")
SheetNumber = Mid(ThisDoc.Document.ActiveSheet.Name, InStr(1, ThisDoc.Document.ActiveSheet.Name, ":") + 1)
MessageBox.Show(DWGNUM+"-"+SheetNumber, "DXF Number")
And print the message box output to a column in the parts list
View 7 Replies
ADVERTISEMENT
Mar 5, 2013
I'm trying to create an iLogic rule that will print a text string to a cell or coloum of a parts list in inventor.
My code so far...
Sub Main()
On Error Resume Next
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
[code]......
I want to print what is in the Message Box into a cell in the parts list, and i am stumped. The cell i am trying to print to is a user property in the Parts List.
View 1 Replies
View Related
Mar 5, 2013
I'm trying to create an iLogic rule that will print a text string to a cell or column of a parts list in inventor.My code so far...
Sub Main()
On Error Resume Next
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
[code]...
I want to print what is in the MessageBox into a cell in the parts list, and i am stumped.The cell i am trying to print to is a custom property in the Parts List.
View 3 Replies
View Related
Jul 2, 2013
I need an ilogic rule to autmoatically change the style of the parts list in a drawing file.The parts list style already exist in the drawing.
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 4, 2011
I try to filter an Excel List and therby fill certain Multivalue Parameters with the filtered data.
The filter works fine an provides me a string looking like the sytax for the MULTIVALUE.SETLIST command.
B6string = FilterReturn & Chr(130) & B6String = 75‚80‚250‚65‚45‚250
Unfortunatly this string gets exactly as ONE entry in the Parameters Value listing !
MultiValue.SetList("B6_Lochbild_Länge", B6String)
I also tried
MultiValue.List("B6_Lochbild_Länge") = New Integer () {B6String}
and also
B6string = Chr(148) & FilterReturn & Chr(148) & Chr(130) & B6String
with the same effect !
View 2 Replies
View Related
Aug 10, 2012
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.
View 9 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 4, 2012
I curently have a rule that generates a part list automatically in a drawing. the problem is that I want the rule to be continuisly running but it keeps generating 2,3,5... parts lists. I need an if statment to check if a parts list already exists.
iLogicVb.UpdateWhenDone = True On Error Resume Next ' Set a reference to the drawing document. ' This assumes a drawing document is active. Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument 'Set a reference to the
[Code].....
View 2 Replies
View Related
Jun 19, 2013
im trying to programatically add a parts list into a drawing whilst programatically creating the drawing - the code works fine without the parts list code. The error its showing is 'Parameter incorect' on the line that sais PartsList.add(... In the past when ive got this error with other code it has been because ive used an incorrect parameter (e.g. decimal instead of an integer).
My error is somewhere inside the oPartsList.add(>>ERROR SOMEWHERE HERE<<<)
oDrawDoc = InvApp.Documents.Add(Inventor.DocumentTypeEnum.kDrawingDocumentObject,AssyTemplate,True)
oSheet = oDrawDoc.Sheets.Item(1)
[Code].....
View 1 Replies
View Related
Nov 18, 2010
I need to generate an iLogic rule exporting Parts List (not BOM) from a IDW to a specific folder in XLS format.
Using Autodesk AutoCAD Inventor 2011
View 9 Replies
View Related
Nov 7, 2011
I have got some ilogic code that i have patched together to sort my parts list in inventor which works great but it will not update all sheets at the same time as when we design we have multiple sheets with parts list on and the odd one without.
add to this code to update all sheets partlists and also recognise that some sheets will not have partslists on so this will need to skip.
below is code that is used to sort
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 4558 StartFragment: 314 EndFragment: 4526 StartSelection: 314 EndSelection: 314
SyntaxEditor Code Snippet
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 4558 StartFragment: 314 EndFragment: 4526 StartSelection: 314 EndSelection: 314
[Code] ...........
View 4 Replies
View Related
Feb 8, 2012
Below are 2 rules that run in succession to create and save a parts list from a base view in a drawing.
I am now trying to set the parts list style to a custom style, ideally while creating the list.
Also, I have to manually go into the list to turn off visibility of certain items (based on material), does I can do this with Ilogic? I ask because these steps precede a rule that automates placing base views of all parts in the parts list. If I could get the style and visibility right, I could automate the entire process.
Looking for changing such a style with ilogic?
Inventor & Vault Pro 2012
Windows 7, 64bit
Core i7 920@2.67
8GB
CREATE PARTS LIST____
' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
'Set a reference to the active sheet.
[Code] .....
View 9 Replies
View Related
Oct 31, 2011
I am creating a drawing controlled by ilogic. The assembly can vary in size considerably so I have set the IDW to change between sheet size A3 and A2 accordingly using ilogic. However, when the sheet size is changed, the parts list stays in a static position.
Currently, the parts list is situated in the top right corner up against the title block and the border. So when changing from Size A3 to Size A2, the parts list ends up in the middle of the page. Is there anyway i can control the position of the parts list so it changes with the sheet size change?
I know I could simply move the partslist to the bottom left corner, which is a work around. However, I'd like to be able to keep the drawings in line with the company standard.
View 1 Replies
View Related
Apr 4, 2013
I am Trying to add the category Field to the parts list, if a sting exists in the field. I want to run this as a rule at the Drawing Level. I can check if there is a sting in the Category Field But not sure how to add this in the Parts List.
View 4 Replies
View Related
Aug 21, 2013
At my company when producing drawings for manufacture we require a sheet for any steel profiles to be cut!..We do this by selecting the assembly from base view,hitting model view tab, selecting presentation and choosing the relevant profile from the drop down!
Once the profile is placed, we highlight the view and hit the parts list tab which obviously creates a parts list, but for the whole assembly, we then have to edit the parts list by turning off the visibility of the lines of all the parts which are not relevant!!...as you can imagine this is quite a laborious task if you have 50 different profiles.
The reason for this is to show the qty, steel grade and part number to the suppliers. My question is, any code that will take the lines of the parts list that are not relevant to the selected view and turn the visibility of those lines off?
View 1 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
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
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
May 9, 2013
Seeing this error
Error on Line 10 : 'SealString_1' is not declared. It may be inaccessible due to its protection level.
Dim SealString_1 As String Dim SealString_2 As String Dim SealString_3 As String Dim SealString_4 As String Dim SealString_5 As String Dim SealString_6 As String Dim SealString_7 As String For Each S As String In SealString_1.Split(",") If i = 0 Then name = S If i = 1 Then name = OD If i = 2 Then name = ID If i = 3 Then name = DE If i = 4 Then name = LI i = i + 1 Next S
View 1 Replies
View Related
Jul 14, 2013
Where do I find ControlDefinitions Cmd list in Red String.
The question is link of this: [URL] .....
View 1 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
Aug 29, 2013
I have a three part question. First, I have an iLogic routine in an assembly that opens all the parts within the assembly, runs a particular rule, and then closes that part. Is there anyway I can get this to run in the background. I don't want my users to see all of my part files opening and closing.
Here is my
'assign path values in iproperties to be equaliProperties.Value("RD FLANGE:1","Custom", "FilePATH") = iProperties.Value("Custom", "FilePATH")Dim FilePATH As String = "FilePATH"customPropertySet = ThisDoc.Document.PropertySets.Item _("Inventor User Defined Properties")Try prop= customPropertySet.Item(FilePATH)Catch customPropertySet.Add("", FilePATH)End TryIf
[code].....
My second question is how do I add a routine that as the part files are opened checks to see if "MyRule" is there. If "MyRule" is not there add "MyRule" else if "MyRule" exist move on to the next part.
My third and final question is there anyway for my code to distinguish between standard parts and sheet metal parts. Basically, if the opened part is not a sheet metal part then I do not want "MyRule" to be inserted and I do not want "MyRule" to be run. I want it to move on to the next part within the assembly.
View 5 Replies
View Related