You are on page 1of 2

Dim tec1 As TransientElementContainer

Sub ShowTransientElements1()
Dim ele As LineElement
Dim flags As MsdTransientFlags
'
'

Use this pair of flags to make the elements in the container snappable a

nd
' to make them display on top of other elements
'
flags = msdTransientFlagsOverlay + msdTransientFlagsSnappable
Set ele = CreateLineElement2(Nothing, Point3dFromXYZ(15.696, 25.045, -0.64),
Point3dFromXY(20.194, 23.7592))
''
'' Create a new container and put a copy of the element into it. The conta
iner holds a copy;
'' changes to the original element are not displayed.
''
Set tec1 = CreateTransientElementContainer1(ele, flags, msdViewAll, msdDrawi
ngModeHilite)
''
'' Create anther element and append a copy of another element to the contai
ner.
'' Changes to the original element are not displayed.
''
Set ele = CreateLineElement2(Nothing, Point3dFromXYZ(15.696, 23.759, -0.64),
Point3dFromXY(20.194, 25.045))
tec1.AppendCopyOfElement ele
End Sub
Sub ShowTransientElements2()
Dim ele As LineElement
Dim flags As MsdTransientFlags
''
'' Since this overwrites the only reference to tec1, tec1 is automatically
freed. That process frees
'' the elements and erases the elements from the display.
''
'' This creates a container with no elements. Subsequent steps add the elem
ents.
''
Set tec1 = CreateTransientElementContainer1(Nothing, flags, msdView1 + msdVi
ew4, msdDrawingModeNormal)
''
'' Now create and add the elements.
''
Set ele = CreateLineElement2(Nothing, Point3dFromXYZ(15.696, 25.045, -0.64),
Point3dFromXY(20.194, 23.759))
tec1.AppendCopyOfElement ele
Set ele = CreateLineElement2(Nothing, Point3dFromXYZ(15.696, 23.759, -0.64),
Point3dFromXY(20.194, 25.045))
tec1.AppendCopyOfElement ele
Set ele = CreateLineElement2(Nothing, Point3dFromXYZ(15.696, 25.045, -0.64),

Point3dFromXY(20.194, 25.045))
tec1.AppendCopyOfElement ele
Set ele = CreateLineElement2(Nothing, Point3dFromXYZ(15.696, 23.759, -0.64),
Point3dFromXY(20.194, 23.759))
tec1.AppendCopyOfElement ele
End Sub
Sub ClearDisplay()
''
'' Since this eliminates the only reference, MicroStation automatically inv
okes Reset.
'' Therefore, it erases the elements and frees the copies of the elements.
''
Set tec1 = Nothing
End Sub

You might also like