How to copy elements from one .dgn to another - Road and Site Design - Forum - Road and Site Design - Bentley Communities

How to copy elements from one .dgn to another

Hi All:

How do you copy elements from one .dgn file to another and keep the elements at the same x, y.

In AutoCad I would copy and paste at 0,0...but can't find the command in Microstation.

Thanks!

50 Replies

  • Reference the file you want to copy the elements from to the file you want to copy the elements to.

    Select the elements you wish to copy.

    Click "Copy" command.

    Snap (tentative) to a location and accept. Snap to an element as you want to be able to replicate this location for the next step.

    Snap to the same location and accept.

    The Elements will be copied into the new DGN at the same loacation.

    HTHs.

  • In reply to MichaelGilham:

    Thanks, I try that.

    I used the "import cad files" but the dwg file does not come in at the same x,y...why?

  • In reply to ktm125:

    Could be different "Global Origin" settings between the DWG and the DGN you are importing the data to OR it could be different units of resolution between the files.

    It can sometimes be tricky to work out exactly the differences between files - there are many user defiend settings that can cause differences like you have seen.

  • In reply to MichaelGilham:

    When you attach the reference, try attaching you Coincident World. As long as the coordiantes can match it should come in where you want.


  • In reply to MichaelGilham:

    You can also use File > Reference > Attach .dgn file (it lets you attach at the proper location). Then highlight that reference file and select Tools > Merge into Master.  It again lets you select the proper location.  Check that you don't have any scale or rotation factors turned on.  This should merge all dgn graphics.
  • In reply to Bear:

    I tried the attach (using the coincident world) and copy but x,y is still not exact.

    Very suprised that there is not a simple cut and paste at 0,0 command!

    Have to attach the dwg file, then copy and then dettach...seems kind of a long process

  • In reply to ktm125:

    When attaching a dwg file there is no option for coincident world but just coincident....so when I attach a dwg at coincident the file is not at the correct x,y
  • In reply to ktm125:

    thermal:

    Very suprised that there is not a simple cut and paste at 0,0 command!

    Sure there is, just open the Key-In (similar to acad) from Utilities > Key-in and during the copy command type in dx=0 dy=0.

     

  • You mean

    dx=0,0,0

    or

    DX=

    for short.

    CADDCOP

    Using MicroStation since...

    IGDS!


  • In reply to calistrat:

    Could you explain in steps for using the keyin to copy elements from one file to another? Thanks!
  • Greg,

    Also try using the MicroStation FF= key-in.  In the Index of the MicroStation help file, key in fence file and you should see the corresponding help file that provides more explanation on how the key in works.  I have used this key in successfully in the past.  See if it works for your situation.  This should only be used if you are trying to copy the elements to a new DGN file.

    Thanks,

    Jason Smithey

  • In reply to Jason W. Smithey [Bentley Civil]:

    Just out of curiosity, have you tried to convert the file to a dgn and then attach at the correct coordinates? This would at least get around that part of the problem.


  • In reply to ktm125:

    Identify the elements to be copied - this is either with a fence, by selection set or individually.

    When the copy command askes for you to accept the selection, thats when you key in:

    DX=,,

    And that issues the acceptance point at the same coordinate (delta x,y,z of 0,0,0)

    With fence or selection, you are identifying the point to copy from first. This is like AutoCAD Base Point. With individual elements, the point on which you identify the elements is the base point.

    DX=0,0,0 is like @ in AutoCAD.

    CADDCOP

    Using MicroStation since...

    IGDS!


  • In reply to caddcop:

    Can't figure it out....

    1. select elements
    2. right click menu...copy to clip board
    3. key in DX=,,
    4. open another file
    5. right click menu...paste from clip board?????

    the elements are just floating waiting for data point

  • In reply to ktm125:

    thermal:

    Can't figure it out....

    1. select elements
    2. right click menu...copy to clip board
    3. key in DX=,,
    4. open another file
    5. right click menu...paste from clip board?????

    the elements are just floating waiting for data point

    Wrong order and commands, try this:

    1.  select elements
    2.  DX=0,0
    3.  right click menu...copy to clip board
    4.  open another file
    5.  right click menu...paste from clip board
    6. DX=0,0

    --Kevin

  • In reply to kevinwhitehouse:

    what's after # 6?

    the elements are still floating and puts them at the data point selected and not at 0,0

  • In reply to kevinwhitehouse:

    I seem to have the same problem as Thermal. When you open a new drawing in MicroStation, and select the right click/paste from clipboard, the element selection set shows up in the new drawing, and moves dynamically, waiting for the user to pick a point where the elements should be placed. If you key in DX=0,0 the elements will be placed somewhere in the drawing that's related to the last data point in the drawing (I think).  The Dx=0,0 in step 2 described above doesn't really seem to do anything, and the DX=0,0 in step 6 doesn't seem to relate to the previous drawing in any way. It seems to me that attaching as a reference file is the only way to go, unless I'm missing something crucial.
  • The DX= is to copy elements from a reference file into the active file at their same location using the regular copy tools - not the clipboard..

    If you wany to put something in the clipboard at a known origin:

    1. Make your selection set.
    2. Tentative Snap to the desired origin point but do not accept the tentative.
    3. On the Edit menu, select Copy.
    4. Open another file. Select Edit > Paste. The origin you snapped to is the insertion point of the copied selection - at this point, you either snap to a known point and accept it to paste it there, or if you know the coordinate, key in XY=nnnnnn,nnnnnn to issue a data point at that coordinate.

    CADDCOP

    Using MicroStation since...

    IGDS!


  • In reply to caddcop:

    LOL!

    Seems this is not understood here....still waiting for step by step how to accomplish this from the clipboard...

    So simple in AutoCAD...seems Microstatioin is lacking in this (needs a command to copy and paste from clipboard using a base input)

     

    Thanks all but can't get anything to work and can't find any info in the help menu.

    In Civil I use this command all the time to transfer elements from one file to another, don't want to attach the file, just need a simple copy to clipboard and paste into another file at the same base point

    I spoke to support on this matter, and they did'nt know how to do it without a ref attach

  • In reply to ktm125:

    Hey your post disappered...which doens't work for me anyways...

  • In reply to ktm125:

    Which is why I deleted it.....I realized it wasn't working everytime, and was not a good option to share.

    --Kevin

  • In reply to ktm125:

    From what you describe, it sounds as though you are looking to "reuse" data across designs. If that is the case, the workflow it sounds like you are describing (i.e. copying data from one file to the next to the next to the next... ad infinitum) basically results in "cloning" information, which is a data management nightmare (believe me, having been there many times, I have felt that pain all too often). The major downfall to doing that is that if one of the "things" that has been copied needs to be changed, then you have to go through an insane process of having to identify all the files/models that contain the cloned information and process each and every one of those independently.

    In MicroStation, that is avoidable because the "standard" way of reusing data across designs is through references (both for design data and "sheet" data). If you haven't yet, that is something you really should take a look at.


    This is a test

  • In reply to Phil Chouinard - Bentley:

    thanks for the reply but I understand refs

    what I need is a way to transfer elements from one file to another using the clipboard and have the elements come in the other file at the same absolute x,y as in the file that they were copied from

    I use refs all the time, but sometimes I have elements in one file that I want to transfer to another file

    the commands in AutoCAD are "copy with base point" and "paste with base point"

    so I just copy from 0,0 and paste with 0,0 so the elements are in the exact location as in the file I copied from

    it appears Microstation doesn' t have this command

    I just can't believe the only way to accomplish this is to attach and then detach the file

    I have tried the suggestions mentioned here...but they simply do not work for me

    I've called support about this and they told me they don't know how to do it without refs

    I can't find the info in the help menu

    Are there any other places I could try for help?

  • In reply to ktm125:

    thermal:

    what I need is a way to transfer elements from one file to another using the clipboard and have the elements come in the other file at the same absolute x,y as in the file that they were copied from

    Please describe the exact reason why you want to do just this (and why taking advantage of references -- thus minimizing data redundancy, etc. -- will not provide what you are looking for). TIA


    This is a test

  • In reply to Phil Chouinard - Bentley:

    LOL!  thanks again for your reply!

    Because I want to move elements from one file to another....

    Like I said...I fully understand refs!

  • In reply to ktm125:

    Glad you can laugh, but I am being very serious. Please explain why (exactly) you want to copy and not reference information from one file to the next to the next to the next to the next to the next... etc.


    This is a test

  • In reply to Phil Chouinard - Bentley:

    To Expand on the process Cadd Cop laid out..

    1. Select the element or elements you want to copy

    2. Tentitive snap at to the insertion location.. (In theory you could locate a point at the x 0, y 0 location and snap to this..)

    The X,Y location tentative snapped to will now appear in the message center at the bottom of the screen.

    3. Click Edit > Copy 

    4. Edit > Paste - Make Accudraw active in the file being pasted to (use your space bar to toggle through accudraw you will want accudraw to be set to XY, 2D file or XYZ 3 D file)...enter the X Y in accudraw, this will place the insertion point exactly where you want it. DP to locate.

     

    Mike Barkasi

    Bentley Professional Services

     

    Michael Barkasi

    Bentley Civil

    Professional Services

  • In reply to M Barkasi:

    Mike Barkasi's solution seems to be on the right track, but I still can't get it to work right. If I use X,Z as 0,0 in my first drawing, when I tentative snap to the insertion location, and then I go to my second drawing and key in 0 and 0 in my accudraw fields, what I get is the insertion point at 0 units and 0 units (x,y) away from the location where my accudraw crosshairs are located when I open this second drawing! I'm not sure why, but when I get into the second drawing, the accudraw crosshairs are somewhere in space, not necessarily at 0,0, and keying in 0,0 in the accudraw fields will just keep the insertion point in the same place where the crosshairs appear when I opened the drawing.

    I noticed that I can follow Mike's procedure and get it to work if I actually snap to 0,0 in the second drawing, so if I draw a dummy line at 0,0 and snap to it after going to Edit>Paste, then I can get it to work.

    I think the problem is that keying in 0, 0 in the accudraw dialog box, places the datapoint at unites relative to its current position, not absolute coordinates 0,0. I think there's a way to change this in the accudraw settings, but I'm not sure.

  • If you've ever tried to copy elements from an XREF in AutoCAD, you might think the process in MicroStation is fraught with peril, but MicroStation's Reference Files are far more flexible and friendly than AutoCAD.

    The idea of attaching a reference file to copy a few elements from another file seems very foreign to an AutoCAD user, but long before either of these packages supported the Windows Clipboard, that was the only way to do this. In AutoCAD, you would have to WBLOCK out the elements and INSERT and EXPLODE to accomplish the same thing. And that left the DWG sitting somewhere on your drive.

    With the MicroStation workflow, the preocess was simple and fast. And everyone used the XY, DX, DL keyins all of the time, so they were like second nature.

    This process also allowed you to fix global origin or datum shifts. You could use the move reference command to get the reference file into the proper datum and coordinates and then copy or merge the data into the active file. All you needed was one point of commonality in both files to line up and if the master units were identical, set a scale of 1:1 and even adjust for working units discrepancies.

    CADDCOP

    Using MicroStation since...

    IGDS!


  • In reply to caddcop:

    This works for me...

    1. Select elements to copy
    2. Tentative snap at 0,0 or base point
    3. Copy
    4. Paste
    5. DP to 0,0 or base point
  • In reply to ktm125:

    OK this is how I do it without using the clipboard but using a fence to select the data.
    1. Reference the source file (the one that contains the data) into the destination file.
    2. Turn on/off the levels that contain the data I want in the source file.
    3. Use the fence icon to place a fence around the data I wish to copy (note the inside/overlap/etc options on the fence menu).
    4. Use the copy icon and select a point anywhere on the dgn to define the origin.
    5. In the key-in window type dx=0 and this will then place the data into the destination file.
    As ever there are many ways of achieving the same objective.
    Good luck
    Mike
  • In reply to Gaucho:

    I went through this discussion almost 2 yrs ago. Trying to use the clip board is cumbersome in ustn for the very reason that you have to create a reference snap element at 0,0. The easiest way to do it is via XREF and then merge or select and copy, as has been mentioned. It really is no more work than opening the source file, selecting and copying to the clip board. There are certain advantages to the reference approach anyway such as you don't have to have 2 drawing sessions open at once and you also get the elements transformed to suit your drawing units and coordinate system, something you can't do with the clip board.

    The main advantage to the clip board is when you need to paste the clip board data into several model files or layouts i.e. "cloning" as Phil pointed out. Sometimes we do need to do that Phil, typically when adding some type of sheet text common to multiple layouts and needing to position it independently. Of course that could be done with a reference too but it having reference files for numerous pieces of text like that can result in a lot of references.

    Neil Wilson (aka Neilw)

    Power Civil v8i 08.11.07.245

    AutoCAD Civil 3D 2013

  • In reply to neilw:

    Fully understand the ref way, this thread is for the none ref way.
  • In reply to caddcop:

    caddcop:

    The idea of attaching a reference file to copy a few elements from another file seems very foreign to an AutoCAD user, but long before either of these packages supported the Windows Clipboard, that was the only way to do this. In AutoCAD, you would have to WBLOCK out the elements and INSERT and EXPLODE to accomplish the same thing. And that left the DWG sitting somewhere on your drive..

    yes I remember when the windows clipboard command became available in AutoCAD, and it was just as you describe before the command was available

  • In reply to ktm125:

     

    thermal

    This works for me...

    1. Select elements to copy
    2. Tentative snap at 0,0 or base point
    3. Copy
    4. Paste
    5. DP to 0,0 or base point

    Can you help, I'm stuck on step 2. How do you get the snaps to turn on so you can create the tentative snap point? I know what my tentative snap button is, but I don't know how to turn snaps on before I use it.

    (AccuSnap enabled, Snap Lock on, Keypoint on)

  • In reply to steve.k:

    Finally I found the solution to exactly imitate the autocad copy with basepoint command in this thread! The solution is to make a tentative snap as described earlier. I´ll try to clarify the instructions thermal wrote since they are not so very detailed.

    1. Select element(s) to copy

    2. Make a tentative snap at desired basepoint by klicking right and left mouse button at the same time. (It's also possible to get a snap! First press and hold ctrl+shift, then move the mouse without pressing any button on it. When the snap symbol is at the desired location, release ctrl+shift and make tentative snap before the snap symbol dissapears.)

    3. Edit, copy or crtl+c

    4. In the other file: edit, paste or ctrl+v

    5. Move the mouse pointer to the basepoint and accept with left mouse button.

    Phil: This workflow is very often desirable. You often want to use it when you want to add an element to several files to the same location. Maby a text element that has to be placed in each drawing at the same place but with different content in each drawing. Being able to paste it to it's correct location on the fly saves a lot of clicks. Even if you have to manipulate it after it's been pasted time has been saved since a few seconds of saved time can become hours if you have to do this on many places. The reference method just isn't applicapable in theese cases. There is also a nuber of other cases that this procedure is quick to use but I can't explain them all. You have to take my word for it.

    Actually this is a question that comes from, I would say, every new co worker that's been using AutoCad in their previous office. Until now I've always answered them that it's not possible in Microstaion and they can't believe it's true...

    Obviously one would like to have this function more easily accessible. Right click element, select copy with basepoint from the meny or something like that.

     

  • In reply to IngemarK:

    Ingemark,

    From my perspective, using a tentative snap is not the issue. The problem is how to tentative snap precisely to coordinate 0,0. Without an element at that point there is no way to use a tentative snap. How do you do it?

    Neil Wilson (aka Neilw)

    Power Civil v8i 08.11.07.245

    AutoCAD Civil 3D 2013

  • In reply to neilw:

    Since you need to issue a tentative snap without accepting it, there is no way that I know of to set the "base point" to a keyed in coordinate. Unless you try programmatically.

    I seem to recall making a macro that issued a tentative point at a point from a data point. It was three jobs ago, and at least four years, so I cannot recall the reason or workings. And as this was from a Pre-V8 time for me, it was an MBE Basic macro, not a VBA macro.

    The was a MbeSendTentPoint in MBE Basic, and there is a SendTentativePoint method in MVBA, so I must assume that given a block of time, it would not be too hard to cobble together a VBA Macro that could create a "Copy to Clipboard with keyed-in basepoint" tool.

    CADDCOP

    Using MicroStation since...

    IGDS!


  • In reply to neilw:

    neilw,

    Your'e right. The tentative snap method only works with a reference element. Luckily for me this is often what i need. But how to do it relative to 0,0 without having an element there I don't know.

  • In reply to IngemarK:

    Hi again neilw,

    Not saying it's optimal, but this method might be something to give a chance.

    Select element to copy, then run the following macro:

    (The VBA-script places a point in 0,0 then makes a tentative snap to it and copies the selection to the clipboard.)

    Sub copyatzero()

       Dim startPoint As Point3d

       Dim point As Point3d, point2 As Point3d

       Dim lngTemp As Long

    '   Start a command

       CadInputQueue.SendCommand "PLACE POINT"

    '   Coordinates are in master units

       startPoint.X = 0

       startPoint.Y = 0

       startPoint.Z = 0#

    '   Send a data point to the current command

       point.X = startPoint.X

       point.Y = startPoint.Y

       point.Z = startPoint.Z

       CadInputQueue.SendDataPoint point, 1

    '   Send a tentative point

    '   Coordinates are in master units

       CadInputQueue.SendTentativePoint Point3dFromXYZ(0, 0, 0#), 1

       CadInputQueue.SendCommand "MDL KEYIN CLIPBRD CLIPBOARD COPY"

       CommandState.StartDefaultCommand

    End Sub

    Go to the other file and ctrl+v. You have to snap to 0,0 in the other file yourself. (The last step is probably possible to script as well, but I won't do it now.)

  • In reply to IngemarK:

    Posting the paste script as well. If you assign these two scripts to two corresponding buttons you have a good copy/paste to original coordinates functionality.

    Sub Pasteatzero()

       Dim startPoint As Point3d

       Dim point As Point3d, point2 As Point3d

       Dim lngTemp As Long

    '   Start a command

       CadInputQueue.SendCommand "MDL KEYIN CLIPBRD CLIPBOARD PASTE"

    '   Coordinates are in master units

       startPoint.X = 0#

       startPoint.Y = 0#

       startPoint.Z = 0#

    '   Send a data point to the current command

       point.X = startPoint.X

       point.Y = startPoint.Y

       point.Z = startPoint.Z

       CadInputQueue.SendDataPoint point, 1

    '   Send a reset to the current command

       CadInputQueue.SendReset

       CommandState.StartDefaultCommand

    End Sub

  • In reply to IngemarK:

    have you all watched: NINJA POINT (some more to laugh)

    communities.bentley.com/.../paste-elements-at-same-graphical-location.aspx

    Regards

    Frank

    CAD/GIS : [Bentley MS V4 - V8i, GeoGraphics, Map, InRoads     ;Intergraph Siteworks;  AutoCAD Map/Civil, HHK Geograf, IBr DAVID, Sysdeco GINIS, AED-SICAD]  Dev: [C, C++, Basic , Visual Basic, Java, SQL, FORTRAN, C#, UML, SOA,] "Wer Kritik übel nimmt, hat etwas zu verbergen" [direct quote by: http://en.wikipedia.org/wiki/Helmut_Schmidt]

  • In reply to IngemarK:

    I thought that it should be possible to skip the point placement - who wants to leave an point at 0,0,0 in a file anyway? However, it appears that a tentative snap in space is not the same as a tentative snap on an element.

    So it might be possible to place the point, snap to it, copy to clipboard and undo the point placement. Or to place a transient element at 0,0,0 which would simply go away on its own.

    And with this code:

    If Not ActiveModelReference.AnyElementsSelected Then

         ShowError "The macro requires a selection set"

         Exit Sub

    End If

    You can even exit if no selection set is active.

    One more thing - on the Pasting End ...

    The simple key-in of XY= is sufficient to specify a paste point of 0,0,0

    CADDCOP

    Using MicroStation since...

    IGDS!


  • In reply to caddcop:

    Actually the point is not left in the file after the script has run.

    Of course it's possible to develop the script further as you suggest, but I'm no expert at VBA so I leave it to others.

  • In reply to IngemarK:

    Should we really have to go through all this trouble just to set a base point? Autocad has the feature built in.

    Neil Wilson (aka Neilw)

    Power Civil v8i 08.11.07.245

    AutoCAD Civil 3D 2013

  • In reply to IngemarK:

    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.

    Sub CopyClipboardWithBasePoint()

       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"

           Exit Sub

       End If

    '   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

    End Sub

    CADDCOP

    Using MicroStation since...

    IGDS!


  • In reply to caddcop:

    Thank's for the improved code.

  • In reply to IngemarK:

    Hi,

    so here's how I do it, just to add another method.

    1. select the items to copy

    2. active the normal copy command (type 31)

    3. move the mouse to the origin (i always have the corner of the title block there so I will see the yellow tentaive accusnap icon appear on the origin)

    4. ctrl + c

    5. cancel the active copy commmand (I only activated it to get the tentaive accusnap, you can use move or any other command if you want)

    6. open the new drawing

    7 ctrl + v to paste and click on the origin again.

    obviously this won't work if you don't have something at the origin to tentative accusnap to.

    shouldn't really be that hard to have copy with base point on the edit menu should it...

  • In reply to cjmurph:

    Any comments from Bentley why this simple feature is missing?

  • In reply to IngemarK:

    Select your elements, invoke the regular copy command, hover over the desired base point until your preferred snap pops up, then press Ctrl +C on your keyboard and your good to go.

    Ctrl +V will then place your objects with the desired base point in another drawing or the same drawing if you like.

    Regards

    Joe

     

Recommended
Related