AutoCAD Inventor :: ILogic To Create Custom IProperty In Sub-component
Apr 1, 2013
I found this code to create a custom iProperty in the current, open document:
Dim propertyName As String = "MyProperty"Dim propertyValue as String = "Test Value"customPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties")Try prop = customPropertySet.Item(propertyName)Catch ' Assume error means not found customPropertySet.Add("", propertyName)End TryiProperties.Value("Custom", propertyName) = propertyValue
I have a iLogic rule that goes through each component of an assembly, counts how many times it occurs in the assembly, and then assigns that value to an iProparty (i.e. it inserts the total quantity of the part in some iProperty). Currently, however, it assigns the value to a default iProperty value, "Authority". I'd like, instead, for it to assign it to a custom iProperty called "Total QTY". However, I don't know how to tell Inventor to do the above code for a component in the assembly rather than the assembly itself. Below is my entire code. I've labeled where I'm guessing the above code should go. How I'd modify the above code to create the iProperty in the component being processed by the rule at that point?
Current
''True comment: Begin '''Commented-out Begin '''PartDocumentObject = 12290''AssemblyDocumentObject = 12291Dim openDoc As DocumentopenDoc = ThisDoc.DocumentDim docFile As DocumentIf openDoc.DocumentType = 12291 Then''If the open document is an assembly:''For each document referenced in this document:For
[code]......
I am migrating our old Inventor data to our new system. I will do an ilogic script for that.
I know how to add custom iProperties with iLogic but how can I remove them? Is it possible with iLogic? I would like to clean out all old iProperties that we don't need anymore.
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 want to have a Blank size custom iproperty using flat extents length and width this is what i did but gives error is there a way to get this to work the way I want it to? I dont want a Length and width to be seperated would like it all in one.
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.
I am simply trying to traverse an assembly, check each component for existance (or value of) an iProperty, and if so add that components name to a list. Here is what I have, but it doesnt work.
'Define the open document Dim oDoc As Document = ThisDoc.Document Dim oRefDoc As Document
I'm trying to figure out how to create an iLogic rule that would create a Custom iProperties and put in what version of Inventor the file was last updated with.
I would like to create an new custom ipropertie with ilogic. The reason is the contentcenter, thei haven't custom iproperties. How should the code work:
if propertie "test" is available write the value in the propertie else if propertie test isn't available create prpertie write the value in the propertie end if
How can i check if the propertie is already exists in the file?
How can i create a new custom iPropertie?
The rest of teh code is ready and works fine.
i've faund already some code with VBA but not with "pure" ilogic.
I know how to get a parameter into my list of custom iProperties.What I want to do is take the iProperty lbmass and add it to the list of user parameters. Is there any way to do this without using iLogic?
I have a template part that I would like to save automatically once the parameters dialog box is closed. I would also like the Save As filename to automatically be filled in with a iProperty named "Part Name". I already have the "Part Name" description grabbing information from parameters. Is this possible? And is the best way to trigger the event after an "iProperty change" or "Any Model Parameter Change"?
Any way to use iLogic to create custom iProperties from the cells in an Excel spreadsheet (both text and numbers) for a .dwg template. The only thing even close has been a user who already knew how to do it and was having a different problem. I am using Inventor 2012 and Excel 2003 and have very little experience with VB. I currently have a family of assemblies, consisting of two parts linked to an Excel spreadsheet to control the various parameters for each variation of the assembly.
I need creating an iLogic rule that will:
Go to a specific tab (I have four different tabs/worksheets) in an Excel spreadsheet.
Make a specfic row of that worksheet the current row based on the part number used to generate the models of the assembly shown in a .dwg.
Use the contents of a cell in that row (text or numeric or a combination of both) to generate a custom iProperty for the .dwg template.
Use the custom iProperties to fill in the title block of the template.
I am trying to use the iProperties.Value("part1", "Summary", "iProperty") function to get the filename or complete filepath of a component within a subassembly. I know that these iProperties exist because I can insert them onto a drawing, and I see them in the general tab of the iProperty window.
I get an error message indicating that the General tab can't be found. How might I go about getting this filename iProperty, or is there an easier way?
I want to use Ilogic to construct a code part name.
My question is perform a code of about 12 characters. For example the parameter "Lenght" is 600mm but in the expressione result It must be "000000000600" (a string of 12 characters)
I am trying to add a custom iProperty from my assembly to the drawing parts list. According to the help wiki, I'm supposed to click Column Chooser > New Property > Custom Properties List (click here to see the relevant wiki page--also see the attached screenshot called Custom Property Help.png).
When I click on new property, there is nothing about Custom Properties List.
I had wanted to find a way to engrave/emboss the part number on a part model and have it be parametrically tied to the part number iProperty. Since it doesn't appear that I can create a text box and insert the iProperty directly, here's what I did to work around this. (I setup my part templates to have this out of the box....)
1. Within, the IPT file, add a user text parameter called "PartNo" and set its initial value to any text value.
2. Create your sketch for your text to be engraved. Insert the User parameter you just created.
3. Create the engraving/embossing for your text.
4. Create the following iLogic rule:
' Requires a User Text Parameter called "PartNo" prior to running' Set the appropriate event trigger to tasteIf Parameter("PartNo") <> iProperties.Value("Project", "Part Number") ThenParameter("PartNo") = iProperties.Value("Project", "Part Number")InventorVb.DocumentUpdate()End If
5. I set this rule to fire using the "iProperty Change" event trigger. So if the iProperty is set or changed, your text will update. Obviously, you can set this to run with whatever trigger you like.
way to get multiple lines of text in an iProperty? I am using a custom iProperty named "Title" so users can insert the drawing title into the title block using the custom iProperty. The only problem is that the title comes out all on one line and goes outside the title block. Should I be using iproperties or is there a better way?
I have gotten in the habit of using a leader text with a custom iproperty to do material call outs on my drawings. I have been doing the first one then copy/pasting the leader onto each piece i want to call out.
This worked flawlessly in 2010 and has worked well previously in 2012. For some reason it is not working at all in this particular .idw.
work flow is to create the first instance, copy. right click outside the view border and select paste. Then attach to as many different parts as needed.
attached is the error message I get.
The custom iproperty is text. 1/2 a36 or 4x4x3/8 Angle
In the attached file there are two custom iProperties that cannot be perminantly updated nor deleted. The iProperties are "size" and "purch_qty". These iProperties were created and set using a custom macro but they are of course accessable via the standard iProperties dialog. I can change the values for these particular iProperties but as soon as I save the file they revert back to their original values. Same goes for trying to delete them. All other iProperties, custom and otherwise, seem to behave normally.
The sketch in this file originated with a 2D DXF file for a vendor supplied aluminum extrusion quite a few years back. The original file has been copied (save-as...) to about 20 different files over the years. The iProperties in question were added years after most of the files were created, Each file is exibiting the same problem. These files are used in a LOT of assemblies. The thought of recreating all these files from scratch and updating the assemblies is not very inviting.
What I am trying to do is insert a part into an assembly file using iLogic. I basically want to mimic Inventor’s “Place” command using ilogic, maybe something like this:
I'm trying to play around with iLogic for creating dynamically dimensioned subassemblies. I've created my dimensioning rules that link to the parts I wish to change dimensions on.
And I've tested this in the SubAssembly I've created and all appears fine. However when I go to insert the sub assembly into the main assembly I get the following error:
Parameter: The component named "Bridge Spine:1" was not found.
I've noticed that the new sub assembly has created new parts with the extension -01 on the end of each part (As expected) It appears that this link is being lost in the rule for the new sub assembly. i.e the rule is looking for Bridge Spine:1 instead of Bridge Spine-01:1
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".