AutoCAD Inventor :: Change IProperty Material Using VBA
Mar 2, 2013
I am trying to change the iProperties "Physical" "Material" using an Inventor VBA macro..For example, say the material is set to "DEFAULT" and I want to change it to "TITANUIM", how can I do this using VBA?
I'm looking to see if there is a way to link the revision number to a custom iProperty in the same part. Our laser requires a specific output for programming, but I only want this to show up on actual lasered parts as we don't need it on parts that are sawcut. Basically what I would like to do is create a custom iProperty that I can link to the title block for that reads RV:<Revision>. Is there a way to do this? I'd rather not create a separate drawing template for lasered parts as we've got about 100 templates for our various customers the way it is.
Is there a way to change an iProperty, specifically the iProperties->Project->Project field for multiple parts automatically.
I use the iLogic Design Copy Tool to copy over an entire project, and for the most part the only changes is the project number.
I didn't see a way to change this in the Design Copy Tool, possibly there is some other tools that can do this that I don't know about. But if not, I am assuming a small script (VBA??) would be required to do this? whether it is in Inventor or just an outside program to carry out this change.
I found this old thread, but it seems that people just found another way to do this?
[URL]
My workflow would follow something like this:
-Use iLogic Design Copy Tool to copy over project to new folder
-Open up full assembly
-Run rule or script to update all parts in assembly with new Project iProperty
-Save
-update the drawings as I need, (they will all need to be reviewed as some parts will be modified anyways)
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 changed the material using the vb.net code shown below.but after changing material the object is not updated ,the volume and mass didn't change .
Dim oDoc As PartDocument oDoc = inventorApp.ActiveDocument Dim oDTProps As PropertySet oDTProps = oDoc.PropertySets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}") [code]....
If I need to change the material of all parts in an assembly I find it convenient to do this in the BOM. In the 'parts only' view I add the material column, change the first one and just drag it down like in Excel.
There are however some parts where the material is greyed-out (see attached image) and I cannot change them in to something else. I already traced this to parts which are present in multiple different sub-assemblies. I guess that's also the reason for the blueish/red icon instead of a normal part icon.
If I open one of the sub-assemblies the part is fine and I can change the material.
I received a rather large assembly file from a client that was done in Pro E. I was wondering if it is possible to change the entire assembly from Default material to steel without having to go into each individual part and changing its material manually (which could take several hours) I am using INV 2012 Pro with SP1 installed.
I have a problem with the Bolted Connection tool in inventor. When I use it to place fasteners in my assembly everything works fine, i can select the material I want, etc... The problem is whenever I need to change something in it, the fasteners changes to the first one in the list that appears when you click the ... button, which means that I always get the wrong fasteners. The workaround we found was to click the ... button again for all the fasterners, and this has to be done in the right order (start to end) otherwise I will get again the wrong fasteners and to select the fasteners again.
One more thing, I'd like to know if it is possible to have a more user-friendly way to change the bolts in bolted connection. I would like it to be like when you import a component from the content center, with that dialog box. As for now, I have to choose the bolts with their part number while when I import them with the content center, I have all set the key values.
I wish I can open my general assembly BOM and set the proper Materials to my all my parts after migration from 2012 release.
But I cannot change Material for the some custom part in the assembly BOM in the Parts Only tab. Parts refusing to change a Material have special symbol and I guess it means “promoted assembly” – no info regarding these symbols.
I can change any Material in Structured and Model Data tabs but it is extremely inconvenient for the big assembly.
[URL]....
The questions is: Why those promoted assemblies have inaccessible Material in the Parts Only tab?
I have similar subassemblies built in similar way as you can see fro video, but one is treated as promoted assembly and other as promoted part, the question is what possible difference between those is?
The attached part has some bad work features on it, but I don't care about that (easy fix). It also contains a rule that simply changes the material from "P AND O" (pickles & oiled) to "201 S/S", for some reason the faulty work geometery causes this rule to throw an "unspecified error". If you delete the bad work geometry the rule runs fine.
' 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
How do I change the a part material render style within an assembly?
I have tried this below. It changes the name but doesn't update the render style. Sub Material()Dim oassy As AssemblyDocumentSet oassy = ThisApplication.ActiveDocumentDim ocompdef As AssemblyComponentDefinitionSet ocompdef = oassy.ComponentDefinitionDim ooccurr As ComponentOccurrencesSet ooccurr = ocompdef.OccurrencesDim opartdef As ComponentDefinitionSet opartdef = ooccurr.Item(11).Definitionopartdef.Material.RenderStyle.Name = "Red"End Sub
I want to change the material of a sheet metal part using inventor api.I tried something like code
Dim partDoc As PartDocument partDoc = inventorApp.Documents.Open(FilePath & filename, False) If partDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then Dim smDef As SheetMetalComponentDefinition smDef = partDoc.ComponentDefinition Dim style As SheetMetalStyle style = smDef.SheetMetalStyles.Item("sheetMetalRule")
I am completely new to ilogic but would like to make a rule in my idw file that change the hatch pattern in a section of a specific material.
Short Version:
I have an aluminum extrusion part. Material is set to Aluminum-6061. In any section view of this part I want the hatch to be ANSI 31 with a rotation of 45 degrees and a scale of .02 How do I do this?
I can delete every unused material except one in the Material Editor.I am trying to make the custom Material library and somehowI have got the Material I cannot delete. URL....
I am in the samill building buisness. While designing I thought it would be nice to show logs on our equipment. Is there anyway to show bark on drawings to show the texture on the final drawing?
I have a drawing of a sheet metal part with multiple sheets. I have named each sheet to reflect the nature of the views (general dimensions, detail views, flat pattern, etc.). I want the name of the sheet to appear in the title block, but I cannot seem to find the "Sheet Name" property anywhere. Can it be added to the list of the drawing or sheet properties, or is there another way to achieve this?. I do not want to have to use Custom Properties, and manually re-enter the names of each sheet.
I am trying to write a small standalone app in C# that I can run when I have an assembly document open. I want the app to iterate through all the parts in the assembly and set the iproperties. I am having some trouble accessing the iproperties however.
I want (for example) to set the "TITLE" in the "DOCUMENT SUMMARY INFORMATION" to be a concatenation of the part number and the description separated by a " - ".how to access these properties.
I'm looking for a way to convert the iproperty value "volume" into length from known values in the part. I have an assembly which consists of 20 different typs of sheets which are rolled out in certain patterns. The width and depth of the sheet are known, and I would like to use the volume to find the length. The assembly is linked to an excel file so the values will change based on certain parameters. I'm using this as a check to make sure there is no error from the spreadsheet.