Part Display Mode In Assembly

Hi

I noticed that SPR 427563 had now been fixed so thought I'd revisitan old idea.

I am trying to programmatically set the display mode of certaincomponents within an assembly (not the whole assembly)

eg. I want to set some parts to hidden lines removed, while othersstay shaded. This is perfectly possible using the assembly displaypane, but I need to automate it.

The code is below (Thanks Mahir), but for some reason it doesn'tupdate anything though it now doesn't crash like it did in 2008.

Help appreciated

Thanks

Rich


Dim swApp As SldWorks.SldWorks
Dim swAssy As SldWorks.ModelDoc2
Dim SelMgr As SldWorks.SelectionMgr
Dim swComp As SldWorks.Component2
Dim swDoc As SldWorks.ModelDoc2

Sub main()
Set swApp = Application.SldWorks
Set swAssy = swApp.ActiveDoc
Set SelMgr = swAssy.SelectionManager
Set swComp = SelMgr.GetSelectedObjectsComponent3(1, -1)

If Not swComp Is Nothing Then
swComp.SetSuppression2 swComponentResolved
Set swDoc = swComp.GetModelDoc
Debug.Print swDoc.GetPathName

swDoc.ViewDisplayHiddenremoved ' <<< Crashes in pre SW09SP1
swDoc.ViewDisplayShaded
swDoc.ViewDisplayWireframe
End If


End SubSolidworksApi macros