Hello,
Thanks for the reply. I have modified your rules little bit and want to control with representation.
Still, it can run and execute properly. Could you please help me out here.
Dim oDoc As PartDocument
oDoc=ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition
oCompDef = oDoc.ComponentDefinition
Dim oRe As RepresentationsManager
oRe = oCompDef.RepresentationsManager
Dim oRepMgr As DesignViewRepresentation
oRepMgr = oRe.ActiveDesignViewRepresentation
Dim oBody As SurfaceBody
' MessageBox.Show("Try", "Title")
''step through each solid and
''set vis based on name and
''matching true/fase condition
i = 1
For Each SurfaceBody In oCompDef.SurfaceBodies
oBody = oCompDef.SurfaceBodies.Item(i)
If oRepMgr.Name = "FLANGE" And oBody.Name = "FLANGE"
oBody.Visible=True
Else If oRepMgr.Name = "SHELL" And oBody.Name = "SHELL"
oBody.Visible = True
Else If oRepMgr.Name = "PRODUCT FLANGE" And oBody.Name = "PRODUCTFLANGE"
oBody.Visible=True
Else If oBody.Visible = False
End If
i = i +1
Next
Bhavik Suthar