CAD/CAM discussion forum > CAD > AutoCAD .net migration to ZwCAD+2014 .net

AutoCAD .net migration to ZwCAD+2014 .net

Rank: 1

AGSAO8682

Newbie

posts: 3

Registered: 2013-12-4

Message 1 of 4

 AutoCAD .net migration to ZwCAD+2014 .net
08-12-2013 06:34 . pm | View his/her posts only
I've developed a .net application on AutoCAD2010 version 18.0, I tried to convert its code into ZwCAD+2014 .net.
I faced many problems that some methods and properties are missing in ZwCAD .net Libraries.
Some of these problems I managed to solve, but the other I need your help.
Here is my experiment:

AutoCAD .net Libraries: AutoCAD (2010, 2011, or 2012) of versions (18.0, 18.1, or 18.2)

ZwCAD .Net Libraries: ZWCAD+ 2014


ZwCAD .Net Libraries may be based on old AutoCAD .Net libraries of versions (17.0, 17.1, or 17.2 years 2007 to 2009).


Table Class:

Autodesk.AutoCAD.DatabaseServices.Table

ZwSoft.ZwCAD.DatabaseServices.Table

Cells Collection

CadTable.Cells(I, J).Value = Value

CadTable.SetTextString(I, J, Value)

Rows Collection

CadTable.Rows.Count

CadTable.NumRows

CadTable.Rows(0).Height = RowH

CadTable.SetRowHeight(0, RowH)

Columns Collection

CadTable.Columns.Count

CadTable.NumColumns

CadTable.Columns(0).Width = ColW

CadTable.SetColumnWidth(0, ColW)

Cell Data Format

CadTable.Cells(I, J).DataFormat = "%lu2%pr2"

??????????????

Cell Range

CellRange.Create(CadTable, TobRow, LeftColumn, BottomRow, RightColumn)

Dim
TableRegion As
TableRegion

TableRegion.FirstRow = TobRow

TableRegion.FirstColumn = LeftColumn

TableRegion.LastRow = BottomRow

TableRegion.LastColumn = RightColumn

CadTable.MergeCells(CellRange.Create(CadTable, TobRow, LeftColumn, BottomRow, RightColumn))

Dim TableRegion As
TableRegion

TableRegion.FirstRow = TobRow

TableRegion.FirstColumn = LeftColumn

TableRegion.LastRow = BottomRow

TableRegion.LastColumn = RightColumn

CadTable.MergeCells(TableRegion)

CellRange.Create(CadTable, 0, 0, RN - 1, CN - 1).TextHeight = TexH

CellRange.Create(CadTable, 0, 0, RN - 1, CN - 1).Alignment = MiddleCenter

CellRange.Create(CadTable, 2, 1, RN - 1, CN - 1).DataFormat = "%lu2%pr2"

CellRange.Create(CadTable, 2, 0, RN - 1, 0).Alignment = MiddleLeft

For I = 0 To RN - 1

For J = 0 To CN - 1


CadTable.SetTextHeight(I, J, TexH)


CadTable.SetAlignment(I, J, MiddleCenter)

If I >= 2 AndAlso J = 0 Then _



CadTable.SetAlignment(I, J, MiddleLeft)

'No property or method to set DataFormat of a set of cells

Next

Next

Rank: 1

AGSAO8682

Newbie

posts: 3

Registered: 2013-12-4

Message 2 of 4

08-12-2013 06:36 . pm | View his/her posts only

BlockReference Class:

ZwCAD .Net Libraries don’t supports dealing with Dynamic Blocks programmatically.

Autodesk.AutoCAD.DatabaseServices.BlockReference

ZwSoft.ZwCAD.DatabaseServices.BlockReference

Dynamic Block Reference Properties

Dim Prop As DynamicBlockReferenceProperty

For Each Prop In MyBlock.DynamicBlockReferencePropertyCollection

Select
Case Prop.PropertyName

Case "Height"


Prop.Value = Height

Case "Mirror"


Prop.Value =
Math.Abs(CType(True, Short))

End Select

Next

Do not support Dynamic Blocks

Line Class:

Autodesk.AutoCAD.DatabaseServices.Line

ZwSoft.ZwCAD.DatabaseServices.Line

Length

MyLength = MyLine.Length

With MyLine


MyLength =
Math.Sqrt((.EndPoint.X - .StartPoint.X) ^ 2 +


(.EndPoint.Y - .StartPoint.Y) ^ 2)

End With

Dimension Class:

Autodesk.AutoCAD.DatabaseServices.DataBase

ZwSoft.ZwCAD.DatabaseServices.DataBase

SetDimstyleData

MyCadDocumentDB.SetDimstyleData(MyDimensionStyleTblRecord)

'To set current dimension variables as the DimStyle variables, otherwise will have a for the new dimension style with old dimension style variables

??????????????

Autodesk.AutoCAD.DatabaseServices.RotatedDimension

ZwSoft.ZwCAD.DatabaseServices.RotatedDimension

Suffix

MyDimension.Suffix =
m2”

??????????????


Autodesk.Windows NameSpace:

In AutoCAD import ‘acWindows.dll
and adWindows.dll” to deal with AutoCAD ribbons and interface, but ZwCAD .Net Libraries don’t support.

Autodesk.Windows

ZwSoft.ZwCAD.Windows

RibbonTab Class

Dim MyTab As RibbonTab

??????????????

ComponentManager Class

Dim ActiveTab As RibbonTab=ComponentManager.Ribbon.ActiveTab

Dim RootsTab As RibbonTab = ComponentManager.Ribbon.FindTab("RSI.RootsTab")

ComponentManager.Ribbon.ActiveTab = MyTab

??????????????

What is the replacements of these dlls ‘acWindows.dll
and adWindows.dll”?

Rank: 1

AGSAO8682

Newbie

posts: 3

Registered: 2013-12-4

Message 3 of 4

09-12-2013 05:16 . pm | View his/her posts only
Post Last Edit by AGSAO8682 at 2013-12-9 18:33

Sorry for being indirect in my questions.
My questions in other word:

1. What is the replacement of files refrences "acWindows.dll & adWindows.dll" to be able to deal with application ribbons and interface?
2. Is ZwCAD+2014 .net able to deal with dynamic blocks?
3. How can I access cad cells, rows, and columns in table class?
4. How to change DataFormats of cells in table class?
5. How to create CellRange inorder to be able to merge them or to change its properties?
6. How can we change the suffix property of Cad dimension?
7. Is "SetDimstyleData"method available in ZwCAD+2014 .net?
8. Where is the "Length" property of cad Line?

Rank: 5Rank: 5

dotsoft

Developers

posts: 14

Registered: 2013-10-30

Message 4 of 4

09-12-2013 11:16 . pm | View his/her posts only
1. I think I read that the ribbon was recently introduced and customization by code is still to come.
2. ZWCAD does a good job of displaying dynamic blocks including user actions, but the .NET functionality has not been implemented yet.
3. The tables API varies with versions, even across the WellKnownCAD product alone. We support three CAD engines across many versions and our tables section is *full* of conditional compilation statements. With the exception of item 4 I think we were able to do everything.
4. This is still missing from ZWCAD.
8. We never noticed this as we create polyline objects instead. Until the property is implemented you have a workaround.

In summary there are several things missing but consider the massive amount that is 'not missing'. We ported our entire collection in roughly 20 man-hours and while there is a handful of stubs the vast majority is working.

Most importantly make them aware of what you find and I expect they will address it as soon as they can.
See also