CAD software discussion forum > CAD Tutorial & Tips > ZWCAD+ dot NET migration manual, use your autocad dot net application in ZWCAD+

ZWCAD+ dot NET migration manual, use your autocad dot net application in ZWCAD+

Rank: 5Rank: 5

Viola

posts: 10

Registered: 2013-7-12

Message 1 of 4

 ZWCAD+ dot NET migration manual, use your autocad dot net application in ZWCAD+
12-07-2013 05:35 . pm | View his/her posts only
ZWCAD+ 2014 supports dot NET application programming interface. You can easily migrate your autocad .net application to ZWCAD+. Following is the migration guide.

1. Open your solution with Visual Studio 2010, change project property [Compile->Advance Compile Options->Target framework (all configurations)] to .NET Framework 4.


ZWCAD dot net api

zwcad_dot_net_01.jpg
2013-7-12 17:35


2. In the References tab, replace the references to "acdbmgd.dll" and "acmgd.dll" with "ZwDatabaseMgd.dll" and "ZwManaged.dll", which are in ZWCAD+ installation directory.


ZWCAD dot net api

zwcad_dot_net_02.jpg
2013-7-12 17:35


3. If your project references to "Autodesk.AutoCAD.Interop" and "Autodesk.AutoCAD.Interop.Common", replace them with "ZWCAD.exe"

4. In your code, replace all the namespaces "Autodesk.AutoCAD.Interop" and "Autodesk.AutoCAD.Interop.Common" with “ZwCAD”, and replace all the namespaces "Autodesk.AutoCAD.xxxx" with "ZWSoft.ZwCAD.xxxx ".

5. If you use some objects named like Acadxxxx(for example, AcadLine), rename them as Zcadxxxx.

6. Then you can build your solution and use “netload” in ZWCAD+ to load your compiled dll file.


Try ZWCAD+ free for 30 days:
http://www.zwsoft.com/zwcad+/


Here are some posts about ZWCAD+ .NET that might be useful for you:
ZWCAD+ .NET elementary guidance
ZWCAD+ .net tutorials and sample codes summary

Rank: 1

Bug

Newbie

posts: 2

Registered: 2012-3-25

Message 2 of 4

13-02-2014 06:04 . pm | View his/her posts only
Reply 1# leilia3835

Hi,I am currently using the ZWCAD 2014 and trying to convert my .net code that i have created for AutoCAD using Object ARX to code suitable to run on ZWCAD as per the instructions in the post. The only problem that i encountered is finding a reference for BlockTableRecordEnumerator that i use in my Object ARX code. the code is as below is available in the attachment
code.rar (1.11 KB) :

Please help me out

Rank: 5Rank: 5

Jenny

posts: 474

Registered: 2013-5-6

Message 3 of 4

14-02-2014 03:00 . pm | View his/her posts only
Reply 2# e1245966091

ZWCAD+ dot net doesn't support BlockTableRecordIterator, we will fix it as soon as possible. (ID: T8595)


Here is a temporary solution to this problem:


change the codes


BlockTableRecordEnumerator oBtre = oBtr.GetEnumerator;
while (oBtre.MoveNext) {
Entity oEnt = (Entity)oTrans.GetObject(oBtre.Current, OpenMode.ForRead);
...
...
...
}


to


foreach (ObjectId objID in oBtr) {
Entity oEnt = (Entity)oTrans.GetObject(objID, OpenMode.ForRead);
...
...
...
}


Rank: 1

Bug

Newbie

posts: 2

Registered: 2012-3-25

Message 4 of 4

24-04-2014 03:24 . pm | View his/her posts only
Thanks Jenny...
But when i am trying to use 'BlockTableRecordEnumerator' in my .NET plugin that i am creating for ZWCAD 2014 it gives me a error saying "The type or namespace name 'BlockTableRecordEnumerator' could not be found (are you missing a using directive or an assembly reference)"

Can you help me out by telling which reference should i add or what namespace should i used to overcome the error...

You are my last hope.. Please help me out :(
See also