I'm trying to find a way to add a custom button to my ribbon that will launch a global rule or form using VB. I know of a way using VBA but I want to get away from VBA. I'd much rather create an add with VB and use that.
I am trying to rewrite Curtis Waguespack's ilogic code to modify drawing view labels from this post http: [URL]...
The completed label should appear like this
<Description> - Mk <Part Number> Est Unit Mass = X kg (Scale 1:1)
At this point I have 2 problems
1. I want to add the physical mass to the second line and would prefer to use the calculated physcial property rather than the a custom iproperty. If editing the view label, it would the property access under physcial properties.
2. I want to rewrite the code so it is selective or per view - in otherwords, I only want it to modify a single view I select once the code is run. At this point I know I need to remove the For loop but I dont have a clue as to how to make it selective.
'start of ilogic codeDim oDoc As DrawingDocument: oDoc = ThisDoc.DocumentoModel = ThisDoc.ModelDocumentDim oSheets As SheetsDim oSheet As SheetDim oViews As DrawingViewsDim oView As DrawingViewoSheets = oDoc.SheetsFor Each oSheet In oSheetsoViews = oSheet.DrawingViews For Each oView In oViews oView.ShowLabel = True
How to change the color of layer that will be used within a drawing files for special purposes.
Ideally the code will make the color Red, but change to Black prior to printing.
The "logic" behind the code currently is to differentiate a layer called "Burn" to a highly visible color for the purpose of review by others then, prior to printing, change the color to Black. The firm I'm currently working for uses gray-scale B sided printers only. The firm currently uses Blue for dimension and extension lines so to produce drawings that portray both type of objects "lightly".
I was looking for some iLogic Code for Inventor 2013 that would cycle through all the parts in an assembly grabbing the quantity of each part and setting it equal to the custom property "Qty" of each part.
Having a little trouble creating the for each loop and setting reference to each part without referencing each part by specific name.
After changing colors at assembly level only ,below is a rule that changes all parts that have material "Plywood" to poplar works great.
However I want a rule that does the same kind of change but on only temporally at assembly level only then we can change back to default colors by removing color override.
It would be good if we can do the following
Search assembly for .ipt files that have material that contains PlywoodChange to color using temporary override of "Clear - Light" Possibility of searching more materials within same rule ie : "Timber" to be black in color"Pvcu"to be white in color
Dim oCurrentDoc As Inventor.Document Dim oDoc As Inventor.Document Dim oPartDoc As PartDocument Dim oRefDoc As DocumentsEnumeratorDim oTargetColor As RenderStyleDim oNewColor As RenderStyleoCurrentDoc =
' material thickness from multi-value parameter called ShThk
If ShThk = 0.3125 Then SheetMetal.SetActiveStyle("5/16"& Chr(34)) Else if ShThk = 0.25 Then SheetMetal.SetActiveStyle("1/4"& Chr(34)) Else if ShThk = 0.1345 Then SheetMetal.SetActiveStyle("10ga") else if ShThk = 0.105 Then SheetMetal.SetActiveStyle("12ga") else if ShThk = 0.1793 Then SheetMetal.SetActiveStyle("7ga") End If
I've been using iLogic. I'm creating a template assembly that will be used for multiple jobs. Therefore, the job number will be changing. I want a custom iProperty in ALL parts and sub-assemblies (cleverly call it "Job #" maybe) that I can include an a separate property called "Drawing #" which whose value will be [some text]-<Job #>-[some more text]. I want to be able to update all the "some text" parts manually for each component, but I want the Job # to update automatically. I need this property because I have a column in all my Parts Lists called "Drawing #" which tells the drawing number for any given part or assembly.
Ultimately what I want to do is open a text or Excel file, enter the job number, open my Inventor drawing, and have every Drawing # entry in every parts list magically update to the correct job number.
I've managed to use iLogic to do just that with a single .ipt/.iam file. But I have dozens upon dozens of components in the main assembly. I'd like to run some rule or hit some button or do something that will cause the Job # property to update for ALL sub-assemblies and parts, so that all my parts lists reflect the change.
I'm looking for a way to change the size of a custom content center part via ilogic. I found a way to replace them on this forum but this is not ideal for, because that creates a new part every time i change the size of the part.
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".
I am looking for a way to log out of vault from within Inventor using iLogic codes. I have created an iLogic rule that automates export an assembly drawing and all sub component drawings. In my code, I have suppressed all Inventor prompts but I do not have a way to suppress Vault prompts. I can manually log off from vault and run this rule without any problems. However, if I forget to do so, I am stuck responding to update requests from vault and check out requests constantly for each and every file.
I recently created some iLogic based components. I wonder how difficult it is to protect the iLogic code, similar as VBA code which can be password protected.
The reason being:
1. Of course, to hide & protect the creator's modeling logic;
2. To avoid the relation between parameters being messed up by the end user unintensionally.
I did have the opportunity to raise the question during the Portathon event and the answer was that the protection not directly available, though the workaround could be mixing with some Inventor API coding in .NET.
However, this might defeat one of the benefits of iLogic, simple and ease to use, gentlr learning curve, especially for users with VBA experience. .NET might not be so easy for a lot of engineers from mechanical or other disciplines.
1 Disable the "Edit" button for iLogic components, including rules, forms, etc.;
2. Put all code that are to be protected in an external file, and then make that file unreadable (password protected, or other protection) to un-intended user, however, readable to those who have proper access privelege.
A while back I figured out how to put a few characters before and after several lines of code in iLogic to make it compress to one line or expand to its full size inside the code editor. I belive this is a fairly common VBA command, but I can't figure out how to do it again.
Inventor 2014 HP Pavilion dv6t-6b00 Intel Core i7 2670QM AMD Radeon HD 6490M 8gb RAM Windows 7 64 bit 3Dconnexion SpaceExplorer
I am trying to use a code window plugin on my website, and would like to create a temple for iLogic code. Is there any way to output iLogic code in a format that would work?
I cannot modify any of the existing templates because iLogic requires information as to whether to make some text brown or blue, and it would need some form of output to do that.
The instruction page is here: [URL]
I have been manually highlighting or using images, but both have their problems. (cut & paste will lead to a pile of errors with the manual highlighting). I can create the css file, but need some form of output beyond cut & paste to work with.
If something is worked out, it will be added to the program and be available to everyone free (this is a Wordpress plugin).
Self built computer with;
Quad core processor 16 gigs ram Raptor Raid main drives 2 x 1TB Caviar Black storage drives local 2 x 1TB Caviar Black storage drives network backup
Main Software; Product Design Suite Premium Windows 7 Home Premium [URL]
I have a iLogic rule for saving drawings (dwg) to a pdf file in a designated folder. Everything worked well until this Monday morning. Now I get the message: Error in rule: Save2PDF, in document: 13006-027 propflens-1.dwg Value cannot be null.
However, I have one iLogic routine that is giving me an error whenever I run it. Selecting continue allows it run as expected. Basically, it is to remind designers to set the material type to other than “Default”.
Here is the Materialsddd = 0' deleted parameter materialName = ThisDoc.Document.ComponentDefinition.Material.Name If materialName = "Default" Then MultiValue.List("MName") = iProperties.Materials MName = InputListBox("Select Material", MultiValue.List("MName"), Mname, Title := "Select Type", ListName := "MM List") iProperties.Material = Mname iLogicVb.UpdateWhenDone = True The Parameter MName does exist as a mulitlist parameter.
I was working with ilogic, Adding a new rule and all of a sudden I got an error and when I double click on a parameter to add it to the code, the format changed.
It used to look like this when I added a parameter: Parameter("vertical seperation:1", "partitionthickness") but now when I double click on a parameter I get this: vertical seperation.ipt.partitionthickness
Also when I right click on a parameter and select display current state, It does the same thing, for some reason the code does not display like it used to.
I got an error when this first happened and I tried reproduce the error again but it did not appear again. This affected all my parts and even in different projects.
I re installed inventor because I thought there might be a file link broken but it did not fix it.
I have put together some ilogic code which is embedded within a part template, this auto populates the iproperties with the profiles length,width and thickness, and also automatically updates when any changes are made to the said profile When I hit save.
This works a treat when creating new parts, the problem arises when re-using old parts from previous jobs (Which is a regular occurrence),prior to when the code was created.
So I have to run the code as an external rule, but this has caught me,and a few other people out, as we have forgotten to run the rule after making a change to the part so the iproperties aren't automatically updated.
My question is, is there a snippet of code that I could add to my code, which embeds the the externally ran rule to the Ipt?
I've managed to cobble this code together to turn some sketch visibilities on and off. However, what I'd really like to do is have a single sketch containing some blocks, and turn the visibility of the blocks on and off... How to call the blocks -
'Iterate through the sketches collection'Turn the edging indicators On And Off For Each oSketch In oDoc.ComponentDefinition.Sketches Select Case oSketch.NameCase "Front Edged"If E01 = True Then oSketch.Visible = TrueElse oSketch.Visible = FalseEnd IfCase "Top Edged"If E02 = True Then oSketch.Visible = TrueElse oSketch.Visible = FalseEnd IfCase "Back Edged"If E03 = True Then oSketch.Visible = TrueElse oSketch.Visible = FalseEnd IfCase "Base Edged"If E04 = True Then oSketch.Visible = TrueElse oSketch.Visible = FalseEnd IfEnd SelectNext