AutoCAD Inventor :: How To Change IProperties For Virtual Part
Sep 26, 2013
How to add a virtual part from an excel list to assembly using vb.net plugin. I`d like to know how to change i Properties of the virtual part through vb.net.
The iLogic code that I would typically use is:
Dim occs As ComponentOccurrencesoccs = asmDoc.ComponentDefinition.OccurrencesDim identity As Matrixidentity = ThisApplication.TransientGeometry.CreateMatrix
Dim virtOcc As ComponentOccurrenceIf v_qty >= 1 ThenvirtOcc = occs.AddVirtual(sVirtPart, identity) Try iProperties.Value(sVirtPart & ":1", "Project", "Description") = oProp1iProperties.Value(sVirtPart & ":1", "Summary", "Title") = oProp1 Catch End Try.......
so for the plugin I need to re-write this
Dim _invApp As Inventor.ApplicationDim occs As ComponentOccurrencesoccs = asmDoc.ComponentDefinition.Occurrences
Dim identity As Matrixidentity = _invApp.TransientGeometry.CreateMatrix Dim virtOcc As ComponentOccurrence If vp_qty >= 1 Then virtOcc = occs.AddVirtual(sVirtPart, identity) 'Try ' iProperties.Value(sVirtPart & ":1", "Project", "Description") = oProp1 ' iProperties.Value(sVirtPart & ":1", "Summary", "Title") = oProp1 'Catch 'catch error when oProp1 = nothing 'End Try
How should I re-write the text in bold , so it works?
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.
Is there any way to add an "iProperties" item to the context menu in the drawing environment, so that I can select a part on the drawing and access its iProperties, instead of having to "Open, edit iProp, Close," for each individual part? - Using Autodesk Inventor Professional 2012
Any way of having 2 files with different file name but identical designs what automatic updates the other one?
I need the same valve design with different materials, stock number and part names but I would like to make sure that both files are always updated to latest rev. Without having to remember to do it my self every time.
I'm using Visual Basic 2010 Express and Inventor 2013. I can get the properties such as PartName, Description information of the all sub parts using below
Dim invDocs As Documents invDocs = inv_App.Documents Dim i As Integer Dim invDocument As Document For i = 1 To invDocs.Count [code].........
Above code works perfect. But I want to get or change i property values of the selected part or assembly in the biggest assembly. I got below information:
Dim selSet As SelectSet selSet = asmDoc.SelectSet Dim compOcc As ComponentOccurrence Dim obj As Object For Each obj In selSet compOcc = obj 'Debug.Print(compOcc.Name) compOcc.Visible = False Next
But I do not know how can I get the properties of the selected part or sub-asm . How can I walk from "compOcc" to "invDocument.PropertySets.Item("Design Tracking Properties").Item("Description") "
P.S. I will check the selected part quantity. It must be only ONE! Control Code below:
Dim asmDoc As AssemblyDocument asmDoc = inv_App.ActiveDocument If asmDoc.SelectSet.Count <> 1 Then MsgBox("You need to select only one part or sub-asm to change properties...!") Return End If
I`m working on the code that reads a list of virtual parts from Excel and adds required qty into the assembly. So far it looks good, I just need to know how to create a folder in a Assembly view tree and save virtual part in that folder instead of placing it in the root.
Dim occs As ComponentOccurrences occs = asmDoc.ComponentDefinition.Occurrences Dim identity As Matrixidentity = ThisApplication.TransientGeometry.CreateMatrixDim virtOcc As ComponentOccurrencevirtOcc = occs.AddVirtual(sVirtPart, identity)
When you do a Save As or Save Copy As in Inventor the part number in the iProperties is automatically updated to match the new filename. I would expect the Document.SaveAs method in the API to act in a similar way. However I found out that this is not the case.
SaveAs: Document.SaveAs(filename, False) does not update the part number. The new part will still have the same part number as the original part. This can give problems since in the BOM parts with the same part number are interpreted as the same physical part.
SaveCopyAs: Document.SaveAs(filename, True) does work as expected and the part number will update correctly.
Is this a bug in the API? or is there a reasonable explanation for this?
I've occasionally run into a problem where when I right-click at the root of the browser tree and select iProperties, the dialog will not show. The application acts as if the dialog is active (in particular, Windows makes an annoying ding every time I try to click somewhere on the Inventor UI) but I cannot see it. If I recall correctly, this only affected some files, and I could usually get around it by opening the dialog from the main menu rather than from the browser.
Now I am experiencing something similar with the Derived Part dialog. After I select a part file to derive from, the dialog for selecting individual elements never actually appears on the screen, but Inventor seems to think it's there, as the part I am deriving from is displayed in the viewport and the browser tree is locked out. Again, it seems as if the dialog is active but invisible: If I press Enter, I get a derived part, and if I press Escape, the preview disappears and nothing new is put in the browser. Of course, I can't choose which elements of the base part I want to derive from. Right-clicking the derived part entry in the browser and selecting "Edit derived part" produces the same result -- evidently, an invisible dialog box.
I am trying to figure out if it is possible to change the iProperties default field names. For example, in iProperties, under the Project tab, i want to change the field "Stock Number" to "Drawing Number". I know that i could create my own custom field in a seperate tab, but i think this way would have a much cleaner look and simpler workflow. If it is possible, is it something that i can incorporate into an ipt template? Or will this only change on my system?
Is it possible to change the units of measure in the iProperties from lbmass to tons for instance? I deal with very large, heavy concrete objects and tons is the way we show mass. Also use cubic yards instead of cubic inches.
I`m looking for the iLogic code that can change one parameter (user defined) for each (ipt) part in assembly (iam)
The one below doesn`t work.
Sub Main Dim oApp As Inventor.Application = ThisApplication Dim oAssy As Inventor.AssemblyDocument = oApp.ActiveDocument For Each oSubDoc as Inventor.Document In oAssy.AllReferencedDocuments On Error Resume Next Parameter(oSubDoc, "FH") = 15.26 Next End Sub
I have an assembly of stair made from steel. There are lots of part the same. Is there a way to make a hole (inside assembly) to one and that hole would appear on all of them.
And another problem, how can I made cut (inside assembly) through more then one part so that would affect a part also when I open it alone.
I'm trying to change the display name of part at the part level (not an occurrence in an assembly). After the part file is saved initially I'm running an ilogic routine that assigns a "special" part number (not the same as the file name). I can get the part number into the PN iproperty easily but I can't find a way to programmatically change the display name in the top browser node. Please see attached for clarification.
In solidworks, if I have several similar parts to draw, I can draw one part and annotate it and then to save time and effort I can save the drawing as one of the other parts and then change the part reference in the drawing as I open it up.
I need to make installation plans on climate ceilings, which are steel cassettes with Meandro tube element located where cold or hot water is flowing through.
[URL]......
Now it may occur that a cassette is given a code 700 which represents the type of cassette. If inside the cassette is placed a Meandro element its become a follow number eg 700-01.
It may also be that the same cassette No. 700 gets another Meandro element and because the cassette has not changed shape the number 700 remains the same but the follow number change e.g. 700-02.
At the moment I change the number in the browser,(inv2012) I therefore want automatically the iproperties ,partnumber and stock number, to fit. When I go to the BOM, the part- and stock numbers automatically will be placed.
The browser codes are not displayed in the BOM. So if I specify for change I only have to do so in the browser. I wanted to do so by iLogic but then ran into problems. I found a tutorial from Rob Cohee with ilogic so you won’t forget to fill in your iproperties.
[URL].......
I also wanted to do so with the iproprtie Stock number but get an error stating that I must declare the name. How must i declare a name.
Also i was told for entering the browse name in ilogic i had to use displayName, but I get a error stating that the name is Read Only.
So how can i, after i change the browse name, automatically fill in the iproperties ‘part number and/or stock number? Is there an ilogic code for?
Before using iLogic, I created lot of iAssembly and iPart. I could change iPart factory member when I need in iAssembly.Now, I want to move everything to iLogic.
how could I change the part by iLogic code?
For example:
I generated "Part1.ipt" and "Part2.ipt",...... (I have hundred of member)
In my assembly, sometimes, I need use Part1.ipt, sometimes I need use Part2.ipt.
Which is the iLogic Code I should to use?
Inventor 2009, WIN XP. Autodesk Inventor Professional 2013 (64 Bit) SP2 Windows 7 Professional Service Pack 1 Intel(R) Xeon(R) CPU E5645 12.0 GB Memory
there is a way to change the template used for a part or assembly. The problem is that I created a template to fit my needs but I had to update it and the update doesn't effect the parts created with the old version one. How do update the templates of the files created using the old template?
I got this code earlier from Curtis_Waguespack, and i would like to add a setting... When i run this rule it Derives the assembly, but LOD is set to Master, i would like it to be set to my own (Configurator) LOD...
I don't seem to be able to find anything in this code, that defines LOD...
So far im doing ok with the standard ilogic code, but when it´s API or VBA code im lost.. which leads me to this.. i've been searching the forum back and forth to find a code that performs the feature "Shrinkwrap", and somehow everything i have found so far does not work... even the code example in Inventors help menu under programming, Therefore im trying to solve this with Curtis's code as staring point..
'set a reference to the assembly component definintion.'this assumes an assembly document is open.Dim oAsmCompDef As AssemblyComponentDefinitionoAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition 'define the path and file nameDim sPathandName As StringsPathandName = ThisDoc.PathAndFileName(False)