I am stabilizing many component names in assemblies for use in iLogic rules. But this has lead to many complaints about no longer being able to identify the file name easily.
Is there a setting in Inventor that could display the file name next to the display name? Or another quicker method than accessing iProperties or the BOM dialog to see file names.
I thought I was onto something when I read this on the Inventor help page
"You can change the component back to its original name and still preserve its stability. To change the component, make a minor change to the name, and then change it back to the original."
But I don't understand how this works in practice, changing the name back removes its stability and the rules that reference it no longer work.
Hi @Anonymous
Component's browser name settings can be changed from "Assemble<Productivity<Rename Browser Nodes" tab on Ribbon
Browser name can be changed to File Name or Part Number or Default
Thanks & Regards,
Tushar
@Anonymous
Thanks, but I was hoping there would be a way of keeping the browser names stabilized (as they are referenced in iLogic rules), but somehow show their part number or file name as well in the browser. Renaming the browser nodes causes the rules to fail.
Hi c.henderson2HQZG,
Could you create a custom iProperty called something like "Stabilized Name", and then before the rule runs, have the display name change to use that iProperty, and then at the end of the rule have it change to use the file name?
I would make this 2 separate external iLogic rules and then run the 1 rule at the beginning of your other rules, and the 2nd at the end.
I've been intending to write something like that for a while, because I'm like your users and prefer to see the file names, but just haven't stopped to do it yet.
Post back if you try it and it doesn't work and I'll to take a closer look.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
@NachitoMax Yeah please, hopefully that could give me a good start to achieve something like @Curtis_Waguespack has suggested above.
Thanks guys, much appreciated!
Hi
Here is the code I mentioned (also see attached video of it working)-
Rename Sheets
Add 'RenameSheets' to the ribbon as a button
When clicked, it will rename each sheet to the name of the referenced object in the 1st drawing view
Public Sub ReNameSheets() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim osheets As Sheets Set osheets = oDoc.Sheets Dim oSheet As Sheet Set oSheet = oDoc.ActiveSheet Dim defSheetLabel As String defSheetLabel = oDoc.SheetSettings.SheetLabel Dim sCount As Integer For Each oSheet In osheets On Error Resume Next 'oSheet.Activate Dim oDrawingView As DrawingView Set oDrawingView = oSheet.DrawingViews(1) omodelname = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName oSheet.Name = omodelname & " - " & defSheetLabel Next End Sub
Reset Sheets
Add 'ResetSheets' to the ribbon as a button
When clicked, it will rename all sheets to the generic 'Sheet'
Public Sub ResetSheets() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim osheets As Sheets Set osheets = oDoc.Sheets Dim oSheet As Sheet Set oSheet = oDoc.ActiveSheet Dim defSheetLabel As String defSheetLabel = oDoc.SheetSettings.SheetLabel Dim sCount As Integer For Each oSheet In osheets 'oSheet.Activate Dim oDrawingView As DrawingView Set oDrawingView = oSheet.DrawingViews(1) oSheet.Name = defSheetLabel Next
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
@JimmyDoe wrote:
Any chance you got around to this?...
Hi JimmyDoe,
Sort of.
Here's an example that gets the stabilized name and writes it to a custom iprop, and then toggle the browser name to the be the file name, or vice versa.
Experiment with this on a test assembly in case it's buggy, as it could wipe out your stabilized names.
Note too that as written it uses the assembly name as part of the custom iProp, so that a file used in multiple assemblies can have multiple "stabilized" names. Meaning that you'd have multiple custom iprops in the part file. You can remove that if needed, and just have it write to the same iprop if you want.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
'check for variable to hold inputradiobox value If SharedVariable.Exists("Input_Value") = False Then SharedVariable("Input_Value") = True End If 'get user input sOption1 = "Browser currently has Stablized Names" sOption2 = "Browser currently has File Names" bStabilizedName = InputRadioBox("Select an option:", sOption1, sOption2, _ SharedVariable("Input_Value"), "iLogic - Toggle browser names") Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition oAssemblyName = _ System.IO.Path.GetFileNameWithoutExtension(ThisApplication.ActiveDocument.FullFileName) oIpropName = "Stabilized_Name_" & oAssemblyName 'Iterate through all of the occurrences Dim oOcc As ComponentOccurrence For Each oOcc In oAsmCompDef.Occurrences.AllReferencedOccurrences(oAsmCompDef) docFile = oOcc.Definition.Document docName = System.IO.Path.GetFileNameWithoutExtension(docFile.FullFileName) If bStabilizedName = True Then iProperties.Value(oOcc.Name, "Custom", oIpropName) = oOcc.Name 'clear browser name override by setting to nothing 'which resets it to file name oOcc.Name = "" 'set variable to hold inputradiobox value SharedVariable("Input_Value") = False Else 'set occurence name to stablized name oOcc.Name = iProperties.Value(oOcc.Name, "Custom", oIpropName) 'set 'variable to hold inputradiobox value SharedVariable("Input_Value") = True End If Next
docFile = oOcc.Definition.Document oParent = System.IO.Path.GetFileNameWithoutExtension(docFile.FullFileName)
I used the above part from your rule: that is working. But could I extract the file extension.
I appreciate if you could reply, Thanks.
Hi Curtis;
Please disregard my previous request. I m getting it around
docFile = oOcc.Definition.Document ' oParent = System.IO.Path.GetFileNameWithoutExtension(docFile.FullFileName) oParent = System.IO.Path.GetFileName(docFile.FullFileName)
All the best.
c = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select component") d = Component.InventorComponent(c.name).Definition.Document.FullFileName f = IO.Path.GetFileNameWithoutExtension(d)
MsgBox(f)
Can't find what you're looking for? Ask the community or share your knowledge.