cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get the object the repository from a "ModeDrwPath" ?

xlebourd
New Contributor

I am lost with all the elements defining a path/link.

I want to colorise every line based on an attribute of the object with a VBS Macro.

I can access every MegaDrawingItem representing a line of a path. But I can't find how to access to the object from the repository from there.

 

Set oDrawing = oDiagram.Drawing("RW")
For Each oDItem In oDrawing.DrawingItems
    If oDItem.DrawClassName = "ModeDrwPath" Then
        'Set every path color to red : it works
        Set oLinePen = oDItem.Pen
        oLinePen.Color = &hFFFF0000
        oDItem.Pen = oLinePen

        'My issue is next line. RepositoryObject is always "Nothing"
        Set oRO = oDItem.RepositoryObject
    End If
Next

 

Note : I know that you can make custom shapes to solve this issue, but I have to use a VBS script.

1 Reply

xlebourd
New Contributor

OK... I got it... For each "ModeDrwPath" MegaDrawingItem, there is a "ModeOcc" child.

You can access it via the .SubDrawingItems collection.