I need to suppress a component whose name is going to change. Is there a way to suppress the part without referencing its name, maybe using a part number or something like that? I have an assembly that is use as a template, I adjust the size with an external rule to my needs, and then I copy the assembly and parts under different names . Also if you have any tips on linking part parameter to user parameter in a main assembly, even if the name of the part and assembly change, please share. I'm very new to this and your help would be appreciated.
Solved! Go to Solution.
I need to suppress a component whose name is going to change. Is there a way to suppress the part without referencing its name, maybe using a part number or something like that? I have an assembly that is use as a template, I adjust the size with an external rule to my needs, and then I copy the assembly and parts under different names . Also if you have any tips on linking part parameter to user parameter in a main assembly, even if the name of the part and assembly change, please share. I'm very new to this and your help would be appreciated.
Solved! Go to Solution.
Solved by bradeneuropeArthur. Go to Solution.
Solved by WCrihfield. Go to Solution.
You can do that on each iproperty. Let me know which you choose!
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
You can do that on each iproperty. Let me know which you choose!
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
With a stock number.
With a stock number.
Could you help please
Could you help please
Hi @rockportbusiness. How can this component be identified, if not by its name? Is there anything else unique about it that could be used to identify it? Once we can find this component by code, we can simply run an iLogic rule that will check the value of the 'Stock Number' iProperty of the assembly, and if its value is a certain value, then it will suppress that component, and if the value is different, it will unsuppress the component, or not do anything.
Are you familiar with the process of 'stabilizing component browser names" in your assembly? This is essentially the process of renaming all of the assembly components within your template assembly to new unique, but meaningful names. I'm not talking about changing the names of the files, just the labels that are automatically assigned to the components as you see them within the model browser tree. Their names usually have something like ":1", or ":2" after them, in order to keep each name unique, but by default these are usually named as the file names. If you just change their names within the model browser tree, to something other than file name or part number, but still meaningful, that will stabilize their names for you. What I mean is, when you replace that component with another one, so that it is pointing to a different source model file, the name of the component, as seen in the model browser tree, will stay the same. When this is the case, you can always find that component within the assembly by its name, within your iLogic rule codes, even after they have been replaced with different source files. This has been a common practice talked about here on this forum, and on a few different user's personal Blogs, so you could probably search around for some codes to do the renaming part for you, if you do not want to do it manually.
Wesley Crihfield
(Not an Autodesk Employee)
Hi @rockportbusiness. How can this component be identified, if not by its name? Is there anything else unique about it that could be used to identify it? Once we can find this component by code, we can simply run an iLogic rule that will check the value of the 'Stock Number' iProperty of the assembly, and if its value is a certain value, then it will suppress that component, and if the value is different, it will unsuppress the component, or not do anything.
Are you familiar with the process of 'stabilizing component browser names" in your assembly? This is essentially the process of renaming all of the assembly components within your template assembly to new unique, but meaningful names. I'm not talking about changing the names of the files, just the labels that are automatically assigned to the components as you see them within the model browser tree. Their names usually have something like ":1", or ":2" after them, in order to keep each name unique, but by default these are usually named as the file names. If you just change their names within the model browser tree, to something other than file name or part number, but still meaningful, that will stabilize their names for you. What I mean is, when you replace that component with another one, so that it is pointing to a different source model file, the name of the component, as seen in the model browser tree, will stay the same. When this is the case, you can always find that component within the assembly by its name, within your iLogic rule codes, even after they have been replaced with different source files. This has been a common practice talked about here on this forum, and on a few different user's personal Blogs, so you could probably search around for some codes to do the renaming part for you, if you do not want to do it manually.
Wesley Crihfield
(Not an Autodesk Employee)
Sorry for the late reply, totally forgotten due to the amount of other questions!
Dim a As AssemblyDocument = ThisAssembly.Document
Dim acd As AssemblyComponentDefinition = a.ComponentDefinition
Dim ac As ComponentOccurrence
Dim YC As String = "Your Condition"
For Each ac In acd.Occurrences
Dim d As Document = ac.Definition.Document
If d.PropertySets.Item(3).Item("Stock Number") Is YC Then
'If Not d.PropertySets.Item(3).Item("Stock Number") Is YC Then
ac.Suppress
End If
Next
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Sorry for the late reply, totally forgotten due to the amount of other questions!
Dim a As AssemblyDocument = ThisAssembly.Document
Dim acd As AssemblyComponentDefinition = a.ComponentDefinition
Dim ac As ComponentOccurrence
Dim YC As String = "Your Condition"
For Each ac In acd.Occurrences
Dim d As Document = ac.Definition.Document
If d.PropertySets.Item(3).Item("Stock Number") Is YC Then
'If Not d.PropertySets.Item(3).Item("Stock Number") Is YC Then
ac.Suppress
End If
Next
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Well that's a eye opener. Thank you so much and keep up the good work.🙂
Well that's a eye opener. Thank you so much and keep up the good work.🙂
Can't find what you're looking for? Ask the community or share your knowledge.