AutoCAD Inventor :: Saving A Multi Value Parameter List Externally From The Part
Jan 17, 2013
I have an iLogic template part that has a multi value parameter. In this case the product code can be selected from a list of 4 codes. In futre we may need 5 and the 5th may need to be available to older parts.
I would like to avoid having to add the 5th as an option to every part we've ever made when the 5th becomes required.
I'd like to have the list of codes stored in an external file (Possibly an xml) and the template part reference that file to acquire it's list of available codes. That way I can add codes to the xml and all the files will have their list of available codes updated.
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 created a sketch that I would like to use in an iFeature. The sketch dimensions are controlled with an ilogic rule referencing a multi value text user parameter, eg the text parameter pull down menu controls the size of the part.
Is there an easy way to get this parameter into an ifeature or derived part?
I have a Multi-Value Parameter "MV" that I want to populate using a Named Range from an Excel file that is already populating other parameters for the same file.
I currently have the file working by populating "MV" by using the snippet from iLogic below...
The reason I don't like this method is because if ever that range changes... all the iLogic code will have to be updated as well. How to set a Multi-Value Parameter using a Named Range from an Excel file? I assumed the below snippet would work but I am receiving
"Array was not a one-dimensional array." as an error.
Is there a way to change the values available in a Multivalue list, based on another parameter?
I'd like to achieve:
When material is "MDF", available thicknesses are 6,9, 12
When material is "PLY", available thicknesses are 15,18, 25
I kinda solved this already but it's not quite right. I basically mad the list a list of custom parameters, and changed the values of these parameters based on the material parameter. :
This works pretty much, when changing between the materials the value currently selected remains in the list until another is selected from the list. Once another value has been selected, only the correct values are available, but immediately after the material has been changed the thickness for that material is incorrect and could lead to operators specifying an unavailable thickness.
I am trying to populate a multi-value user parameter with a list composed of the various materials available from the iProperties "Physical" tab. So far I have this:
For Each material In iProperties.Materials Bracket_Material.Items.Add(material) Next iProperties.Material=Bracket_Material Running the Rule gets this error message: Rule Compile Errors in Material_Rule, in _Mounting_bracket.ipt
Error on Line 2 : 'Bracket_Material' is not declared. It may be inaccessible due to its protection level.
I think I am doing the "Bracket_Material.Items.Add(material) " line wrong, but I don't know enough VB to fix it. It seems to me it IS declared in the Parameters table - isn't adding the parameter to the parameter table sufficient to declare it?
Eventually I want to add the Bracket_Material Parameter to a form so the user can select material from drop down list and assign it to part.
I could add an empty text value within an multi value list in inventor 2010, but I don't think i can do the same thing in 2013, is there a possible way to do it?
Btw, when by an empty text value I dont mean a space.
If OD=900 mm And Filter_Type = "Aerob" ThenMultiValue.SetList("FilterSize", 0.2, 0.3, 0.4, 0.5, 2.2, 2.3, 2.4, 2.5)End IfIf OD=900 mm And Filter_Type = "Donaldson DLM" ThenMultiValue.SetList("FilterSize", V3/7S, V4/7S, V8/7S)End If For first condition everything is ok. But when the second one is valid it gives error:
Conversion from string "V3/7" to type 'Double' is not valid.
Maybe I should add that the parameter "FilterSize" was made as Text and multi-value.
AIP 2014 Windows 7 x64 Dell Precision T7400 Intel(R) Xeon(R) CPU X5472 @ 3.00GHz (4 CPU's), 8Gb RAM, NVIDIA Quadro FX 5600 1536MB GDDR3
I can't find a way to create multi flat patters in one part from a lofted sheetmetal part. Also, didn't the developers fix the 'can't make a flat pattern from a derived part'?
IV 2010 Suite Digital Storm PC: EVGA & Intel components Win 7 Pro 64 bit
I have a 3 part assembly . Holes have to be made though the 3 parts . The holes can be made and snet/projected/though all/though distance and this work fine. The holes are shown in each part and the participant command works fine
Is it possible to locate where a parameter is used in a part? Looking through every sketch to find a parameter becomes tedious when there are several dozen sketches and parameters in use.
So I have a multi-part solid of a symmetrical object, meaning that some of the pieces on each side are going to be identical (just mirrored). Some objects I would like to keep separate during the "make components" function because of the bends on them.
But for some of the solids, the ones that are identical on each side of the model, I do not want to create a part file for each identical solid. I want inventor to make one .ipt and put it in the assembly file twice (one on each side.)
The work-around is to only make one of the solids into a part then open the assembly, re-insert the part, then re-constrain it.
Inventor 2012.how would I input the total quantity of doors in the .iam in order to update the Parts List quantity column? I have a lot of user inputs in the .iam file set up to change width, height, etc that are based off of Parameters in the .iam, but I don't know how the user can enter assembly quantities in order to get the Parts List to update the Quantity column correctly?
I have attempted using custom iProperties but how to get it to display based off a user input Parameter.
I am trying to acheive copying parameter from one part/assembly to another part/assembly document and this is what i came out with:
Private Sub CopyParamToTarget(SourceFile As String, TargetFile As String, ByRef ParamList As ListBox) 'Declares the variables to be used in this sub Dim d_target As Inventor.Document = Nothing, d_source As Inventor.Document = Nothing Dim t_transaction
[Code]....
I did another version for Inventor VBA in which is quite similar to this length as well . . .
Tried using ComponentDefinition instead but it does not have access to the Parameters list.
this code works for parts. But how to change it that it works for assembly? I would like to select a part and than change the value.
m_invApp = GetObject(, "Inventor.Application") ' Get the Parameters object. Assumes a part or assembly document is active. Dim oParameters As Parameters oParameters = m_invApp.ActiveDocument.ComponentDefinition.Parameters [code]........
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.
I'm trying to run a for loop to check a part's thickness parameter within an assembly but I do not know how to access that parameter from the assembly. Once I check that the thickness does not equal 1/4" I want to assign the sheet metal rule to be user defined. Here is what I got so far:
Dim SheetMetalRule As String = BODY_GAUGE & " " & SHEET_METAL_RULEDim assyDoc As AssemblyDocumentassyDoc = ThisApplication.ActiveDocumentDim partDoc As DocumentFor Each partDoc In assyDoc.AllReferencedDocumentsIf partDoc.ComponentDefinition.Parameters.UserParameters("THICK").Value = .25 ThenElse If partDoc.ComponentDefinition.Parameters.UserParams.Value <> .25 ThenThisApplication.Documents.Open(partDoc.FullFileName, False)SheetMetal.SetActiveStyle(SheetMetalRule)partDoc.SavepartDoc.CloseEnd IfNext
I am creating a multibody part. I have revolded a surface from a sketch through other bodies and used those bodies to trim the surface. I then thicken the surface to create a solid.
The solid is transparent and no amount of property adjusting or anything else will make it opaque like the rest of the solids.
in the picture the open scalloped portion contains two bodies.
I have 2 solid bodies in a part file driven by seperate ifeatures.
Why is it when i search down to the surface bodies then into say the first body, then component definition, then features, then i features it shows both ifeatures?
if it is possible to increase the number of recently used values/parameters in the dimension dialog, during part sketching. For one part, I use approximately ten parameters that will be used repeatedly. When I'm done with one sketch and start with the next, only the last five parameters are in the recently used parameter list. (Create dimension --> select arrow on right side of dialog, see attachment Dimension_Dialog.jpg, excuse me for the poor quality ). It would be much more comfort to have more parameters in this 'recently used'-list.
Furthermore I'd like to know if it's possible to widen the parameter-list. In my case I've several parameters that start with the same prefix, followed by a differentiating suffix. When I create a new dimension, select the arrow on the right and select 'List Parameters', I have to adjust the width of this dialog every time to see the entire parameter. (see picture Dimension_parameters.jpg)
I would like to add tree parameters to this part. One is a wire diameter. Another should be the length of the wire. The last should calculate the weight of the wire. Then I wish to set the mass of this wire part equal to this last parameter. Is it possible somehow?
The commented code does not work. I want to be able to open a part and change its size parameters before i open the assembly. this code will run as an external rule in a new empty file.
If i can do it without opening the part, that is even better. Test can I open a part, change a param, then close part.
Dim fname As String fname ="C:Workspacemy_progchanF_BB_L.ipt" Dim pDoc as PartDocument = ThisApplication.Documents.Open(fname,False) pDoc = ThisApplication.Documents.Open(fname)
These are just attempts to find a syntax that works. I need the method to change the parameter.