- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I found this rule believe created by WCrihfield. Rule is working just perfect as is intent to work. I do have frame which is sheet metal parts and has fold and unfold. As i said rule is giving me what i need, but i have to change for every part . in original rule that is named as Testing.
I do have questions;
1. Can this rule be adjusted to run from assembly?
2. If not run from assembly then Can MsgBox be changed with input box.
Thanks
Dim oPDoc As PartDocument = ThisDoc.Document
Dim oPDef = oPDoc.ComponentDefinition
Dim oMSs As ModelStates = oPDef.ModelStates
Dim oActiveMS As ModelState = oMSs.ActiveModelState
Dim oCProps As PropertySet = oPDoc.PropertySets.Item("Inventor User Defined Properties")
Dim oCProp As Inventor.Property = oCProps.Item("CProp1")
oMSs.MemberEditScope = MemberEditScopeEnum.kEditActiveMember
For Each oMS As ModelState In oMSs
oMS.Activate
Dim oVal As String = ""
oVal = oCProp.Value
MsgBox("While " & oMS.Name & " is active, CProp1 = " & oVal, , "")
oCProp.Value = "Testing - " & oMS.Name
oVal = oCProp.Value
MsgBox("While " & oMS.Name & " is active, CProp1 changed to: " & oVal, , "")
Next
oActiveMS.Activate
Solved! Go to Solution.