Change value in a Form without opening the parts.

Change value in a Form without opening the parts.

mikias.tesfahun
Explorer Explorer
478 Views
2 Replies
Message 1 of 3

Change value in a Form without opening the parts.

mikias.tesfahun
Explorer
Explorer

Hi Guys

 

I have a lot of parts with existing Finish color in form editor created at the begging of the project. Now i want to change it to a different color without opening each and every one of them. Is their any other way that i can i do These?Or An I-logic?

 

Thanks.

0 Likes
479 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

Hi @mikias.tesfahun . How are you my friend?

 

Is it possible for your workflow to run it within the assembly? 

I found this code from here. Tested it but didnt work for some of the parts. I dont why but maybe you can try if it works for you.

 

Dim oAsset As Asset
Dim oAsset_Array As New ArrayList
For Each oAsset_Array_X In ThisApplication.ActiveAppearanceLibrary.AppearanceAssets
oAsset_Array.Add(oAsset_Array_X.DisplayName)
oAsset_Array.Sort()
Next
'present the user with the list to choose from
oAsset_Array_Selected = InputListBox("CHOOSE TEXTURE FROM ABOVE LIST", oAsset_Array, oAsset_Array.Item(0), "TEXTURE SELECTION", "LIST OF TEXTURES")
If oAsset_Array_Selected = "" Then Exit Sub


For Each oOcc As ComponentOccurrence In ThisDoc.Document.ComponentDefinition.Occurrences
	On Error Resume Next
	Dim oDef As PartDocument
    oDef = oOcc.Definition.Document
    Dim oRenderStyle As RenderStyle
    oRenderStyle = oDef.RenderStyles.Item(oAsset_Array_Selected)
    oDef.ActiveRenderStyle = oRenderStyle
    iLogicVb.UpdateWhenDone = True		
Next

 

0 Likes
Message 3 of 3

Anonymous
Not applicable

Now I know why it didnt work in my case, the override has to be cleared first then set the appearance to "As Part".

There should be a code to clear the override. appearance.JPG

 

0 Likes