The base is a drawing with several layers. Some are visible, some are printable and some have elements.
The task is, to copy and paste (at different place) the elements of specific layers and leaf the elements of other layers as the are.
As far as I know it is not possible to select the elements of an layer directly. So I will try to set all other layers invisible and select all visible elements.
But how can I set layers invisible? Following code dose nothing at all.
Sub SetLayerNotVisible()
Dim oController As Object : oController = ThisComponent.getCurrentController()
Dim oLayerManager As Object : oLayerManager = ThisComponent.getLayerManager()
Dim myLayer As Object : myLayer = oLayerManager.getByName("myLayerName")
Dim oActiveLayer As Object
oController.setPropertyValue("ActiveLayer", myLayer)
oActiveLayer = oController.ActiveLayer
oActiveLayer.setPropertyValue("IsVisible", False)
End sub
No Action also with this code!
...
code as above
...
oActiveLayer.IsVisible = False
...
The property is not marked as “read only” in MRI. So why doesn’t happen anything?