Update Layer Properties Manager Palette

Update Layer Properties Manager Palette

GTVic
Advisor Advisor
1,561 Views
2 Replies
Message 1 of 3

Update Layer Properties Manager Palette

GTVic
Advisor
Advisor

I've created a VB.NET routine to update blocks, layers and layer filters from a source drawing.

 

After updating filters and when the command is finished (dialog closed), the Layer Properties Manager palette MAY not update to show the new set of filters although visually you can see that it does appear to refresh itself.

 

Whether it updates seems to depend on which filter is active and which filters are added.For example, I have properties filters A, B, C, D and E, and B and E have subfilters B1-B8 and E1-E9.

 

If Filter E3 is removed as a test and the parent filter E is active, when the command is done, E3 should appear back in the list, but it does not show until the palette is closed and reopened. If filter B is active, then the list will refresh and E3 will show immediatlely after the command exits.

 

I have added a dialog to my routine to inform the user they may have to close the palette and reopen to get the proper display.

 

Does anyone know of another solution?

 

I have tried Editor.UpdateScreen() but that does not help.

 

Thanks

0 Likes
Accepted solutions (1)
1,562 Views
2 Replies
Replies (2)
Message 2 of 3

Virupaksha_aithal
Autodesk Support
Autodesk Support
Accepted solution

Try re-showing the layer manager Palette after the layer filter update

 

//get the LAYERMANAGERSTATE

object manager = Application.GetSystemVariable("LAYERMANAGERSTATE");

 

if (manager.ToString().Contains("1"))

{

    //

    doc.SendStringToExecute("layerpalette ", true, false, false);

}

 

Virupaksha Aithal

Autodesk Developer Network



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

Message 3 of 3

GTVic
Advisor
Advisor

Thank you, that worked, calling the LAYERPALETTE command when the Layer Properties Manager is open forces it to refresh.

 

I created a boolean flag which is set to True when the layers or layer filters are updated and added your code to my Form_FormClosing event to be executed if the flag is True.

 

    Private Sub MyForm_FormClosing(...) Handles Me.FormClosing

        If Not UpdateLayerManager Then Exit Sub

        Dim lms As Object = Application.GetSystemVariable("LAYERMANAGERSTATE")
        If lms.ToString.Contains("1") Then
            MdiActiveDocument.SendStringToExecute("layerpalette ", True, False, True)
        End If

    End Sub

 

0 Likes