AutoCAD Inventor :: Part Occurrence - Rules Definition Name Have Been Overwritten
Jul 23, 2012
I have several parts that are controlled by ilogic rules linked to member names ,and in some cases some of staff run the productivity bonus tool (rename browser nodes) to either file name or part number.
This causes the rules to fail as rules definition name have been overwritten.
I am after a simple rule that is triggered on save to save my occurrence browser name to what originally was defined
Dim Browsername As String = Plywood 01
Member names example
Plywood 01
Plywood 02
Plywood 03
Plywood 04
View 6 Replies
ADVERTISEMENT
Sep 28, 2012
I have a simple code below trying to iterate through all the assembly component and copy the iProperties > Occurrece Name (i.e. "Part1:1") and paste it to iProperties > Project tab > Part Number field for each individual part in assembly.
' 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
The Debug message shows the correct output for every iteration, but when I check each part's properties they all have the Occurrence Name of the last part in the aseembly.
View 4 Replies
View Related
Sep 5, 2013
I have an assembly which contains a CComPtr<ComponentOccurrence> pThisCompOcc , and I'd like to do two things.
Get the name of the "base" object, not the display name of the occurence Change the model and user parameter values of the occurrence I suspect that I need to find the function or method which gives me a CComPtr<PartComponentDefinition> pPartCompDef which the occurrence points to for the Q1, but what about Q2?
Presumably the parameters are associated with the Component Occurrence and the "real" name is associated with the Part Component Definition?
View 6 Replies
View Related
Dec 8, 2011
I have set iLogic to change a rectangular pattern to a certain amount of occurrences depending on which is selected , i.e. 117 cavities, 140 cavities and 96 cavities. Only one is active (or unsuppressed ) at a time.
What I need to do is suppress the 4 corners of each pattern, considering there's only one pattern and is dynamic.
View 2 Replies
View Related
Jul 9, 2013
I downloaded a model off a website, it is, (excuse my electrical background ignorance) a jumper for terminal blocks.Our electricians use these and cut them down to size as needed.
Is there a way to use iLogic and a form or message box, to prompt upon opening the part as to how many jumpers are needed for the current assembly> It comes stock with 10, but they sometimes only use 2, 3 4 etc. etc..
I didn't model the part, but I can if it will make the rule easier to write.My idea I suppose was to have the part modeled with 2 jumpers and then use ilogic to create more if necessary.
View 4 Replies
View Related
Apr 26, 2013
I want to use a parameter in my assembly as the name of a part i'm referring to in a rule but so far I have had no luck making it work. My knowledge of iLogic is pretty limited.
I am making a configurator for a staircase and I am working on the stringers now. There will be 3 or 4 different stringers (each one is a separate part) and the configurator lets you choose things like the angle, length and height of the staircase by entering values for those in a form in the assembly. Once you are done entering the values, there will be an update button that will send all the parameters to the different parts that are in the assembly and have them change accordingly. Now, say I want the length to change. I enter a length and press update and here's my problem. To which stringer-part is it going to send the length to? I can make it send to all parts but that means that I have to write one line of code for each part and if I ever add a new kind of stringer, I need to check all the rules and new lines where needed. I would like to make this dynamic by having only one line in which the part name is the same as a parameter I have in my assembly
I can either write it like this:
Parameter("Stringer1:1", "Length") = LengthParameter("Stringer2:1", "Length") = LengthParameter("Stringer3:1", "Length") = LengthParameter("Stringer4:1", "Length") = Length
But I would like to write it like:
Parameter(""Assemblyparameter":1", "Length") = Length
Where Assemblyparameter is a text parameter and simply the name of the part that is inserted.
When I choose, for example, stringer 3 in my form, Assemblyparameter will be Stringer3. This would save lots of time in the future whenever new parts are added.
View 2 Replies
View Related
Aug 9, 2012
Basically I want to place parts and have them automatically connect to each other based on pre-existing UCSs on the assemblies. I have a 'ucs_in' and a 'ucs_out' on each assembly. I want the inserted component to perform a transformation to make the new occurrence's ucs_in to "mate" to the previous occurrences ucs_out. By mate I mean their center points are at the same location and all axes are pointing in the same direction. I have included screenshots to show what I'm working with and what I am trying to accomplish. I have also attached the project files.
Below is my attempt at the code to do this. My experience with transformations is limited so I may be way off from where I need to be.
Sub UcsMate() Dim doc As AssemblyDocument Set doc = ThisApplication.ActiveDocument 'assuming both occurrences are already in the assembly and both have 2 UCS, "ucs_in" and "ucs_out" Dim occ1 As ComponentOccurrence Dim
[Code]....
View 3 Replies
View Related
Aug 22, 2013
From a main assembly I am trying to change the visibility of occurence that are in a sub assembly. But everytime I change the visibility using the designviewrepresentation.setvisibilityofoccurrences(), that change the visibility of those occurrences in the other sub-assembly. Of course, if I do it thought the interface that works great. Anyone did something with changing visibility of sub component.
View 1 Replies
View Related
Jul 17, 2013
I have a wire trough that we typically use on all our units. Instead of modelling each trough as it's own separate part to length, I would like to add this part to frame generator for tracking there cut lengths etc...
A few items, there is two sizes that we use, but for now I will work with just one.
I have modeled the part and renamed the important parameters.
-WIDTH - stays the same
-HEIGHT - stays the same
-LENGTH - adjusted by frame generator
-RIBS - the part has 6 currently, but there is a rib added for every 1/2 inch. it is a rectangular pattern
-SLOTS - will be added to the trough every 2 inches of length, it is a rectangular pattern
-SLOT_DISTANCE - is 2 inches and never changes, if the trough is cut on a slot, which ever is easiest, to show half a slot or none, doesn't matter, this is just for a visual and BOM reference
I found a video that shows me how to publish parts to FG, but I am stuck for the iLogic part. Part attached.
Inventor Professional 2014-Update 2 - AutoCAD Electrical 2014
Win7-x64 | ASUS P8Z77-V | i7 3770 -3.4 GHz | 32GB RAM |
240GB SSD | nVidia GTX 670 4GB - 320.49
View 6 Replies
View Related
Nov 25, 2011
I have lost several days of work when Vault has overwritten my local files, about 5 iam and 20 ipt-files. I think it started with a crash and then when I reopened my main assembly it was 13 days old.
It seems that I have forgot to check in my local files to Vault since that date. I am not sure how it happened but I suppose I have answered the question (about replacing local files by older versions from Vault) wrong. Is there any possibility to restore my overwritten files?
View 1 Replies
View Related
Nov 6, 2012
how to get the orientation angle of an occurrence using VBA?
View 2 Replies
View Related
May 21, 2013
I would like to export the Current Offset from Parent Assembly Origin values (X Offset, Y Offset, Z Offset, X Angle, Y Angle, Z Angle) for each part in an Assembly. These values are found in each component's iProperties under the Occurrence tab.
View 9 Replies
View Related
Feb 12, 2013
I try to retrieve the values of an occurrence in an assembly document, same as when I click on 'Change size' (see the attachment).
I Know how to get key values (from list) from content center family member (Getting data from content center) but for the expression values (from user entries), I found nothing.
View 1 Replies
View Related
Aug 21, 2013
I am working on some codes that let me make some change on visibility of occurrence. So I am I main assembly, and 3 occurrences of the same sub-assembly. The sub assembly was saved on a design view named hole that is hiding some occurrences.
if I work with one of those sub assembly (checkOcc as component occurrence)and then I try this:
Debug.Print("Occurence name: " + CheckOcc.Name)
Debug.Print("Is DRV associative: " + CheckOcc.IsAssociativeToDesignViewRepresentation.ToString)
Debug.Print("The Active DRV is: " + CheckOcc.ActiveDesignViewRepresentation.ToString)
CheckOcc.SetDesignViewRepresentation("Default")
Debug.Print("Is DRV associative: " + CheckOcc.IsAssociativeToDesignViewRepresentation.ToString)
Debug.Print("The Active DRV is: " + CheckOcc.ActiveDesignViewRepresentation.ToString)
The first time I check for the name, the result is empty, but is should hole as it's what I can see in the browser. then I change it to default.The result of that, the representation views disappear from the browser for that occurrence and still, the name is return as empty...then I carry on with turning on the hidden occurrences.
objCol.Add(checkocc)
dv.SetVisibilityOfOccurrences(objCol, visibility)
The result, all the hidden occurrence appear ALSO on the other subassemblies... It look that it's affecting all the Designview of all occurrence of that name...then, if I try the reverse, by turning it off... the switch off on the other occurrences but not the one that is checkoff!!
View 1 Replies
View Related
Dec 26, 2012
In a drawing I'm looking for components that have a certain iProperty. If they have the iProperty, I want to turn every occurrence of that item red.
I can get the occurrences fine, but I'm unable to properly get the drawing curves so I can turn them red. I'm using code from this post on ModTheMachine: [URL]........
Here's my
private static void ProcessAssemblyColor(DrawingDocument aDoc, ComponentOccurrences occurrences){ foreach (ComponentOccurrence occ in occurrences) { if (occ.DefinitionDocumentType == DocumentTypeEnum.kPartDocumentObject) { TransientObjects transObjects = StandardAddInServer._mInventorApplication.TransientObjects; LayersEnumerator layers = aDoc.StylesManager.Layers; Layer colorLayer = layers[1]; colorLayer.Color = transObjects.CreateColor(255, 0, 0); //red [code]........
I've seen some things say I need to use an out object to use DrawingCurves. If that's true, I'm not sure what to put for the first variable.
object outObject;DrawingCurvesEnumerator drawingCurves = drawView.DrawingCurves[occ.CreateGeometryProxy(whatgoeshere?, out outObject)];
View 1 Replies
View Related
Apr 30, 2013
Is it possible to set BOM properties for a specific occurrence of a component, rather than have universal properties for every occurrence of that component in every assembly?
Two instances come to mind:
1. I have two identical occurrences of a part in an assembly. One is already existing at the site, the other we are providing. I want one to show up in the BOM, and not the other. I don't want to have multiple part files to keep up with, as they are identical.
2. Similarly, I have a part that shows up in two assemblies; in one assembly it is existing, in the other it is new. I want it to show up in the BOM for the second assembly, but in the first I want it to be "phantom" or "reference".
View 8 Replies
View Related
Feb 22, 2013
How do you suppress a certain pattern occurence in Ilogic?
View 6 Replies
View Related
Sep 10, 2012
I need to rename and replace occurences in an assembly, then modify the occurence name.I rename and replace only Farme generator components, which is tested by <condiftion>.What I want to do :
- Num = ABC
- Original filename = toto.ipt
- New filename = ABC_toto.ipt, and Occurence name = ABC_toto
The code :
fileDir contain the file path
docFName contain the original file name (for example, toto.ipt)
Num contain the prefix to add to the name and the occurence name (for example, ABC)
If <condition>Then
New_name = fileDir & Num & "_" & docFName
Call oFileNameOcc.SaveAs(New_name, True)
Call oOccurrence.Replace(New_name, False)
oOccurrence.name = Num & "_" & oOccurrence.name
End If
The problem is, the first time I use the macro, the prefix is added twice in the occurence name (the filename is ok) : I obtain ABC_ABC_toto. This happen only the first time, and only on an orrignal Frame Generator assembly.
If I use the macro again, with for example Num = 123, the result is : 123_ABC_ABC_toto.Where is the problem ?
View 7 Replies
View Related
Sep 8, 2013
Is it possible to suppress an occurrence of a pattern in part environment using iLogic? I saw something for assembly environment, but I can't make it work for part. My iLogic knowledge is quite basic.
View 1 Replies
View Related
Feb 22, 2013
is there a way to Replace the "bolt" Component Occurrence with api?
View 2 Replies
View Related
Sep 7, 2011
I need to be able to suppress individual elements of a circular pattern so I can retain the angular orientation while being able to reduce the number of instances. I have found how to suppress the entire circular pattern, but can't seem to get the right terminology to access the elements one at a time.
The code I have to suppress the entire pattern is Feature.InventorFeature("Circular Pattern").Suppressed = True.
View 2 Replies
View Related
Oct 21, 2013
I love the new triad function when placing a new part in Inventor 2014: I am now searching to trigger the same function for a part that already has been placed.
Something like:
1) select component
2) press a button (triggers the macro I now want to write)
3) the triad pops up.
I searched true the Inventor Help & what's new in the API. But didn't find any reference to that command. So I am afraid that it is not yet in the API. Could I maybe emulate it by replacing a component with itself using the place component command + emulating a mouseclick at the same origin as the original piece?
So a piece of code like:
1) get filelocation of selected part
2) get the origin point (x,y,z) of the part
3) get the translation between the origin of the assembly and the part
4) delete the selected part
5) place the part using the place component command (so the triad has been triggered)
6) fill in the filelocation, origin & translation
7) give control back to the user so he can move the part using the triad.
View 3 Replies
View Related
Dec 4, 2013
I am trying to add instances of an ipart to an assembly automatically from an excel file and need to be able to specify the occurrence x, y, and z positions. Since the Inventor version is so old I have not been able to find the proper documentation.
View 1 Replies
View Related
Dec 20, 2012
I have a door with 3 of the same handle. I have a program in which the user selects 1 of the handles to turn it into a keyed handle. Now, this all works but the problem is that all of the 3 regular handle instances will be replaced with the keyed handle.
Dim oOccHandle As ComponentOccurrence = oINV.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Select a door handle to replace.")
oOccHandle.ReferencedDocumentDescriptor.ReferencedFileDescriptor.ReplaceReference(PathToKeyedHandleModel)
View 1 Replies
View Related
Sep 20, 2011
How to get whether an occurence in a assembly is of content centre (kContentCenterObject) ?
View 1 Replies
View Related
Feb 22, 2013
This one work:
If L(i) = 1 Then oOcc.RenderStyle = _invApp.ActiveDocument.RenderStyles.Item("Red")
If L(i) = 2 Then oOcc.RenderStyle = _invApp.ActiveDocument.RenderStyles.Item("Yellow")
But I want to change like this and it not work:
Lcolor(1)="Red"Lcolor(2)="Yellow"L(2)=1L(1)=2for i=1 to 2oOcc.RenderStyle = _invApp.ActiveDocument.RenderStyles.Item(Lcolor(L(i)))next
What's wrong?
View 2 Replies
View Related
Oct 3, 2012
We are using Inventor 2011 and I would like to make a small app that allows my users to graphically select one or more occurrences of a rectangular pattern feature Then allow them to suppress them if desired.
I have determined the code to loop through the pattern occurrences and toggle suppression for any instance. What I do not know how to do is determine which occurrences have been graphically selected.
At this time I am only concerned with round hole features. (Perforated metal)
View 3 Replies
View Related
Jan 5, 2010
Can this be done? I want to go through the DrawingView Object to get at a subcomponent of an assembly and either set that component to have hidden lines (where needed) or no hidden lines.
View 8 Replies
View Related
Nov 24, 2011
I've created several (4) ilogic rules and want to run them by pressing a button. So I need a form with 4 start buttons. Can I create this with Ilogic in Inventor 2011 or do I need to be VBA expert?
View 3 Replies
View Related
Mar 29, 2011
I am currently using a vb.net application to control inventor using the API code.The API code is used to delete/suppress unwanted occurances from parts and sub-assemblies, depending on what is selected in the external application. It then puts all the parts and sub-assemblies together into a final assembly.
Most of the parts contain iLogic rules, to control dimensions, and these have been set to trigger when the part file is opened.I have noticed that in my final assemblies some of the parts don't appear as they should, however if i close the final assembly and open the individual part it appears to be correct. If i then open the final assembly it looks fine.
I think this might be due to the iLogic rule being triggered when the part is opened.Is there any way to trigger the rules using the API code while the final assembly is open, instead of closing it down and opening all the component parts and sub-assemblies?Or should we set the rules to trigger on a parameter change?
View 6 Replies
View Related
Jul 23, 2012
I'm trying to set a rule in which i have 2 i parts that i can change the length of . I want a rule where if i change one of them it changes the other to fit with it.
View 1 Replies
View Related