When I tried it, it certainly was left in the first file. However, here is a version that uses a transient element and eliminates the problem. I added the test for a selection set, added code so the last view used by the user is used for the copy. This can be critical if view 1 is rotated from top orientation but the user was working in a different view.
Dim ele As LineElement
Dim flags As MsdTransientFlags
Dim activeView As View
' Exit the macro if there is no selection set and explain it to the user...
If Not ActiveModelReference.AnyElementsSelected Then
ShowError "The macro requires a selection set"
' Get the last view a user interacted with since we want to copy
' the selection set based upon that view.
Set activeView = CommandState.LastView
' Use this pair of flags to make the elements in the container snappable and
' to make them display on top of other elements
flags = msdTransientFlagsOverlay + msdTransientFlagsSnappable
Set ele = CreateLineElement2(Nothing, Point3dFromXYZ(0#, 0#, 0#), Point3dFromXY(0#, 0#))
' Create a new container and put a copy of the element into it. The container holds a copy;
' changes to the original element are not displayed.
Set tec1 = CreateTransientElementContainer1(ele, flags, msdViewAll, msdDrawingModeHilite)
' Send a tentative point
' Coordinates are in master units
CadInputQueue.SendTentativePoint Point3dFromXYZ(0#, 0#, 0#), activeView.Index
' Start the command
CadInputQueue.SendCommand "MDL LOAD CLIPBRD COPY"
Set tec1 = Nothing
CADDCOP (Chuck Rheault)
- MicroStation user since IGDS!
- InRoads user since TDP!
- Dragged kicking and screaming into the world of Civil 3D, too!