convert AutoCAD to MicroStation DGN

convert AutoCAD to MicroStation DGN

mruPRQUJ
Advocate Advocate
5,532 Views
27 Replies
Message 1 of 28

convert AutoCAD to MicroStation DGN

mruPRQUJ
Advocate
Advocate

Hi,

 

I wonder if one lisp can be created to convert AutoCAD to MicroStation DGN. If it is possible, I will use ScriptPro to process lots of AutoCAD drawings, thank yolu very much in advance. 🙂

0 Likes
Accepted solutions (1)
5,533 Views
27 Replies
Replies (27)
Message 2 of 28

Moshe-A
Mentor
Mentor

@mruPRQUJ  hi,

 

check DGNOUT commnad (untested)

 

Note that there are some options to be set, leave it for you 😀

 

enjoy

Moshe

 

 

(defun c:dgnout (/ fname )
 (setq fname (strcat (getvar "dwgprefix") (vl-filename-base (getvar "dwgname")) ".dgn")) 

 ; if file already exist, delete it
 (if (findfile fname)
  (vl-file-delete fname)
 )
  
 (command "._-dgnexport" "_v8" fname "_Master" "Standard" "")

 (princ) 
); c:dgnout

 

 

Message 3 of 28

paullimapa
Mentor
Mentor
Message 4 of 28

ronjonp
Mentor
Mentor

@mruPRQUJ 

I'm pretty sure newer versions of Microstation can open DWG files.

0 Likes
Message 5 of 28

Jonathan3891
Advisor
Advisor

In my experience dgnout doesnt always work correctly. My recommendation is open Microstation and select File > Import > CAD files. You'd be surprised how well that works!


Jonathan Norton
Blog | Linkedin
0 Likes
Message 6 of 28

mruPRQUJ
Advocate
Advocate

Hello,

 

I am really sorry to reply to you so late as I am very busy with my work. Thank you very much all of you. The lisp works very well in a single DWG. But when it runs in ScriptPro, some files were failed. Please see attached the screenshot and the failed DWG file, thanks again.

0 Likes
Message 7 of 28

mruPRQUJ
Advocate
Advocate

Hi, It looks like the script did not work. I only changed seed file name as I did not have that seed file. Please see the script below, I may make a mistake, thanks a lot!

 

;Start of routine
-DGNExport
V8

 

Standard
;End of Routine

0 Likes
Message 8 of 28

paullimapa
Mentor
Mentor

looks like this dwg requires 3d seed file which you have to specifically write out in the script:

C:\Users\windows-user-login-profile\AppData\Local\Autodesk\AutoCAD 20##\R##.#\enu\Template\V8-Imperial-Seed3D.dgn


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 9 of 28

mruPRQUJ
Advocate
Advocate

Hi,

 

could you please advise me add it to the lisp or script? If it is the lisp, could you please add it to it? I do not know how to add it, thanks a million!

0 Likes
Message 10 of 28

paullimapa
Mentor
Mentor

Since the 3d seed is only required on some of the dwg to dgn conversion files but not all you’ll have to  manually convert those dwgs. 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 11 of 28

Moshe-A
Mentor
Mentor

@mruPRQUJ  hi,

 

Well the problem here is the selected dgn template file. it appears that this drawing need to be converted with a Seed3d template file. if you take "V8-Imperial-Seed3D.dgn"  instead "V8-Imperial-Seed2D.dgn"  it will work but your  problem is there is not command/tool/function that can identify which file is 2d and which need the 3d (at least i could not find)

 

Moshe

0 Likes
Message 12 of 28

mruPRQUJ
Advocate
Advocate

Is it possible to change it to 3D seed file? The first one is for 2D seed file, the second one is for the 3D seed files. Two lisps are used for different files, many thanks. 🙂

0 Likes
Message 13 of 28

Moshe-A
Mentor
Mentor

your problem is that you do not know which dwg (to be convert) need Seed3d template?

 

 

0 Likes
Message 14 of 28

mruPRQUJ
Advocate
Advocate

Do not need to identify them. To use 2D seed file first, to use 3D seed file second time to modify unchanged files, thanks a lot.:)

0 Likes
Message 15 of 28

Moshe-A
Mentor
Mentor

say you have a folder with 10 dwg to be convert to dgn.  the 1st is 2d the 2nd is 3d the 3th is 2d... up to last.

the script will stops at the 2nd what good it will do you if you have a second lisp?

 

 

0 Likes
Message 16 of 28

mruPRQUJ
Advocate
Advocate

Input enter, the script will continue to work. Or it will continue to work automatically, I will try it again later. After modifying 2D seed files, and then using the second lisp to modify 3D seed files, thanks

0 Likes
Message 17 of 28

mruPRQUJ
Advocate
Advocate

Hi,

 

The scripts work, I may make a mistake before. But I am not sure if it works well with 3D seed files, I will test it later, I can't thank you enough. 🙂 

0 Likes
Message 18 of 28

mruPRQUJ
Advocate
Advocate

The script only works with 2D seed file, not 3D seed file, many thanks. 🙂

0 Likes
Message 19 of 28

Jonathan3891
Advisor
Advisor

Did you try the method I suggested above?


Jonathan Norton
Blog | Linkedin
Message 20 of 28

mruPRQUJ
Advocate
Advocate

I know to use MicroStation to convert one DWG to DGN. But how to batch convert them? many thanks, 🙂

0 Likes