Converting multiple 3D dgn files to 2D

Status
Not open for further replies.

Vidyadhar

Usenet Archive
Joined
Dec 6, 2001
Messages
10
Reaction score
0
Dear Jon,

I tried your solution as follows

command line syntax,

ustation -wacnvdgn -iinname:c:\temp\test\*.dgn
-ioutname:c:\temp\test_2d\\
-ipauseScreen:off

also I tried following

ustation -wacnvdgn -iinname:c:\temp\test\*.dgn
-ioutname:c:\temp\test_2d\\

Still Microstation text window with message "Press any key to continue" appears !

Also when i supplied wrong parameters, help shown by program in microstation text window did not have pauseScreen parameter in it as follows

Command Line Syntax: msbatch cnvdgn <option1 option2 option3...>

Example: (Convert 3D Design Files \dgn3d to 2D Files in \dgn2d) msbatch cnvdgn inname:\dgn3d\*.dgn outname:\dgn2d\

Options:
inname:<inputfilename> (May contain wildcards) outname:<outputfilename> view:<1-8> reference:<none|merge|maintain|convert> elevtype:<fixed|conzlo|conzhi|elemzlo|elemzhi> (2d => 3d only) elevation:<elevation value> (2d => 3d only)

I am using microstation SE !

Please help !

Regards,

V.S. Jangale

Subject:
Re: Converting multiple 3D dgn files to 2D Thu, 6 Dec 2001 09:22:20 -0000 "Jon Summers" LA Solutions comp.cad.microstation.programmer 1

Vidyadhar ...

Does anybody has source code of cnvdgn.ma or similar mdl for converting multiple 3D dgn files to 2D?

Use this modified version of MSBATCH.DGN. The comments explain what's going on.

@echo off
rem Edited version of \MicroStation\msbatch.bat
rem Converts 3D=>2D files using delivered cnvdgn.ma
rem
rem Command Line Syntax: msbatch cnvdgn <option1 option2 option3...> rem rem Example: (Convert 3D Design Files \dgn3d to 2D Files in \dgn2d) rem msbatch cnvdgn inname:\dgn3d\*.dgn outname:\dgn2d\ rem rem Options:
rem inname:<inputfilename> (May contain wildcards) rem outname:<outputfilename> rem view:<1-8> rem reference:<none|merge|maintain|convert> rem elevtype:<fixed|conzlo|conzhi|elemzlo|elemzhi> (2d => 3d only) rem elevation:<elevation value> (2d => 3d only) rem pauseScreen:<on|off> rem rem runwait ustation -wa%1 -i%2 -i%3 -i%4 -i%5 -i%6 -i%7 -i%8 -i%9 rem runwait ustation cnvdgn inname:\dgn\*.dgn outname:\dgn2d\ rem rem This is a debugged version that solves Bentley's incomplete rem documentation. Note that the final double back-slash is intentional. rem runwait ustation -wacnvdgn -i"inname:<intput file path>" -i"outname:<output file path>\" rem rem Example to convert all dgn files in directory L:\Maps\dgn3d\ to rem their 2D version in directory L:\Maps\dgn2d\ runwait ustation -wacnvdgn -i"inname:L:\Maps\dgn3d\*.dgn"
-i"outname:L:\Maps\dgn2d\\
"
 
Vidyadhar ...

I tried your solution as follows

command line syntax,

ustation -wacnvdgn -iinname:c:\temp\test\*.dgn
-ioutname:c:\temp\test_2d\\
-ipauseScreen:off

also I tried following

ustation -wacnvdgn -iinname:c:\temp\test\*.dgn
-ioutname:c:\temp\test_2d\\
...

I confess that the batch file was developed for MicroStation/J, and not for SE. It took a while to work out the inconsistencies in the Bentley technical notes. You must be prepared to explore the functionality in SE, maybe with the help of your local friendly Bentley support staff (or upgrade to J.
 
You have to write a little C routine to supress the DOS message window. The createprocess func in SDK has an argument CREATE_NO_WINDOW to do that. Below is a sample code

static STARTUPINFO StartupInfo;
static PROCESS_INFORMATION ProcessInfo;
sprintf(cmd,"%sustation -wacnvdgn -iinname:inp3d.dgn
-ioutname:out2d.dgn -ipauseScreen:off", ustndir);

StartupInfo.cb = sizeof(STARTUPINFO);
StartupInfo.lpDesktop = NULL;
StartupInfo.lpTitle = NULL;
StartupInfo.dwX = 0;
StartupInfo.dwY = 0;
StartupInfo.dwXSize = 0;
StartupInfo.dwYSize = 0;
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_HIDE;

ProcessInfo.hProcess = NULL;

if (!CreateProcess(
(LPCTSTR) NULL,
(LPTSTR) cmd,
(LPSECURITY_ATTRIBUTES) NULL,
(LPSECURITY_ATTRIBUTES) NULL,
(BOOL) FALSE,
(DWORD) CREATE_NO_WINDOW,
(LPVOID) NULL,
(LPVOID) NULL,
(LPSTARTUPINFO) &StartupInfo,
(LPPROCESS_INFORMATION) &ProcessInfo)) status = -1; sleep(10); CloseHandle(ProcessInfo.hProcess); CloseHandle(ProcessInfo.hThread);

Hope this helps,
Andu

(Vidyadhar) wrote:
Dear Jon,

I tried your solution as follows

command line syntax,

ustation -wacnvdgn -iinname:c:\temp\test\*.dgn
-ioutname:c:\temp\test_2d\\
-ipauseScreen:off

also I tried following

...
 
Status
Not open for further replies.

Latest threads

Back
Top