A project for you VBA Guru's

#1
I was wondering about something.... there is a free to use OpenDGN Toolkit available (free as long as you don't sell the software) and I was thinking that maybe some brighspark out there could write a VB routine that would use that toolkit so that we could click on a menu/butoon called DGN in and the VB routine would read the DGN, translate it into DXF (it doesnt support DWG) and insert it into a new drawing. Would that be possible/feasible?

The OpenDGN Toolkit is available from: http://www.cybertal.com/components/prod ... endgn.html

Anyway, I was just thinking
Image


Regards,




------------------
Michael John Smyth
Irish / UK Representative
Efnet Autodesk Users Group
www.eaug.org

#2
Michael,

I noticed that CADopia Support have taken a look at this for you.

I should point out that they have used the Common Dialog Control and that this is a licensed control for use in Visual Basic. It unfortunately cannot be accessed on your system because a copy of Visual Basic has not been installed.

It is also a breach of Microsoft’s VB Licensing to use or distribute the Control in VBA without holding a licence for VB.

Now for the good news – pop over to http://www.vbdesign.net/cadpages Select Active X Downloads and down load the code Common Dialog.

This is a free OCX control that you can legally use or distribute with VBA applications.

If you need any further help with registration or use I may be able to help or just ask The Wonder Llama at vbdesign – Ralph.


------------------
Regards
John Finlay
Don't want to post a question - email me direct on john@acecad.com.au

#3
Hi,
Thanks for that John. CVADopia Support emailed me to tell me that they had used a control that was obviously not installed on my PC and were working to get around the problem. I presume you will have no problem if I point them in the direction of that control.

Hopefully using it the little routine will work and we will have DGN import of a kind into Intellicad. I wish that I could program these things instead of coming up with the ideas, ah well
Image


Thanks once again.
Regards,


------------------
Michael John Smyth
Irish / UK Representative
Efnet Autodesk Users Group
www.eaug.org

#6
John,

I have the 2001 PE version and was trying to utilize this VBA routine however when I try to insert the common dialog control I get the error that it is not licensed properly. I thought the PE version came with and installed this portion of VBA? Am I wrong or was there an installation error?

You help would be greatly appreciated.

Thank you,

Scott

[This message has been edited by Scott (edited 10-24-2001).]

#7
Scott,

Check out these steps below - they may help.

To register the Common Dialog Control:
1/ Create a Folder - named say myOCX in the root directory.
2/ UnZip the download into myOCX - you will see the LlamaDialog.ocx file
3/ From the Windows taskbar select Start-->Run and type regsvr32 "C:\myOCX\LlamaDialog.ocx
4/ You should receive a confirmation message the ocx is now registered.

To use the LLamaDialog.ocx
1/ Open ICAD and type VBA to open the IDE.
2/ Select the new drawing name (Drawing 1) in the Project Window (upper left window)
3/ From the Pull Down menu select Insert-->userform
4/ you will see a new form and a ToolBox with a Controls tab
5/ Right click in the Controls tab area without selecting a control and a dialog will appear with "Additional Controls"
6/ Select Additional Controls and a dialog will appear - deselect Show - "Selected items only" tick box.
7/ Scroll down and select box adjacent to LlamaDialog.vbdComDialog - then OK
8/ You will now see a new icon on the ToolBox Controls tab
9/ Follow the rest of CADopia's requirements only use the vdbComDialog
10 Alter the code to all references to CommonDialog1 and substitute vbdComDialog1 e.g. CommonDialog1.InitDir = IntelliCAD.Path must be changed to vbdComDialog1.InitDir = IntelliCAD.Path - you can do this using Edit--> Replace there are 10 references that need altering.

I haven't tried to use the code however Michael has got it working and he may be able to assist you further.


------------------
Regards
John Finlay
Don't want to post a question - email me direct on john@acecad.com.au

[This message has been edited by John Finlay (edited 10-24-2001).]

#8
John,

Thank you for the response and your time. I got the ocx to register fine, however, replacing CommonDialog1.InitDir with vbdComDialog1.InitDir does not work. The routine stops on the InitDir statement, it happens the same with the other replacements. I don't have time at the moment to look further into it (I am not a VBA expert). Thank you again,

Scott

#10
Michael,

Thank you for the help. It works!
One thing though, the dgn file is converted to a dxf file with only lines. Everything is exploded, no faces, etc. Does retain the 3rd dimension. It saves in release 12 dxf.

Sometimes this may not be very useable. A 3 meg dgn file went to a 27 meg dxf, WOW!

Is there any way to not explode all of the entities??

Thank you,

Scott

#11
Hi Scott,
Unfortunately neither I nor CAdopia have any control over DGN2DXF. It is a sample application developed by Cybertal using their OpenDGN2 Toolkit.

The CEO of Cybertal has been in contact with me though and they are going to email me the latest build of DGN2DXF, when they do, I will post a link to it here. It will be a simple matter to replace the file.

Having said all that, anyone can become a memeber of the OpenDGN for free as long as they do not use the toolkit for commercial value, ie make something and sell it. So the source code is available and I am sure that some genius out there could update the code every now and again and post it.

As for a 3mb DGN file jumping up to a 27mb DXF, wow is all I can say, I only use it for converting 2D drawings. I think in a recent email from cybertal, they mentioned that the whole 3D side was going to be improved. I will check it out and get back to you.

Regards,



------------------
Michael John Smyth
Irish / UK Representative
Efnet Autodesk Users Group
www.eaug.org