Product : Engine, Version : 5.0.1.1035, ArticleID : 41023830

HowTo : SelectionSet and Mirror

Article41023830
TypeHowTo
ProductEngine
Version5.0.1.1035
Date Added1/12/2005
Submitted byDick Knighton
Keywords

Subject

SelectionSet and Mirror

Summary

I am having trouble trying to mirror some lines. I have an array of lines :

Can I create a selection set of lines to mirror them?

something like:

Dim vBolt(1 to 9) as vdline
For index = 1 to 9
    selset.add vBolt(index)
next

Solution

Check the code below :
Dim aLines(8) As vdLine
Dim i As Integer
    VDStd1.CommandAction.CmdRect Array(-1, -1), Array(11, 11)
    For i = 0 To UBound(aLines)
        Set aLines(i) = VDStd1.ActiveDocument.Entities.AddLine(Array(2# + i, 0#), Array(0#, i + 2#))
        aLines(i).Invalidate
    Next i
    VDStd1.CommandAction.Zoom "E", 0, 0
    MsgBox "Lines created"
    Dim SelSet As vdSelection
    Set SelSet = VDStd1.ActiveDocument.Selections.Add("MySelSet")
    For i = 0 To UBound(aLines)
        SelSet.AddItem aLines(i)
    Next i
    SelSet.HighLight = VdHightLightDot
    SelSet.Invalidate
    MsgBox "Selection set created and contains " & CStr(SelSet.Count) & " lines"
   
    VDStd1.CommandAction.CmdMirror SelSet, Array(0, -1), Array(10, -1), "Y"
    VDStd1.CommandAction.Zoom "E", 0, 0
    MsgBox "Selection Set mirrored"