Problems with CADImporterDll

Discuss and ask questions about CAD DLL (CAD Image DLL, CAD Importer DLL).

Moderators: SDS, support, admin

Post Reply
fconfort
Posts: 9
Joined: 03 Dec 2006, 17:44

Problems with CADImporterDll

Post by fconfort » 30 Apr 2007, 22:10

Sergy,
I have waited for the new release of CADImporterDLL as you had suggested.

It seems none of the reported problems were addressed.

I have been busy learning VB.net 2005 and have not followed up.

I have managed to convert my code to VB.net 2005 working with CADImporterDLL. The code is much more structured in that unions are supported and CopyMemory calls can be avoided with no noticeable performance penalties. However, CADImporterDLL still exhibits the same problems reported previously.

All problems have been investigated in ArcAsCurves mode.

1)Ellipse Major Axis Vector is not reported properly when vector is in Quadrant 2 or 4. The y component of the major axis vector is reported as the negative of the expected value.

2) Ellipse StartAngle and EndAngle are not reported properly

3) AutoCad ANSI38 hatches are not handled reliably by CADImporterDLL

4) Horizontal and Diagonal Stacked Fractions are not handled properly

I was able to cirumvent 2)and 4)

DrawHatch has been modified to circumvent problem 3).
However, it would be useful, if possible, to have CADImporterDLL report the Standard AutoCAD Hatch Name(possibly in EDATA.Text) when sending hatch data.

Problem 1) cannot be circumvented.

Attention to problem 1) is of particular concern.

Regards
Fernando

support
Posts: 3253
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 15 May 2007, 09:31

Dear Fernando,

We will answer you soon.

Sergey.

Please post questions to the forum or write to support@cadsofttools.com

fconfort
Posts: 9
Joined: 03 Dec 2006, 17:44

Post by fconfort » 25 May 2007, 18:27

Sergey,
I porting my code to VB.Net 2005, the following observations where made:
1) In VB6.0 the GDI graphics sub system works with + angles measured in the counter clockwise direction.
2) In VB.Net the "GRAPHICS" sub system works with + angles measured in the clockwise direction.
3) Autocad's + angle direction is determined by system variable ANGDIR (ANGDIR=0 for CounterClockWise, ANGDIR=1 for Clockwise)

In order to properly use angular information and/or arc stop points and arc end points provided by CADImporter.DLL we must have access to AutoCAD's ANGDIR variable setting.

support
Posts: 3253
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 30 May 2007, 19:28

Fernando,

<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">1)Ellipse Major Axis Vector is not reported properly when vector is in Quadrant 2 or 4. The y component of the major axis vector is reported as the negative of the expected value.
2) Ellipse StartAngle and EndAngle are not reported properly<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
After calling CADProhibitCurvesAsPoly with second parameter nCheckNumber = 0, ellipses and elliptic arcs, which can't be drawn correctly by Win API means, are returned like the following data (VB syntax):

EData.Tag - CAD_ELLIPSE

The following parameters are absolutely equal to AutoCAD:

EData.Point1 - Center point
EData.Point2 - Major axis vector
EData.Point3 - Start
EData.Point4 - End
EData.Var1(24) - Radius ratio

The following parameters are not equal to AutoCAD. CADImporter.DLL returns <b>parameter</b>:

EData.Var1(8) - Start param
EData.Var1(16) - End param

The following equation reflects dependence of an angle A on parameter P:

Code: Select all

tg P = (tg A) / ratio
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">3) AutoCad ANSI38 hatches are not handled reliably by CADImporterDLL

4) Horizontal and Diagonal Stacked Fractions are not handled properly<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Bothe problems are under control. We will inform you when they will be solved.


Please post questions to the forum or write to support@cadsofttools.com

fconfort
Posts: 9
Joined: 03 Dec 2006, 17:44

Post by fconfort » 31 May 2007, 23:47

Sergey,

I will send a copy of your latest VB demo for CADImporterDLL with modifications to handle ellipse in ArcAsCurves Mode.

I will include an AutoCAD test file with 4 elliptical arches, one in each of the 4 quadrants. Each arch will have a unique color associating it with each of the 4 quandrants.

The modified DrawArc routine includes the following code segment.

'****************************************************************
'CADImporterDLL does not pass proper MajorAxisVector(data.point2)
'when MajorAxisVector is in Q2 or Q4
Select Case Data.Color
Case vbBlue 'MajorAxisVector is in Q1
'CADImporterDLL sends proper value of (MajorAxisVector).x
Case vbCyan 'MajorAxisVector is in Q2
'CADImporterDLL sends wrong value of (MajorAxisVector).x
'To correct this problem, uncomment the next line of code
'Data.Point2.x = -Data.Point2.x
Case vbRed 'MajorAxisVector is in Q3
'CADImporterDLL sends proper value of (MajorAxisVector).x
Case vbMagenta 'MajorAxisVector is in Q4
'CADImporterDLL sends wrong value of (MajorAxisVector).x
'To correct this problem, uncomment the next line of code
'Data.Point2.x = -Data.Point2.x
End Select
'********************************************************************
When you load the test file you will see only 2 arches.
This is because the Cyan arch overlays the Red arch
and the Magenta arch overlays the Blue arch.

Follow the instructions in the code segment above to reveal
all arches as they appear in the AutoCAD test file.

Again, there is no way of circumventing this problem.
Attention to this problem is of particular concern.

Regards
Fernando

support
Posts: 3253
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 04 Jun 2007, 10:49

Fernando,

Ellipses in the Quadrant 2 and Quadrant 4 have unordinary <b>Extrusion</b> parameter. By default this parameter is (0, 0, 1) for the most entities. Ellipses in the Quadrant 2 and Quadrant 4 have it (0, 0, -1).
It is not a simple task to take into account <b>Extrusion</b>. That is why <b>CADImporter.DLL</b> works through it itself and returns such entities already prepared for drawing.

Is it possible for you to make necessary calculations yourself if having correct major axis point and <b>Extrusion</b> parameter?

Sergey.

Please post questions to the forum or write to support@cadsofttools.com

fconfort
Posts: 9
Joined: 03 Dec 2006, 17:44

Post by fconfort » 04 Jun 2007, 22:07

Sergey,

This "EXTRUSION" property looks like it could actually be a Plane_Normal for the Major_Axis_Plane.

However, if you say that it is (0,0,1) for all Q1,Q3 Ellipses & (0,0,-1) for all Q2,Q4 Ellipses then perhaps it could be passed as the sign of the Ellipse "Ratio" parameter.

If you make this new "EXTRUSION" vector property available on its own, how do you envision passing it?
Will it be sent for Ellipse Data only?
Will trailing Var structure be increased in size?

Regards

Fernando

support
Posts: 3253
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 06 Jun 2007, 18:46

Dear Fernando,

We plan that it will be a member of the CADEXTENDEDDATA structure.

The question is that such task is extending of the current library's abilities. And it requires additional discussion. Please contact us on info@cadsofttools.com on this question with a reference to this topic.

Sergey.

Please post questions to the forum or write to support@cadsofttools.com

Post Reply