Introduction

Navigation: »No topics above this level«

Introduction

 Return to chapter overview

CAD DLL provides an API for displaying and importing AutoCAD® DWG, DXF, Hewlett Packard HPGL/HPGL2, Scalable Vector Graphics (SVG) and Computer Graphics Metafile (CGM) files in your application as well as converting DWG/DXF/HPGL to Windows Bitmap, GIF and JPEG file formats. It also translates Windows metafiles to DXF.

CAD DLL was made on the basis of three previous products: CAD Image DLL, CAD Importer DLL and DXF Exporter DLL.

·The DrawCAD and DrawCADEx functions draw DWG/DXF/HPGL/SVG/CGM to the given rectangle.

·The CADDATA structure is a base for all the CAD entities.

·The CADEnum function is used for sequential access to all CAD file entities in their drawing order, similar to linear Windows Metafile structure. All entity data (coordinates etc.) are converted to real drawing values, according to the entity position in CAD structure (inside block, outside block etc.)

·To translate Windows metafile to DXF you only need to draw image using Windows GDI functions onto Windows Metafile DC and give it to CAD DLL. CAD DLL reads Windows Metafile structure and makes DXF file automatically. For the best translation from applications please make metafile in 00.1 mm mode and use the XP_USE01MM flag.

See Also

What's new | Supported Formats | CAD DLL Versions Comparison | Disclaim and Copyright/Trademark Information | Details

© 2003-2015 CADSoftTools


Supported Formats

Navigation: »No topics above this level«

Supported Formats

 Return to chapter overview
Reading |
AutoCAD™ | DWG all versions (2.5 up to 2016 inclusive) DXF ASCIIВ DXF/BINARYВ all versions
Autodesk Design Web Format | DWF
Hewlett-Packard HPGL | PLT
Portable Document Format | PDF
Scalable Vector Graphics | SVG
Computer Graphics Metafile | CGM
Enhanced Metafiles | EMF
Windows Metafiles | WMF
Raster Formats | BMP / JPG GIF TIFF / PNG
Export to Vector Formats |
AutoCAD ™ | DWG
AutoCAD ™ | DXF
Portable Document Format | PDF
Scalable Vector Graphics | SVG
Computer Graphics Metafile | CGM
Hewlett-Packard HPGL | PLT
Enhanced Metafiles | EMF
Windows Metafiles | WMF
Export to Raster Formats |
Windows Bitmap | BMP
JPEG images | JPG
Compuserve GIF | GIF
Tagged Image File Format TIF images | TIFF
Portable network graphic images | PNG

See Also

Introduction | What's new | CAD DLL Versions Comparison | Disclaim and Copyright/Trademark Information | Details


What's new

Navigation: »No topics above this level«

What's new

 Return to chapter overview

List of improvements and enhancements included into different CAD DLL versions:

November, 2015

CAD DLL 11

·Export to DWG 2004

·Command line added

·New commands added:

oSHXFONTS, SHXDEFAULTPATH, SHXFROMACAD that are used to install SHX fonts settings via the command line;

oGetLastErrorCAD that returns the error code and description;

oGetDrawingMatrix and SetDrawingMatrix that are used to get and set matrix elements.

·Support of Big SHX Fonts (for Asian characters)

·Import and export of the XClipFrame variable into DWG and DXF added

·Export of the SPATIAL_FILTER object added

·Controlled and Preset properties added for the TsgDXFAttdef entity

·API SetXRefCallback function added; it receives the procedure address used to adjust paths to the not found xRefs

·The image fragment obtained from DWG and DXF files while converting to metafile has become more precise

·Multiline text (Mtext) import improved

·Color import in DWF improved

·Checking whether the Ray and XLine entities are included into the box

·Creation of the hyperlink for the Text and Attrib entities

·DWG and DXF import and export improved

·Third-party applications EED of the imported drawing is retained

April, 2015

CAD DLL 10.0.1

·DWG 2000/DXF export via the ExportToCADFile function added

·Export quality improved

·New functions added:

oCADAddXRef

oCADGetEntityHandle

oCADGetInsUnits

oCADGetNumberOfParts

oCADSetMeshQuality

oCADSetNumberOfParts

oGetEntityBox

oGetSupportedExts

oRotToViewCAD

oSetCADLayerColor

See Also

How to switch to CAD DLL from previous DLL versions? | Introduction | Supported Formats | Old Changes | Types | Structures | Functions | Examples

© 2003-2015 CADSoftTools


How to switch to CAD DLL

How to switch to CAD DLL from previous DLL versions

Navigation: What's new >

How to switch to CAD DLL from previous DLL versions

 Return to chapter overview

To switch to CAD DLL please do the following:

1.Delete your old DLL.

2.Add new cad.dll to your project.

Please note: Functions remain the same so you don't need to change them.

See Also

Introduction | What's new | Types | Structures | Functions | Examples


Previous Changes

Navigation: What's new >

Previous Changes

 Return to chapter overview

In this section you can find information on changes in different versions of previous products:

·CAD Image DLL

·CAD Importer DLL

·DXF Exporter DLL

See Also

How to switch to CAD DLL from previous DLL versions? | Introduction | What's new | Types | Structures | Functions | Examples

© 2003-2015 CADSoftTools


Viewer

Navigation: What's new > Previous Changes >

Viewer

 Return to chapter overview

List of improvements and enhancements included into different CAD Image DLL versions:

March, 2013: CAD Image DLL 9.0 | ·Import of AutoCAD® DWG 2013 file format.
September, 2012: CAD Image DLL 8.2 | ·Numerous bugs are fixed.
January, 2012 CAD Image DLL 8.0 | ·Support of Unicode ·64-bit support ·Export to DXF/HPGL/CGM/SVG/SWF/PDF formats ·Display of XRef drawings improved ·Numerous bugs fixed ·New functions added: oSaveCADtoCAD; oSaveCADtoFileWithXMLParams.
March, 2010 CAD Image DLL 7.2 | New functions added: oCADSetSHXOptions oGetNearestEntityWCS
February, 2009 CAD Image DLL 7.0 | ·Import of DWF files ·Import of DXF binary files ·Complex line types ·Image cutting in DWG/DXF files ·Displaying of the MTEXT, LEADER, ACAD_PROXY_ENTITY, SPLINE, LWPOLYLINE entities is improved ·Displaying of the ACAD_TABLE entity for DWG files ·Displaying of DWG, HPGL-2, PCL files is improved ·Older DWG files are supported (down to version "AC1002") ·Raster graphics file formats are supported ·Displaying of the POINT entity in different modes ·Displaying of the extended UNICODE for TTF fonts ·All ANSI-codepages are supported ·Export to DXF three-time faster ·Deep scaling much better ·Bugs fixed: oIncorrect page size of HPGL files oIncorrect reflection of rotated Backward-texts oIncorrect print of the gradient plotting oIncorrect rotation of a raster image in block oIncorrect Xref cyclic reference ·New functions added: oSetCADBorderSize oSetCADBorderType
February, 2007 | ·AutoCAD™ DWG 2007 file format supported ·AutoCAD™ PROXY (including AEC) entities supported ·HPGL/HPGL2 file format - Bezie splines supported ·DXF Loading has been optimized for files with big amount of blocks (layers and styles). In some cases speed is increased up to ten times
September, 2006 | ·New function added: oCADLayoutBox
May, 2006 CAD Image DLL 5.2.5 | ·Viewing of HPGL files became significantly faster. Requirements for memory lowered in 2...10 times ·Support for BigFonts ·SHX support: if the given SHX fonts are not found, the default SHX fonts will be used ·Support for DWG v. 9, 10 and 10 ·Forward references in DWG12 ·Bugs fixed for PolyFace in DWG12 and for gradient filling in HPGL ·Bugs fixed for DWG/DXF, HPGL, SVG and CGM file formats
December, 2005 CAD Image DLL 5.0 | ·Support of Scalable Vector Graphics (SVG) and Computer Graphics Metafile (CGM) formats is added ·Support of layouts for AutoCAD DWG/DXF and pages for HPGL/HPGL2 Hewlett Packard file formats added ·New functions added: oCADLayout oCADLayoutName oCADLayoutsCount oCADLayoutVisible oCreateCADEx oCurrentLayoutCAD oDefaultLayoutIndex oGetCADCoords oGetNearestEntity oSaveCADtoBitmap oSaveCADtoJpeg oSetNullLineWidthCAD oSetProgressProc oSetShowLineWeightCAD oStopLoading ·Function SetRotateCAD in addition returns '2' if current displayed image can’t be rotated (layouts of DWG/DXF)

See Also

Introduction | What's new | How to switch to CAD DLL from previous DLL versions? | Types | Structures | Functions | Examples


Access to Entities

Navigation: What's new > Previous Changes >

Access to Entities

 Return to chapter overview

List of improvements and enhancements included into different CAD Importer DLL versions:

April, 2013

CAD Importer DLL 9.1

·Processing of splitted line types improved

·Bugs fixed

·API changes:

oIsDotted field is added to CADEXTENDEDDATA structure

oDashDots field now contains line type elements for polyline-based entities (POLYLINE, LWPOLYLINE, SPLINE, LEADER, CIRCLE, ARC, ELLIPSE)

March, 2013

CAD Importer DLL 9.0

·Import of AutoCAD® DWG 2013 file format

·Support of following entity types is added:

oTRACE (imported as SOLID)

oOLE2FRAME (imported as IMAGE)

oLEADER (imported as POLYLINE)

October, 2012

CAD Importer DLL 8.2

·Bugs fixed

January, 2012

CAD Importer DLL 8.0

·Support of Unicode

·64-bit support

·Export to DXF/HPGL/CGM/SVG/SWF/PDF formats

·Processing of the TEXT entity improved

·Numerous bugs fixed

·New functions added:

oSaveCADtoFileWithXMLParams

July, 2010

·DWG 2010 supported (inc. AutoCAD 2011)

·Bug fixed

·Internal improvements

·API changes:

oIn CAD_HATCH entity Count value is changed from number of point to number of Boundaries. Data.Count == Hatch.Boundaries.Count

March, 2007

·Double precision applied

·AutoCAD™ DWG 2007 file format supported

·AutoCAD™ PROXY (including AEC) entities supported

·HPGL/HPGL2 file format - Bezier splines supported

·DXF loading is optimized for files with big amount of blocks (layers and styles). In some cases speed is increased up to ten times.

·API changes:

oFunctions' and constants' prefix 'DXF' was replaced by 'CAD'.

oNew types:

- sgFloat

- FPOINT

- FRECT

oDXFDATA structure:

- renamed to CADDATA

- PolyPoints and DashDots fields: type has been changed from LPDXFPOINT to LPFPOINT

- Thickness, Rotation, Radius, StartAngle, EndAngle, Ratio, FHeight, FScale, RWidth, RHeight fields: type has been changed from float to sgFloat

- Point1, Point2, Point3, Point4, Scale fields: type has been changed from DXFPOINT to FPOINT

- new fields added:

int Undefined1

sgFloat Undefined2

sgFloat Undefined3

September, 2006

·API changes:

oUnused field in the DXFDATA structure is replaced by CADExtendedData field.

May, 2006

CAD Importer DLL 5.2.5

·Viewing of HPGL files became significantly faster. Requirements for memory lowered in 2 .. 10 times.

·Support for BigFonts.

·SHX support: if the given SHX fonts are not found, the default SHX fonts will be used.

·Support for DWG versions 9, 10 and 11.

·Forward references in DWG12.

·Bugs fixed for PolyFace in DWG12 and for gradient filling in HPGL.

·Bugs fixed for DWG/DXF, HPGL, SVG and CGM file formats.

March 2006

·API changes:

onEnumAll parameter of the DXFEnum function now has more values:

Before changes: | After changes:
Specifies inclusion of invisible entities: 0 – not include 1 – include | Specifies an entity's enumeration mode (bit-coded): 0 – do not include invisible entities; 1 – include invisible entities; 2 – don’t use “View direction” and “View twist angle” from the current active VPORT. 4 – cut off entities by the rectangular border of the viewports (we recommend to use cutting off by the whole viewport border, see DXF_BEGIN_VIEWPORT)

February 2006

·DXF.dll is renamed to CADImporter.DLL

December, 2005: version 5.0

·Support of layouts for AutoCAD DWG/DXF and pages for HPGL/HPGL2 file formats added

·Support of Scalable Vector Graphics (SVG) file format added

·Support of Computer Graphics Metafile (CGM) file format added

·New functions added:

oDXFLayoutCount

oDXFLayoutCurrent

oDXFLayoutName

See Also

Introduction | What's new | How to switch to CAD DLL from previous DLL versions? | Types | Structures | Functions | Examples


Export to CAD

Navigation: What's new > Previous Changes >

Export to CAD

 Return to chapter overview

List of improvements and enhancements included into different DXF Exporter DLL versions:

December, 2008

DXF Exporter DLL 6

·ExportToDXF function created

See Also

Introduction | What's new | How to switch to CAD DLL from previous DLL versions? | Types | Structures | Functions | Examples


Unicode Support

Navigation: »No topics above this level«

Unicode Support

 Return to chapter overview

CAD DLL uses Unicode standard to encode characters in text strings. So, if you have used a previous version of DLL, you need to make changes in your project (depending on the IDE and language you are using for applications development).

This tutorial shows what you need to do in order to provide the correct interaction between your application and DLL.

Delphi:

You need to use Embarcadero Delphi 2009/2010/XE/XE2/XE3/XE4/XE5/XE6/XE7/XE8/XE10 in order to provide a complete support for the Unicode characters set in Delphi applications. No changes are required in your project.

C#/Visual Basic .NET:

You need to override the default marshaling for string parameters to unmanaged methods using the LPWStr type . The following sample shows how to implement it:

[C#]
public class DLLWin32Import
{
const string CADImage = "CADImage.dll";
const UnmanagedType sgStrType = UnmanagedType.LPWStr;

[DllImport(CADImage)]
public static extern IntPtr CreateCAD(IntPtr hWindow, [MarshalAs(sgStrType)] string lpFileName);
}

[Visual Basic]
Class CADImageLib

Private Const CADImageLibName As String = "CADImage.dll"
Private Const sgStrType As UnmanagedType = UnmanagedType.LPWStr

<DllImport(CADImageLibName, _
SetLastError:=True, _
CharSet:=CharSet.Ansi, ExactSpelling:=True, _
CallingConvention:=CallingConvention.)> _
Public Shared Function CreateCAD(ByVal hWindow As IntPtr, <MarshalAs(sgStrType)> ByVal lpFileName As String) As IntPtr
End Function

End Class

You also need to use the Marshal.PtrToStringUni method in order to get a managed string from an unmanaged Unicode string (for instance, if you get text data from the DXFDATA structure):

[C#]

DXFData EData = new DXFData();

string name = Marshal.PtrToStringUni(EData.Text);

[Visual Basic]

Dim CADData As Data = New Data

Dim str As String = Marshal.PtrToStringUni(CADData.Text)

C++:

You need to declare pointer to the WCHAR type using typedef keyword and then use this pointer type for string parameters that are passed to the DLL functions. The following sample shows how to implement it:

[C++]

typedef WCHAR *PWCHAR

..

typedef HANDLE (WINAPI *CREATECAD)(HWND, PWCHAR);

typedef int (WINAPI *CADSETSHXOPTIONS)(PWCHAR, PWCHAR, PWCHAR, BOOL, BOOL);

Visual Basic:

If you use Visual Basic, please, refer to the DemoVB project. Check the sgStringToVBString and VBStringTosgString functions (Module1.bas) that implement string conversion.

See Also

64-bit support | CAD DLL structures | CAD DLL Functions


64-bit Support

Navigation: »No topics above this level«

64-bit Support

 Return to chapter overview

CAD DLL includes native 64-bit support. If you have decided to develop the 64-bit version of your product using CAD DLL, you need to port your project to a new architecture.

First of all, you need IDE that has support for 64-bit applications development. To build 64-bit applications, Microsoft Visual Studio 2005/2008/2010/2012 or Embarcadero Delphi XE2/XE3 is required.

In Microsoft Visual Studio, you need to configure your application to target 64-bit platform. For more information on 64-bit platform support in Visual Studio please see 64-bit Applications.

To configure a project to target a 64-bit platform implement the following:

1. In the Build menu, click Configuration Manager.

2. In the Active solution platform list, select the x64 platform for the solution to target. If the platform does not exist in the list, select New.

3. In the New Solution Platform dialog box, select the x64 platform for the solution to target.

4. If you want to copy the settings from the current platform configuration, select the platform configuration to copy settings from and click OK.

Properties for all the projects targeting the 64-bit platform are updated, and the next build of the project will be optimized for 64-bit platforms.

Note: If you cannot create the 64-bit configuration of a project in Visual Studio, the problemlies in the absence of the 64-bit compiler. It is most likely that you have not enabled the X64 Compilers and Tools check box during Visual Studio installation. If it is so, launch the installer and install the missing items.

After configuring the project in Visual Studio, you need to update the managed source code to target 64-bit environment. Migrating of your code primarily consists in data structure alignment in order to provide correct transfer of structured information from unmanaged code to the managed one.

In C# and Visual Basic .NET you need to provide exact offsets for each field within the structure to aid in the marshaling of information. The following sample demonstrates setting the field offsets (in bytes) for members of the CADDATA structure:

[C#]

[StructLayout(LayoutKind.Explicit)]

public struct CADData

{

[FieldOffset(0)] public ushort Tag;

[FieldOffset(2)] public ushort Count;

[FieldOffset(4)] public ushort TickCount;

[FieldOffset(6)] public byte Flags;

[FieldOffset(7)] public byte Style;

[FieldOffset(8)] public int Dimension;

[FieldOffset(12)] public IntPtr DashDots;

[FieldOffset(20)] public int DashDotsCount;

[FieldOffset(24)] public int Color;

[FieldOffset(28)] public IntPtr Ticks;

[FieldOffset(36)] public double Thickness;

[FieldOffset(44)] public double Rotation;

[FieldOffset(52)] public IntPtr Layer;

[FieldOffset(60)] public IntPtr Text;

[FieldOffset(68)] public IntPtr FontName;

[FieldOffset(76)] public IntPtr Handle;

[FieldOffset(84)] public int Undefined1;

[FieldOffset(88)] public double Undefined2;

[FieldOffset(96)] public double Undefined3;

[FieldOffset(104)] public IntPtr CADExtendedData;

[FieldOffset(112)] public CADPoint Point;

[FieldOffset(136)] public CADPoint Point1;

[FieldOffset(160)] public CADPoint Point2;

[FieldOffset(184)] public CADPoint Point3;

[FieldOffset(208)] public double Radius, StartAngle, EndAngle;

[FieldOffset(232)] public byte Ratio, EntityType;

[FieldOffset(208)] public int Block;

[FieldOffset(212)] public CADPoint Scale;

[FieldOffset(208)] public double FHeight, FScale, RWidth, RHeight;

[FieldOffset(240)] public byte HAlign, VAlign;

[FieldOffset(208)] public IntPtr Points;

}

If you use Visual C++, you need to define the compiler’s alignment (or "packing") of structure members. The following sample demonstrates setting alignment for the CADDATA structure to 1 byte boundary:

[C++]

#pragma pack(push,1)

typedef struct _CADDATA

{

WORD Tag;

WORD Count;

WORD TickCount;

BYTE Flags;

BYTE Style;

int Dimension;

LPFPOINT DashDots;

int DashDotsCount;

int Color;

LPVOID Ticks;

sgFloat Thickness;

sgFloat Rotation;

PsgChar Layer;

PsgChar Text;

PsgChar FontName;

HANDLE Handle;

int Undefined1;

sgFloat Undefined2;

sgFloat Undefined3;

LPCADEXTENDEDDATA CADExtendedData;

FPOINT Point1;

FPOINT Point2;

FPOINT Point3;

FPOINT Point4;

union

{

struct

{

sgFloat Radius;

sgFloat StartAngle;

sgFloat EndAngle;

sgFloat Ratio;

BYTE EntityType;

} Arc;

struct

{

HANDLE Block;

FPOINT Scale;

} Blocks;

struct

{

sgFloat FHeight;

sgFloat FScale;

sgFloat RWidth;

sgFloat RHeight;

BYTE HAlign;

BYTE VAlign;

} Text;

LPFPOINT PolyPoints;

} DATA;

} CADDATA, *LPCADDATA;

#pragma pack(pop)

In Embarcadero Delphi XE2/XE3 you need to configure your application for the 64-bit Windows target.

To create an application that targets the 64-bit platform, add the corresponding target platform in the following way:

1. Right-click the Target Platforms node in the Project Manager.

2. Click Add Target in the context menu.

3. Select 64-bit Windows in the Select Platform selection box, enable the Make the selected platform active checkbox to automatically activate the platform as it is added to your project. The name of the platform appears in boldface in the Target Platforms node of the Project Manager.

4. Click OK.

See Also

Unicode support | CAD DLL structures


Types

CAD DLL Types

Navigation: »No topics above this level«

CAD DLL Types

 Return to chapter overview

CAD DLL has the following types:

·CADPROC

·PROGRESSPROC

·sgFloat

See Also

CAD DLL structures | CAD DLL functions


CADPROC

Navigation: Types >

CADPROC

 Return to chapter overview

The CADPROC type is a procedural type that allows the user to treat the callback function as a value that can be passed to the CADEnum function.

Syntax

Delphi:

procedure MyMethod(

 Data: PcadData;

 var Param

); stdcall;

Visual C++:

void CALLBACK MyMethod(

  LPCADDATA Data,

  LPARAM Param

)

Parameters

Data | Structure with the entity data.
Param | Points to the optional callback-function data.

See Also

PROGRESSPROC | sgFloat


PROGRESSPROC

Navigation: Types >

PROGRESSPROC

 Return to chapter overview

The PROGRESSPROC type defines the callback function.

Syntax:

typedef int (WINAPI *PROGRESSPROC) (BYTE);

See Also

CADPROC | sgFloat


sgFloat

Navigation: Types >

sgFloat

 Return to chapter overview

The sgFloat type defines internal floating type.

Syntax:

typedef double sgFloat;

Note:

We recommend to use the sgFloat type instead of using Double directly as it can become Extended in the future.

See Also

CADPROC | PROGRESSPROC


Structures of CAD Image

CAD DLL Structures

Navigation: »No topics above this level«

CAD DLL Structures

 Return to chapter overview

CAD DLL has the following structures:

·CADDATA

·CADDRAW

·CADEXPORTPARAMS

·CADEXTENDEDDATA

·DXFDATA

·DXFPOINT

·FPOINT

·FRECT

See Also

CAD DLL types | CAD DLL functions


CADdata_2

CADDATA

Navigation: Structures >

CADDATA

 Return to chapter overview

The CADDATA structure contains information on all CAD entity properties.

Syntax

typedef struct _CADDATA

{

        WORD Tag;

        WORD Count;

        WORD TickCount;

        BYTE Flags;

        BYTE Style;

        int Dimension;

        LPFPOINT DashDots;

        int DashDotsCount;

        int Color;

        LPVOID Ticks;

        sgFloat Thickness;

        sgFloat Rotation;

        char *Layer;

        char *Text;

        char *FontName;

        HANDLE Handle;

        int Undefined1;

        sgFloat Undefined2;

        sgFloat Undefined3;

        LPCADEXTENDEDDATA CADExtendedData;

        FPOINT Point;

        FPOINT Point1;

        FPOINT Point2;

        FPOINT Point3;

        union {

                struct {

                        sgFloat Radius;

                        sgFloat StartAngle;

                        sgFloat EndAngle;

                        sgFloat Ratio;

                        BYTE EntityType;

                } Arc;

                struct {

                        HANDLE Block;

                        FPOINT Scale;

                } Blocks;

                struct {

                        sgFloat FHeight;

                        sgFloat FScale;

                        sgFloat RWidth;

                        sgFloat RHeight;

                        BYTE HAlign;

                        BYTE VAlign;

                } Text;

                LPFPOINT Points;

        } DATA;

} CADDATA, *LPCADDATA;

Fields

Tag

Specifies type of the CAD entity:

CAD_UNKNOWN

CAD_TABLE

CAD_BLOCK

CAD_LTYPE

CAD_LAYER

CAD_VERTEX

CAD_LINE

CAD_SOLID

CAD_CIRCLE

CAD_ARC

CAD_POLYLINE

CAD_LWPOLYLINE

CAD_SPLINE

CAD_INSERT

CAD_DIMENSION

CAD_TEXT

CAD_MTEXT

CAD_ATTDEF

CAD_ELLIPSE

CAD_POINT

CAD_3DFACE

CAD_HATCH

CAD_IMAGE_ENT

CAD_ATTRIB

CAD_FLAT_POLY

CAD_BEGIN_POLYLINE

CAD_END_POLYLINE

CAD_BEGIN_INSERT

CAD_END_INSERT

CAD_BEGIN_VIEWPORT

CAD_END_VIEWPORT

CAD_ACIS_BEGIN

CAD_ACIS

CAD_ACIS_END

= 0;

= 1;

= 2;

= 3;

= 4;

= 5;

= 6;

= 7; (SOLID or TRACE entity)

= 8;

= 9;

= 10; (POLYLINE or LEADER entity)

= 11;

= 12;

= 13;

= 14;

= 15;

= 16;

= 17;

= 18;

= 19;

= 20;

= 21;

= 22; (IMAGE or OLE2FRAME entity)

= 23;

= 99;

= 100;

= 101;

= 102;

= 103;

= 104;

= 105;

= 106;

= 107;

= 108;

Count

Specifies the number of child entities (for BLOCK, POLYLINE etc).

·For simple entities such as LINE it is always 0.

·For the POLYLINE entity Count specifies the number of points.

·For the HATCH entity Count is the number of boundaries.

TickCount

Specifies the number of line type elements for this entity (dash, dot and spaces). If the entity is drawn by solid lines, this member is 0.

Flags

Specifies the flags byte for different entities, such as LAYER, BLOCK, POLYLINE etc. It has an individual meaning for each entity type.

Style

Specifies the pen style for drawing the entity:

Value | Meaning
PS_SOLID | Pen is solid.
PS_DASH | Pen is dashed.
PS_DOT | Pen is dotted.
PS_DASHDOT | Pen has alternating dashes and dots.
PS_DASHDOTDOT | Pen has dashes and double dots.

It is an approximation of the entity line type. You can get more accurate information using TickCount and Ticks.

Dimension

Index of the dimension group this entity belongs to.

If Dimension is 0, the entity is not in the dimension group.

DashDots

Points to the array of the FPOINT structures that contains line type elements of the entity (for the entities that are based on polyline(s)).

DashDotsCount

Specifies size of the DashDots array.

Color

Specifies the color value for the entity.

Ticks

Points to the array of floating-point values, one value for each line type element (dash, dot or space). For solid lines, TickCount is 0 and Ticks has no value.

In case of CAD_IMAGE_ENT, Ticks specifies a pointer to the BMP picture data. Handle specifies an integer value of the BMP picture data size.

Thickness

Specifies the line width for the entity.

Rotation

Specifies the rotation angle in degrees for TEXT or INSERT.

Layer

Points to the null-terminated string specifying layer name for the entity.

Text

Points to the null-terminated string specifying text value for text entities (TEXT, MTEXT or ATTDEF).

FontName

Points to the null-terminated string specifying font name for text entities (TEXT, MTEXT or ATTDEF).

Handle

In case of CAD_IMAGE_ENT, Handle specifies Integer value of the BMP picture data size.

Ticks specifies a pointer to the BMP picture data.

Undefined1

Reserved for future versions.

Undefined2

Reserved for future versions.

Undefined3

Reserved for future versions.

CADExtendedData

An extended structure that contains additional information on the entity (get more info).

Point

Specifies the reference point for the entity.

·In case of calling the CADProhibitCurvesAsPoly function with nCheckNumber = 0, Point specifies the center point.

Point1

Specifies the second reference point for such entities as LINE, TEXT or ELLIPSE.

·In case of calling the CADProhibitCurvesAsPoly function with nCheckNumber = 0, Point1 specifies endpoint of the major axis, relative to the center.

Point2

Specifies the third point for SOLID, TRACE and 3DFACE.

·In case of calling the CADProhibitCurvesAsPoly function with nCheckNumber = 0, Point2 specifies the start parameter.

Point3

Specifies the fourth point for SOLID, TRACE and 3DFACE.

·In case of calling the CADProhibitCurvesAsPoly function with nCheckNumber = 0, Point3 specifies end parameter.

Radius

Specifies the radius value for CIRCLE and ARC or ratio of a minor axis to the major axis for ELLIPSE.

StartAngle, EndAngle

Specify the angle values in degrees for ARC and ELLIPSE.

Ratio

Specifies ratio of a minor axis to the major axis.

EntityType

Specifies type of the CAD_ELLIPSE data.

·If EntityType is equal to 0, then the CAD_ELLIPSE entity is defined by Point, Point1 (TopLeft, BottomRight), Point2 and Point3 (startpoint and endpoint of polyline).

·If EntityType is equal to 1, then CAD_ELLIPSE entity is defined by Ratio (specifies a ratio of minor axis to the major axis), Point (specifies the center point), Point1 (specifies the endpoint of the major axis, relative to the center), Point2 and Point3 (startpoint and endpoint of polyline).

Block

Specifies the block handle for INSERT.

Scale

Specifies X-, Y- and Z-scale values for INSERT.

FHeight

Specifies the character height for text entities (TEXT, MTEXT or ATTDEF).

FScale

Specifies the relative X scale factor (ratio of the character width to the character height) for text entities.

RWidth

Specifies the reference rectangle width for MTEXT.

RHeight

Specifies the reference rectangle height for MTEXT.

HAlign

Specifies the horizontal alignment for text entities:

0 = Left;

1= Center;

2 = Right

VAlign

Specifies the vertical alignment for text entities:

0 = Baseline;

1 = Bottom;

2 = Middle;

3 = Top

Points

Points to the array of the FPOINT structures which contains points for POLYLINE, LWPOLYLINE and SPLINE. The number of points is specified by Count.

Fields required to draw particular entities:

Entity | Field
Line | Point, the starting point. Point1, the end point.
3DFace | Point, the first point of the 3DFace boundary. Point1, the second point of the 3DFace boundary. Point2, the third point of the 3DFace boundary, Point3, the fourth point of the 3DFace boundary.
Arc | Point, Point1, a bounding rectangle. Point2, the starting point. Point3, the end point. Point2 is Point3 for a full ellipse.
Hatch | Count, the number of boundaries. Points, a pointer to a point array of the boundary. Color, the hatch color. DashDots, the pointer to a point array of hatch pattern lines. DashDotsCount, the number of vertices of the array of hatch pattern lines.
Image Entity | Point1, the upper-left corner. Point2, the bottom right corner. Handle, a pointer to the TPicture object in memory. Ticks^, the size of the TPicture object.
Point | Point, the point position. Point1, duplicates Point.
Polyline | Count, the number of polyline vertices. Points, the pointer to a point array.
Solid | Point, the first point of the solid boundary. Point1, the second point of the solid boundary. Point2, the third point of the solid boundary. Point3, the fourth point of the solid boundary.
Spline | Count, the number of control points. Points, the pointer to point the array with control points.
Text | Point or Point1, the location (starting point) for text output. HAlign, text horizontal alignment. FHeight, the text height. Rotation, text rotation. Text, a text string.

See Also

CADEXTENDEDDATA | FPOINT | FRECT | sgFloat


CADDRAW

Navigation: Structures >

CADDRAW

 Return to chapter overview

The CADDRAW structure contains information on the drawing parameters.

Syntax:

typedef struct _CADDRAW

{

    DWORD Size;

    HDC DC;

    RECT R;

    BYTE DrawMode;

} CADDRAW, *LPCADDRAW;

Fields:

Size

Specifies the size of the data structure in bytes. Set this member to sizeof(CADDRAW) before using this structure.

DC

Identifies the device context.

R

Specifies the RECT structure that contains the logical coordinates of the drawing rectangle.

DrawMode

Specifies color mode for drawing CAD image. This parameter can have one of the following values:

Value | Meaning
0 | normal color mode
1 | black and white mode
2 | grayscale color mode

See Also

CADEXPORTPARAMS | DXFDATA | DXFPOINT | FPOINT | FRECT


CADEXPORTPARAMS

Navigation: Structures >

CADEXPORTPARAMS

 Return to chapter overview

The CADEXPORTPARAMS structure defines export parameters.

Syntax:

typedef struct _CADEXPORTPARAMS

{

 float XScale;

 Byte Units;

 PROGRESSPROC Proc;

} CADEXPORTPARAMS, *LPCADEXPORTPARAMS;

Fields:

XScale | Specifies the scale factor along the X axis.
Proc | Specifies the pointer to the progress procedure (represents progress of the export operation).

See Also

CADDRAW | DXFDATA | DXFPOINT | FPOINT | FRECT


CADEXTENDEDDATA

Navigation: Structures >

CADEXTENDEDDATA

 Return to chapter overview

The CADEXTENDEDDATA structure is an extended structure that contains additional information about the entity.

Syntax

typedef struct _CADEXTENDEDDATA

{

        LPVOID        Param1;

   bool        IsDotted;

        // ... fields below may be added in future versions;

}  CADEXTENDEDDATA, *LPCADEXTENDEDDATA;

Fields:

Param1 | Defines the field's type of and its purpose according to the documentation for every single entity. Please see respective documentation. For instance: CAD_LINE, CAD_POLYLINE, CAD_ELLIPSE, CAD_ARC, CAD_CIRCLE - Param1 type is float and means Thickness (in AutoCAD terms); CAD_ATTRIB - Param1 type is LPCSTR and means Tag.
IsDotted | Defines a value indicating whether a line type of this entity is dotted.

See Also

CADDATA | FPOINT | FRECT | sgFloat


DXFDATA

Navigation: Structures >

DXFDATA

 Return to chapter overview

The DXFDATA structure is used by CAD entity properties. CAD DLL uses DXFData for access to layers.

Syntax:

typedef struct _DXFDATA {

 WORD Tag;

 WORD Count;

 WORD TickCount;

 BYTE Flags;

 BYTE Style;

 int Dimension;

 LPDXFPOINT DashDots;

 int DashDotsCount;

 int Color;

 LPVOID *Ticks;

 float Thickness;

 float Rotation;

 char* Layer;

 char* Text;

 char* FontName;

 HANDLE Handle;

 LPVOID *Unused;

 DXFPOINT Point1;

 DXFPOINT Point2;

 DXFPOINT Point3;

 DXFPOINT Point4;

 union {

  struct {

   float Radius;

   float StartAngle;

   float EndAngle;

  } Arc;

  struct {

   HANDLE Block;

   DXFPOINT Scale;

  } Blocks;

  struct {

   float FHeight;

   float FScale;

   float RWidth;

   float RHeight;

   BYTE HAlign;

   BYTE VAlign;

  } Text;

  LPDXFPOINT *PolyPoints;

 } DATA;

} DXFDATA, *LPDXFDATA;

Fields:

Layer points to the null-terminated string specifying the layer name for the entity.

The DXFDATA structure is identical to the CADDATA structure.

See Also

CADDRAW | CADEXPORTPARAMS | DXFPOINT | FPOINT | FRECT


DXFPOINT

Navigation: Structures >

DXFPOINT

 Return to chapter overview

The DXFPOINT structure defines the x-, y- and z- coordinates of a 3D point in CAD drawing units.

Syntax:

typedef struct _DXFPOINT

{

 sgFloat x;

 sgFloat y;

 sgFloat z;

} DXFPOINT , *LPDXFPOINT

Fields:

X | Specifies the x-coordinate of the point.
Y | Specifies the y-coordinate of the point.
Z | Specifies the z-coordinate of the point.

See Also

CADDRAW | CADEXPORTPARAMS | DXFDATA | FPOINT | FRECT


FPOINT

Navigation: Structures >

FPOINT

 Return to chapter overview

The FPOINT type defines the point location in the 3D coordinate system with the origin in the drawing coordinate system.

Syntax:

typedef struct _FPOINT

{

 sgFloat x;

 sgFloat y;

 sgFloat z;

} FPOINT, *LPFPOINT

Fields:

X | Specifies the x-coordinate of the point.
Y | Specifies the y-coordinate of the point.
Z | Specifies the z-coordinate of the point.

See Also

CADDRAW | CADEXPORTPARAMS | DXFDATA | DXFPOINT | FRECT


FRECT

Navigation: Structures >

FRECT

 Return to chapter overview

The FRECT union represents the 3D box defined by x-, y- and z- coordinates of its two opposite corners represented in CAD drawing units.

Syntax:

typedef union _FRECT

{

 struct

 {

  float Left;

  float Top;

  float Z1;

  float Right;

  float Bottom;

  float Z2;

 } Points;

 struct

 {

  FPOINT TopLeft;

  FPOINT BottomRight;

 } Corners;

} FRECT, *LPFRECT;

Fields:

Left | Specifies the x-coordinate of the upper-left corner of the rectangle.
Top | Specifies the y-coordinate of the upper-left corner of the rectangle.
Z1 | Specifies the z-coordinate of the upper-left corner of the rectangle.
Bottom | Specifies the x-coordinate of the lower-right corner of the rectangle.
Right | Specifies the y-coordinate of the lower-right corner of the rectangle.
Z2 | Specifies the z-coordinate of the lower-right corner of the rectangle.
TopLeft | Specifies the y-coordinate of the upper-left corner of the rectangle.
BottomRight | Specifies the lower-right corner of the rectangle.

See Also

CADDRAW | CADEXPORTPARAMS | DXFDATA | DXFPOINT | FPOINT


Functions of CADImage

CAD DLL Functions

Navigation: »No topics above this level«

CAD DLL Functions

 Return to chapter overview

CAD DLL includes the following functions:

·CADAddXRef

·CADConvert

·CADClose

·CADCreate

·CADDraw

·CADEnum

·CADGetBox

·CADGetChild

·CADGetData

·CADGetEntityHandle

·CADGetInsUnits

·CADGetLastError

·CADGetNumberOfParts

·CADGetSection

·CADGetSingleFromBytes

·CADGetSplineParams

·CADGetSplinePointsCount

·CADGetStructAsString

·CADGetViewPortParams

·CADGetViewPortPointsCount

·CADIs3D

·CADLayer

·CADLayerCount

·CADLayerVisible

·CADLayout

·CADLayoutBox

·CADLayoutCount

·CADLayoutCurrent

·CADLayoutName

·CADLayoutsCount

·CADLayoutVisible

·CADLTScale

·CADProhibitCurvesAsPoly

·CADSetMeshQuality

·CADSetNumberOfParts

·CADSetProcessMessages

·CADSetSHXOptions

·CADtoDXFExport

·CADUnits

·CADVisible

·CloseCAD

·CreateCAD

·CreateCADEx

·CurrentLayoutCAD

·DefaultLayoutIndex

·DrawCAD

·DrawCADEx

·DrawCADtoBitmap

·DrawCADtoDIB

·DrawCADtoGif

·DrawCADtoJpeg

·DrawCADWithParams

·ExportToCADFile

·ExportToDXF

·GetBoxCAD

·GetCADBorderSize

·GetCADBorderType

·GetCADCoords

·GetDrawingMatrix

·GetEntityBox

·GetExtentsCAD

·GetIs3DCAD

·GetLastErrorCAD

·GetMetafileOffsetPoint

·GetMetafileScale

·GetNearestEntity

·GetNearestEntityWCS

·GetPlugInInfo

·GetPointCAD

·GetSupportedExts

·ProcessXML

·ReadCAD

·ReadCADW

·ReadCADInBMP

·ResetDrawingBoxCAD

·RotToViewCAD

·SaveCADtoBitmap

·SaveCADtoCAD

·SaveCADtoFileWithXMLParams

·SaveCADtoEMF

·SaveCADtoGif

·SaveCADtoJpeg

·SaveCADtoPNG

·SaveCADWithXMLParametrs

·SetBlackWhite

·SetBMSize

·SetBMSize_stdcall

·SetCADBorderSize

·SetCADBorderType

·SetCADLayerColor

·SetClippingRectCAD

·SetDefaultColor

·SetDrawingBoxCAD

·SetDrawingMatrix

·SetMetafileOffsetPoint

·SetMetafileScale

·SetNullLineWidthCAD

·SetProcessMessagesCAD

·SetProgressProc

·SetRotateCAD

·SetShowLineWeightCAD

·StopLoading

·StRg

·StRgA

·StRgW

See Also

CAD DLL types | CAD DLL structures


CADAddXRef

Navigation: Functions >

CADAddXRef

The CADAddXRef function adds Xref in CADImage to another CADImage.

Syntax

int CADAddXRef(

  HANDLE AImage,

  HANDLE AXrefImage,

  LPCSTR AName,

  LPDXFPOINT Position,

  LPDXFPOINT Scale, float Rotation,

  HANDLE* ResultInsert

);

Parameters

AImage | Source CADImage.
AXrefImage | Added CADImage.
AName | Full path to the added CADImage.
Position | CADImage insertion position.
Scale | Scale in which the added CADImage will be displayed.
Rotation | Rotation of the added CADImage.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate


CADConvert

CADConvert

The CADConvert function fills array of the variant type variables and obtains point coordinates from instance of the CADData type.

Syntax

Declare         Function CADConvert Lib "CADImporter.dll" (

Massiv As Variant,

ByRef EData As CADData) As Long

Parameters

Massiv

Specifies the array of point coordinates of an entity. Array has the following structure:
Massiv(1, 0) – the X coordinate of first point;
Massiv(1, 1) – the Y coordinate of first point;
Massiv(1, 2) – the Z coordinate of first point;
Massiv(2, 0) – the X coordinate of second point;
etc.

EData

Entity data.

Return Value

If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADEnum


CADClose

CADClose

The CADClose function closes the opened CAD drawing.

Syntax

int CADClose(

   HANDLE hObject  // handle to object to close

);

Parameters

hObject

Identifies a handle to the CAD drawing.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate


CADCreate

CADCreate

The CADCreate function creates a new CAD drawing object and loads it from the specified file.

Syntax

HANDLE CADCreate(

  HWND hWindow,

  LPCSTR lpFileName

);

Parameters

hWindow

Identifies the window that will get system messages during the file loading. Usually it is the main window of client application. If no

file is specified, hWindow can be NULL.

lpFileName

Points to a null-terminated string that specifies the DXF (*.dxf), DWG (*.dwg), HPGL (*.hgl; *.plt; *.hg; *.hpg; *.plo), SVG (*.svg)

or CGM (*.cgm) file name to be loaded. If this parameter is NULL, no file is loaded and the empty CAD drawing object is created.

Return Value

If the function succeeds, the return value is a handle of new CAD drawing object.

If the function fails, the return value is NULL. To get extended error information, call CADGetLastError.

See Also

CADClose


CADDraw

CADDraw

The CADDraw function draws CAD file on the specified device context.

Syntax

int CADDraw(

  HANDLE hObject,

  HDC hDC,

  LPRECT lprc

);

Parameters

hObject | Identifies a handle to the CAD drawing.
hDC | Identifies the device context.
lprc | Points to the RECT structure that contains logical coordinates of the drawing rectangle.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate | DrawCADEx


CADEnum

CADEnum

The CADEnum function calls the specified callback function for each entity in the CAD file. All data values for entities in blocks are converted to real values.

Syntax

int CADEnum(

  HANDLE hObject,

  int nEnumAll,

  CADPROC lpDXFProc,

  LPARAM lParam

);

Parameters

hObject | Identifies a handle to the CAD drawing.
nEnumAll | Specifies an entity's enumeration mode (bit-coded): 0 – does not include invisible entities; 1 – includes invisible entities; 2 – does not use View direction and View twist angle from the current active VPORT. 4 – cuts off entities by the rectangular border of the viewports (we recommend to use cutting off by the whole viewport border, see DXF_BEGIN_VIEWPORT)
lpCADProc | Points to an application-supplied callback function.
lParam | Points to optional callback-function data.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate | CADDraw | CADLayer


CADGetBox

CADGetBox

The CADGetBox function gets left, top, right, and bottom coordinates of the rectangle that contains CAD drawing object.

Syntax

int CADGetBox (

  HANDLE hObject,

  float *Left,

  float *Right,

  float *Top,

  float *Bottom

);

Parameters

hObject | Identifies a handle to the CAD drawing.
Left | Specifies the left coordinate.
Right | Specifies the right coordinate.
Top | Specifies the top coordinate.
Bottom | Specifies the bottom coordinate.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate | GetEntityBox


CADGetChild

CADGetChild

Note: this function is left for compatibility with previous versions of CAD Importer DLL. It is not recommended for usage.

The CADGetChild function returns a child object of the specified object (section, block, table, polyline etc.) and fills the DXFDATA structure with its properties.

Syntax

HANDLE CADGetChild(

  HANDLE hObject,

  int nIndex,

  LPCADDATA lpData

);

Parameters

hObject | Identifies a complex object handle.
nIndex | Specifies the index in the list of the hObject child objects. It should be in the range from 0 to child objects count of hObject minus 1.
lpData | Points to the CADDATA structure to get properties of the child object. If this parameter is NULL, no properties are retrieved.

Return Value

If the function succeeds, the return value is a handle of the child object specified by nIndex, and the structure pointed by lpData is filled by its properties.

If the function fails, the return value is NULL. To get extended error information, call CADGetLastError.

See Also

CADGetData | CADGetSection


CADGetData

CADGetData

Note: this function is left for compatibility with previous versions of CAD Importer DLL. It is not recommended for usage.

The CADGetData function fills the CADDATA structure with properties of any specified CAD object.

Syntax

int CADGetData(

  HANDLE hObject,

  LPCADDATA lpData

);

Parameters

hObject | Identifies a handle to the CAD object.
lpData | Points to the CADDATA structure to get properties of the object.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADGetChild | CADGetSection


CADGetEntityHandle

CADGetEntityHandle

The CADGetEntityHandle function returns the 64-bit Handle for the specified entity.

Syntax

int CADGetEntityHandle(

   HANDLE handle,

   UNIT 64 EntityHandle

);

Parameters

Handle | Identifies the CADImage object handle.
EntityHandle | A 64-bit Handle entity.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate


CADGetInsUnits

CADGetInsUnits

The CADGetInsUnits returns drawing units for CADImage according to its Handle.

Syntax

int CADGetInsUnits(

 HANDLE Handle,

DWORD* AInsUnits

);

Parameters

Handle

Identifies the CADImage object handle.

AInsUnits

Unit values:

Value | Meaning
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Unitless Inches Feet Miles Millimeters Centimeters Meters Kilometers Microinches Mils Yards Angstroms Nanometers Microns Decimeters Decameters Hectometers Gigameters Astronomical units Light years Parsecs

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate | CADUnits


CADGetLastError

CADGetLastError

The CADGetLastError function returns the last error code and error message.

Syntax

int CADGetLastError(

  LPCSTR lpBuf

);

Parameters

lpBuf

Points to the buffer for error message. If this parameter is NULL, no error message is retrieved

Return Value

The return value is one of following error-codes:

CADERR_GENERAL

CADERR_INVALID_HANDLE

CADERR_INVALID_INDEX

CADERR_FILE_NOT_FOUND

CADERR_FILE_READ

If lpBuf is not NULL, the specified buffer contains responding error message as null-terminated string.

See Also

CADCreate


CADGetNumberOfParts

CADGetNumberOfParts

The CADGetNumberOfParts function returns the number of splittings used to create an ellipse or a circle. If the Handle value is NULL, global settings are returned.

Syntax

int CADGetNumberOfParts(

 HANDLE Handle,

int* ASpline,

int* ACircle

);

Parameters

Handle | Identifies the CADImage object handle.
ASpline | Number of splitting for an ellipse.
ACircle | Number of splitting for a circle.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate | CADSetNumberOfParts


CADGetSection

CADGetSection

Note: this function is left for compatibility with previous versions of CAD Importer DLL. It is not recommended for usage.

The CADGetSection function retrieves specified section or table from the CAD drawing object and fills DXFDATA structure with its properties.

Syntax

HANDLE CADGetSection(

  HANDLE hObject,

  int dwIndex,

  LPCADDATA lpData

);

Parameters

hObject

Identifies a handle to the CAD drawing.

dwIndex

Specifies the object to retrieve. This parameter can be one of following values:

Value | Meaning
0 (CS_TABLES) | TABLES section
1 (CS_BLOCKS) | BLOCKS section
2 (CS_ENTITIES) | ENTITIES section
3 (CS_LTYPES) | LTYPE table
4 (CS_LAYERS) | LAYERS table

lpData

Points to the CADDATA structure to get properties of specified object. If this parameter is NULL, no properties are retrieved.

Return Value

If the function succeeds, the return value is a handle of object (section or table) specified by nIndex, and the structure pointed by lpData is filled by its properties.

If the function fails, the return value is NULL. To get extended error information call CADGetLastError.

See Also

CADGetChild | CADGetData


CADGetSingleFromBytes

CADGetSingleFromBytes

The CADGetSingleFromBytes function converts four octets passed as parameters to a single-precision floating-point value.

Syntax

float CADGetSingleFromBytes(

  unsigned char Byte1

unsigned char Byte2

unsigned char Byte3

unsigned char Byte4

);

Parameters

Byte1 | First octet.
Byte2 | Second octet.
Byte3 | Third octet.
Byte4 | Fourth octet.

Return Value

If the function succeeds, the return value is a single-precision floating point value.

If the function fails, the return value is NULL. To get extended error information, call CADGetLastError.

See Also

CADGetStructAsString


CADGetSplineParams

CADGetSplineParams

The CADGetSplineParams function returns the parameter of the SPLINE entity.

Syntax

int CADGetSplineParams(

  int Index,

LPCADDATA lpData

VARIANT *Param

);

Parameters

Index | Specifies the type of the parameter to be returned (0 - List of control points; 1 - List of fit points; 2 - Number of knots).
lpData | Points to the CADDATA structure that contains the parameters of the SPLINE entity.
Param | Contains the returned parameter which type is specified by Index.

Return Value

If the function succeeds, the return value is a number of the spline points

If the function fails, the return value is NULL. To get extended error information, call CADGetLastError.

See Also

CADGetSplinePointsCount


CADGetSplinePointsCount

CADGetSplinePointsCount

The CADGetSplinePointsCount function returns the number of the spline points.

Syntax

int CADGetSplinePointsCount(

  int Index,

LPCADDATA lpData

);

Parameters

Index | Specifies type of the points (0 - Control points; 1 - Fit points; 2 - Knots).
lpData | Points to the CADDATA structure that contains properties of the SPLINE entity.

Return Value

If the function succeeds, the return value is a quantity of the spline points.

If the function fails, the return value is NULL. To get extended error information, call CADGetLastError.

See Also

CADGetSplineParams


CADGetStructAsString

CADGetStructAsString

The CADGetStructAsString function returns data contained in the CADDATA structure as a string value.

Syntax

LPCSTR CADGetStructAsString(

  LPCADDATA lpData

);

Parameters

lpData

Points to the CADDATA structure that contains properties of the CAD entity.

Return Value

If the function succeeds, the return value is a string that contains information about the properties of CAD entity.

If the function fails, the return value is NULL. To get extended error information, call CADGetLastError.

See Also

CADGetSingleFromBytes


CADGetViewPortParams

CADGetViewPortParams

The CADGetViewPortParams function returns a list of ViewPort’s border points.

Syntax

Declare Function CADGetViewPortParams Lib "CADImporter.dll" (

    ByVal Index As Long,

    ByRef EData As CADData,

    Param As Variant) As Boolean

Parameters

Index | Specifies an index of 4-byte pointers to the border points starting from EData.Points.
EData | Contains the ViewPort's data.
Param | A two-dimensional array of Double type, where elements 0, 1, 2 correspond to the X, Y, Z coordinates of the point, initialized in the following way: Dim Massiv As Variant … FCount = CADGetViewPortPointsCount(K, EData) ReDim Massiv(FCount - 1, 2) K = K + FCount + I I = I + 1 … directly before the function call. Note: Index must indicate the element passed to the CADGetViewPortPointsCount function

Return Value

If the function succeeds, the return value is true.
If the function fails, the return value is false.

See Also

CADEnum | CADGetViewPortPointsCount


CADGetViewPortPointsCount

CADGetViewPortPointsCount

The CADGetViewPortPointsCount function returns a number of ViewPort’s border points.

Syntax

Declare Function CADGetViewPortPointsCount Lib "CADImporter.dll" (

  ByVal Index As Long,

  ByRef EData As CADData) As Long

Parameters

Index | Specifies index of 4-byte pointers to the border points starting from EData.Points, i.e. the function returns the number of the border points.
EData | Contains the ViewPort's data.

Return Value

Returns the number ViewPort’s border points.

See Also

CADEnum | CADGetViewPortParams


CADIs3D

CADIs3D

The CADIs3D function checks whether the drawing is three-dimensional or not.

Syntax

int CADIs3D(

  HANDLE hObject,

);

Parameters

hObject

Identifies a handle to the CAD drawing.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate | CADSetMeshQuality


CADLayer

CADLayer

The CADLayer function returns handle of the specified layer and fills the DXFDATA structure with its properties.

Syntax:

HANDLE CADLayer(

  HANDLE hObject,

  int nIndex,

  LPDXFDATA lpData

);

Parameters:

hObject | Identifies the CAD drawing object handle.
nIndex | Specifies the index in the LAYERS table of hObject. It should be in the range from 0 to the value returned by CADLayerCount minus 1.
lpData | Points to the DXFDATA structure to get properties of the layer. If this parameter is NULL, no properties are retrieved.
dwNewLong | [in] Specifies the replacement value.

Return Value:

If the function succeeds, the return value is a handle of layer object specified by nIndex and the structure pointed by lpData is filled by its properties.

If the function fails, the return value is NULL. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | CADEnum | CADLayerCount | CADLayerVisible


CADLayerCount

CADLayerCount

The CADLayerCount function returns the number of layers in the CAD file.

Syntax:

int CADLayerCount(

  HANDLE hObject

);

Parameters:

hObject

Identifies the CAD drawing object handle.

Return Value:

If the function succeeds, the return value is a number of layers in the CAD drawing object specified by hObject.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | CADLayer | CADLayerVisible


CADLayerVisible

CADLayerVisible

The CADLayerVisible function sets layer visible or invisible.

Syntax:

int CADLayerVisible(

  HANDLE hObject

  int visible

);

Parameters:

hObject | Identifies a layers handle.
visible | Set to zero to hide layer and to nonzero to show the layer.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | CADLayer | CADLayerCount


CADLayout

CADLayout

The CADLayout function returns handle of a specified layout.

Syntax:

HANDLE CADLayout(

  HANDLE hObject,

  int nIndex

);

Parameters:

hObject | Identifies an opened CAD drawing object handle.
nIndex | Specifies the hObject index in the layout table. Its value should be greater than or equal to zero and less than or equal to the value returned by CADLayoutCount minus 1.

Return Value:

If the function succeeds, the return value is a handle of layer object specified by nIndex.

If the function fails, the return value is NULL. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | CADLayoutBox | CADLayoutName | CADLayoutsCount | CADLayoutVisible | CurrentLayoutCAD | DefaultLayoutIndex


CADLayoutBox

CADLayoutBox

The CADLayoutBox function retrieves the extents of the specified layout.

Syntax:

int CADLayoutBox(

  HANDLE hObject,

  LPFRECT lpfRect

);

Parameters:

hObject | Identifies the handle of the required layout.
lpfRect | Pointer to the buffer that is to receive extents of the layout.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

Example:

_FRECT f_rect;
CADLayoutBox(CurrentLayoutCAD(CADImage, 0, FALSE), &f_rect);

See Also

CADCreate | CADLayout | CADLayoutName | CADLayoutVisible | CurrentLayoutCAD


CADLayoutCount

CADLayoutCount

The CADLayoutCount function returns the number of layouts in the CAD file.

Syntax

int CADLayoutCount(

  HANDLE hObject

);

Parameters

hObject

Identifies a handle to the CAD drawing

Return Value

If the function succeeds, the return value is a number of layouts in the CAD drawing object specified by hObject.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate | CADLayoutsCount


CADLayoutCurrent

CADLayoutCurrent

The CADLayoutCurrent function returns the index of the current layout in the CAD file.

Syntax

int CADLayoutCurrent(

  HANDLE hObject,

  int* nIndex,

  bool bDoChange

);

Parameters

hObject | Identifies a handle to the CAD drawing.
nIndex | Specifies the layout number.
bDoChange | Specifies whether current layout has to be redrawn. ·If bDoChange is set as TRUE, then it will display the layout specified by nIndex. ·If bDoChange is set as FALSE, then no changes happens.

Return Value

If the function succeeds, the return value is equal to ‘1’.

If the function fails, the return value is NULL. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | CADLayout | CADLayoutBox | CADLayoutName | CADLayouVisible


CADLayoutName

CADLayoutName

The CADLayoutName function returns the name of the specified layout.

Syntax:

int CADLayoutName(

  HANDLE hObject,

  DWORD nIndex,

  LPCSTR Name,

  DWORD nSize

);

Parameters:

hObject | Identifies the opened CAD drawing object handle.
nIndex | Specifies the hObject index in the layout table. Its value should be greater than or equal to zero and less than or equal to the value returned by CADLayoutCount minus 1.
Name | Pointer to the buffer that contains the name of the layout after calling the CADLayoutName function.
nSize | Specifies the size of the buffer Name for a name of layout.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | CADLayout | CADLayoutBox | CADLayoutVisible | CurrentLayoutCAD | CADLayoutVisible


CADLayoutsCount

CADLayoutsCount

The CADLayoutsCount function returns the number of the layouts in the CAD file.

Syntax:

int CADLayoutsCount(

  HANDLE hObject

);

Parameters:

hObject

Identifies the opened CAD drawing object handle.

Return Value:

If the function succeeds, the return value is a number of layouts in the CAD drawing object, specified by hObject.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | CADLayoutCount


CADLayoutVisible

CADLayoutVisible

The CADLayoutVisible function gets or sets the value that specifies whether the layout is visible or not. The layout is specified by its index.

Syntax:

BOOL CADLayoutVisible(

  HANDLE hObject,

  int nIndex,

  bool bSetVisible,

  bool bNewValue

);

Parameters:

hObject | Identifies the opened CAD drawing object handle.
nIndex | Specifies the index of the hObject in the layout table. Its value should be greater than or equal to zero and less then or equal to the value returned by CADLayoutCount minus 1.
bSetVisible | Defines whether bNewValue has to be used. If bSetVisible is TRUE, then the layout specified by nIndex is equal to bNewValue. If bSetVisible is FALSE, then bNewValue is ignored.
bNewValue | Sets the layout specified by nIndex as visible or invisible. If bNewValue is TRUE, then layout is set visible. If bNewValue is FALSE, it is set invisible.

Return Value:

Returns current status of the specified layout:

·If returned value is TRUE, layout specified by nIndex is visible.

·If returned value is FALSE, layout specified by nIndex is invisible.

See Also

CADCreate | CADLayout | CADLayoutBox | CADLayoutCurrent | CADLayoutName


cadltscale

CADTScale

CADTScale

 Return to chapter overview

The CADLTScale function determines the drawing scale factor.

Syntax:

int CADLTScale(

  HANDLE Handle,

  double *AScale

);

Parameters:

Handle | Identifies the CADImage object handle.
AScale | Receives the drawing scale factor.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

See Also

CADCreate


CADProhibitCurvesAsPoly

CADProhibitCurvesAsPoly

The CADProhibitCurvesAsPoly function defines conversion mode for polylines and for rotated ellipses and arcs.

Syntax

int CADProhibitCurvesAsPoly(

  HANDLE hObject,

  int nCheckNumber

);

Parameters

hObject

Identifies a handle to the CAD drawing.

nCheckNumber

Specifies mode of conversion.

1. If nCheckNumber = 0, then it is prohibited to convert CAD_ELLIPSE to CAD_POLYLINE and Ratio specifies ratio of a minor axis to the major axis, Point1 specifies center point, Point2 specifies endpoint of the major axis relative to the center. Point3, Point4 specify start point and endpoint of the elliptic arc. If Point3 and Point4 are equal, then the entity is an ellipse, else it is elliptic arc.

If nCheckNumber = 1, then CAD_ELLIPSE is converted to CAD_POLYLINE.

2. If nCheckNumber = 0, then incoming polyline is splitted to a row of lines and arcs. Starting the row entity contains the CAD_BEGIN_POLYLINE tag in DXFDATA structure. Then entities go with the CAD_ARC and CAD_LINE tags. Starting the row entity contains the CAD_END_POLYLINE tag.

If nCheckNumber = 1, then polyline is returned as an entity with the CAD_POLYLINE tag in the CADDATA structure and with a row of the CADPOINT points in DashDots. Pairs of these points form polyline.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate


CADSetMeshQuality

CADSetMeshQuality

The CADSetMeshQuality function enables users to set and/or get the MeshQuality value used to build mesh in the library.

Syntax:

int CADSetMeshQuality(

  HANDLE Handle,

  double* ANewValue,

double* AOldValue

);

Parameters:

Handle | Identifies the CADImage object handle.
ANewValue | Mesh quality.
AOldValue | Previous value of mesh quality.

Return Value:

If the function succeeds, the return value is 1.

If the function fails, the return value is 0.

See Also

CADCreate | GetIs3D


CADSetNumberOfParts

CADSetNumberOfParts

The CADSetNumberOfParts function sets the number of partitionings used to create an ellipse or a circle. If the Handle value is NULL, global settings are set.

Syntax:

int CADSetNumberOfParts(

  HANDLE Handle,

int ASpline,

int ACircle

);

Parameters:

Handle | Identifies the CADImage object handle.
ASpline | Number of partitionings for an ellipse
ACircle | Number of partitionings for a circle

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate | CADGetNumberOfParts


CADSetProcessMessages

CADSetProcessMessages

The CADSetProcessMessages function enables the message processing mode.

Syntax:

int CADSetProcessMessages(

  HANDLE hObject,

  INT IsProcess

);

Parameters:

hObject | Identifies a handle to the CAD drawing.
IsProcess | Defines whether to enable message processing mode or not (0 - disabled; 1 - enabled).

Return Value:

If the function succeeds, the return value is 1.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate | SetProcessMessagesCAD


CADSetSHXOptions

CADSetSHXOptions

The CADSetSHXOptions function sets SHX fonts options.

Syntax:

int CADSetSHXOptions(

  LPCSTR SearchSHXPaths,

  LPCSTR DefaultSHXPath,

  LPCSTR DefaultSHXFont,

  BOOL UseSHXFonts,

  BOOL UseACADPaths,

);

Parameters:

SearchSHXPaths | Specifies the search paths for SHX fonts (separated by ";").
DefaultSHXPath | Specifies the default search path for SHX fonts (must be set if AutoCAD or DWG TrueView are not installed on your machine).
DefaultSHXFont | Specifies the default SHX font.
UseSHXFonts | Specifies a value that defines whether to use SHX fonts or not (if set to false, TTF fonts will be used).
UseACADPaths | Specifies a value indicating whether to use AutoCAD fonts or not (paths will be found if AutoCAD or DWG TrueView are installed on your machine).

Return Value:

If the function succeeds, the return value is 1.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

Note:

The CADSetSHXOptions function must be called before CreateCAD function.

If the paths to SHX fonts are specified, only these SHX fonts will be used. If the CADSetSHXOptions function is not called, the paths from the registry branch are used: HKEY_CURRENT_USER\Software\SoftGold\CS_Plugins

See Also

CADCreate


CADtoDXFExport

CADtoDXFExport

The CADtoDXFExport function saves the imported CAD drawing to the DXF file format.

Syntax

int CADtoDXFExport(

  HANDLE Handle,

  LPCSTR FileName,

);

Parameters

Handle | Identifies a handle to the CAD drawing.
FileName | Specifies the name of the output DXF file.

Return Value

If the function succeeds, the return value is 1.

If the function fails, the return value is zero. To get extended error information, call CADGetLastError.

See Also

CADCreate | ExportToDXF


CADUnits

CADUnits

The CADUnits function determines the drawing measurement units (inches or millimeters).

Syntax:

int CADUnits(

  HANDLE Handle,

  int *Units

);

Parameters:

Handle

Identifies the CADImage object handle.

Units

Receives the drawing measurement units. Units variable settings:

Value | Meaning
0 1 | inches millimeters

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

See Also

CADCreate | CADGetInsUnits


CADVisible

CADVisible

The CADVisible function determines whether the specified layer is visible or not.

Syntax:

int CADVisible(

  HANDLE hObject,

  LPCSTR lpLayerName

);

Parameters:

hObject | Identifies the CAD drawing object handle.
lpLayerName | Points to a null-terminated string that specifies the layer name.

Return Value:

If the specified layer is invisible, the return value is zero.

If the specified layer is visible or not exists, the return value is nonzero.

See Also

CADCreate | CADLayerVisible


CloseCAD

CloseCAD

The CloseCAD function closes the specified opened CADImage object.

Syntax:

int CloseCAD(

  HANDLE hObject  // handle to object to close

);

Parameters:

hObject

Identifies the opened CADImage object.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CreateCAD | CreateCADEx | StopLoading


CreateCAD

CreateCAD

The CreateCAD function creates a new CADImage object and loads data into it from the specified file.

Syntax:

HANDLE CreateCAD(

  HWND hWindow,

  LPCSTR lpFileName

);

Parameters:

hWindow Identifies the window that will get system messages during the file loading. Usually it is the main window of the client's application. If no file is specified, hWindow can be NULL.

lpFileName Points to a null-terminated string that specifies the CAD file name to be loaded. If this parameter is NULL, no file is loaded and the empty CADImage object is created.

Return Value:

If the function succeeds, the return value is a handle of a new CADImage object.

If the function fails, the return value is NULL. To get extended error information, call GetLastErrorCAD.

See Also

CloseCAD | CreateCADEx | StopLoading


CreateCADEx

CreateCADEx

The CreateCADEx function creates a new CADImage object and loads data into it from the specified file.

Syntax:

HANDLE CreateCADEx(

  HWND hWindow,   // handle of the application main window

  LPCSTR lpFileName,  // pointer to the file name

  LPCSTR lpExt

);

Parameters:

hWindow | Identifies the window that will get system messages during the file loading. Usually it is the main window of the client's application. If no file is specified, hWindow can be NULL.
lpFileName | Points to a null-terminated string that specifies the CAD file name to be loaded. If this parameter is NULL, no file is loaded and the empty CADImage object is created.
lpExt | Points to a null-terminated string that specifies an extension for the CAD file name to be loaded.

Return Value:

If the function succeeds, the return value is a handle of a new CADImage object.

If the function fails, the return value is NULL. To get extended error information, call GetLastErrorCAD.

Note:

If lpExt is equal to one of the following extensions: ( '.dxf', '.dwg', '.plt', '.hgl', '.rtl', '.hg', '.plo', '.hp', '.hp1', '.hp2', '.hpg', '.hpgl', '.hpgl2', '.gl2', '.prn', '.spl', '.svg', '.cgm'), then the file specified by lpFileName and lpExt will be loaded to the created CADImage object.

If lpExt is not equal to them, then the extension in lpFileName will be checked. If it will be equal to one of the mentioned above, then the file specified in lpFileName will be loaded to the created CADImage object.

If extension in neither lpExt nor lpFileName is equal to the one of the mentioned above extensions, then the function fail.

The lpExt parameter is ignored if the filename in the lpFileName parameter is specified with extension.

See Also

CloseCAD | CreateCAD | StopLoading


CurrentLayoutCAD

CurrentLayoutCAD

The CurrentLayoutCAD returns handle of the layout specified by nIndex and can redraw this layout.

Syntax:

HANDLE CurrentLayoutCAD(

  HANDLE hObject, // handle of the application main window

  int nIndex, // defines the number of the necessary layout

  bool bDoChange,

);

Parameters:

hObject | Identifies the opened CAD Image drawing object handle.
nIndex | Specifies the hObject index in the layout table. Its value should be no greater than or equal to zero and less than or equal to the value returned by CADLayoutCount minus 1.
bDoChange | Specifies whether the current layout has to be redrawn. If bDoChange is set to TRUE, then will be displayed layout specified by nIndex. If bDoChange is set to FALSE, no changes happens.

Return Value:

If the function succeeds, the return value is a handle of the layout specified by nIndex.

If the function fails, the return value is NULL. To get extended error information, call GetLastErrorCAD.

Note:

It is recommended to use the CADLayoutsCount function before calling the CurrentLayoutCAD function.

See Also

CADCreate | CADLayoutCurrent


DefaultLayoutIndex

DefaultLayoutIndex

The DefaultLayoutIndex function returns the layout index set by default in AutoCAD DWG, DXF or HPGL/HPGL2 Hewlett Packard loaded file.

Syntax:

int DefaultLayoutIndex(

  HANDLE hObject,

);

Parameters:

hObject

Identifies the opened CAD drawing object handle.

Return Value:

Returns the layout index set by default in AutoCAD DWG, DXF or HPGL/HPGL2 Hewlett Packard loaded file.

See Also

CADCreate | CurrentLayoutCAD


DrawCAD

DrawCAD

The DrawCAD function draws the CADImage object on the specified device context.

Syntax:

int DrawCAD(

  HANDLE hObject,

  HDC hDC,

  LPRECT lprc

);

Parameters:

hObject | Identifies the CADImage object handle.
hDC | Identifies the device context.
lprc | Points to the RECT structure that contains logical coordinates of the drawing rectangle.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | DrawCADEx | DrawCADWithParams


DrawCADEx

DrawCADEx

The DrawCADEx function draws CADImage object on the specified device context. The function implements the same features as DrawCAD with additional feature for drawing a CAD file.

Syntax:

int DrawCADEx(

  HANDLE hObject,

  LPCADDRAW lpcd

);

Parameters:

hObject | Identifies the CADImage object handle.
lpcd | Points to the CADDRAW structure containing the device context, logical coordinates, drawing format etc.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADLTscale | CADunits | DrawCAD | DrawCADtoBitmap | DrawCADtoDIB | DrawCADtoGif | DrawCADtoJpeg


DrawCADtoBitmap

DrawCADtoBitmap

The DrawCADtoBitmap function converts the CADImage object to the Windows Bitmap format.

Syntax:

HGLOBAL DrawCADtoBitmap (

  HANDLE hObject,

  LPCADDRAW lpcd

);

Parameters:

hObject | Identifies the CADImage object handle.
pcd | Points to the CADDRAW structure containing the device context, logical coordinates, drawing format etc.

Return Value:

If the function succeeds, the return value is Windows Bitmap object handle.

If the function fails, the return value is NULL.

Note:

After execution of this function it is necessary to free memory using GlobalFree.

See Also

CADCreate | DrawCADtoDIB | DrawCADtoGif | DrawCADtoJpeg


DrawCADtoDIB

DrawCADtoDIB

The DrawCADtoDIB function converts CADImage object to the DIB format.

Syntax:

HGLOBAL DrawCADtoDIB(

  HANDLE Handle,

  LPRECT R

);

Parameters:

hObject | Identifies the CADImage object handle.
R | Is used for internal purposes.

Return Value:

If the function succeeds, the return value is the DIB object handle.

If the function fails, the return value is NULL.

Note:

After execution of this function, it is necessary to free memory, using GlobalFree.

See Also

CADCreate | DrawCADtoBitmap | DrawCADtoGif | DrawCADtoJpeg


DrawCADtoGIF

DrawCADtoGIF

The DrawCADtoGif function converts CADImage object to the GIF format.

Syntax:

HGLOBAL DrawCADtoGif (

  HANDLE hObject,

  LPCADDRAW lpcd

);

Parameters:

hObject | Identifies the CADImage object handle.
lpcd | Points to the CADDRAW structure containing the device context, logical coordinates, drawing format etc.

Return Value:

If the function succeeds, the return value is GIF object handle.

If the function fails, the return value is NULL.

Note:

After execution of this function, it is necessary to free memory, using GlobalFree.

See Also

CADCreate | DrawCADtoBitmap | DrawCADtoDIB | DrawCADtoJpeg


DrawCADtoJpeg

DrawCADtoJpeg

The DrawCADtoJpeg function converts CADImage object to the JPEG format.

Syntax:

HGLOBAL DrawCADtoJpeg (

  HANDLE hObject,

  LPCADDRAW lpcd

);

Parameters:

hObject | Identifies the CADImage object handle.
lpcd | Points to the CADDRAW structure containing the device context, logical coordinates, drawing format etc.

Return Value:

If the function succeeds, the return value is JPEG object handle.

If the function fails, the return value is NULL.

Note:

After execution of this function, it is necessary to free memory, using GlobalFree.

See Also

CADCreate | DrawCADtoBitmap | DrawCADtoDIB | DrawCADtoGif


DrawCADWithParams

DrawCADWithParams

The DrawCADWithParams function draws the CADImage object on the specified device context with possibility to specify DPI.

Syntax:

int DrawCADWithParams (

  HANDLE hObject,

  HDC hDC,

LPRECT lprc,

int ADPI

);

Parameters:

hObject | Identifies the CADImage object handle.
hDC | Identifies the device context.
Iprc | Points to the RECT structure that contains the logical coordinates of the drawing rectangle.
ADPI | DPI

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | DrawCAD | DrawCADEx


ExportToCADFile

ExportToCADFile

The ExportToCADFile function saves to file using metafile. The function saves files to DWG 2000/DXF.

Syntax:

int ExportToCADFile (

  HANDLE Handle,

LPCSTR FileName,

DWORD Flags,

BYTE AVersion

);

Parameters:

Handle

Metafile handle (HMETAFILE)

FileName

File types are selected according to the FileName file extension

Fllags

Export flags:

Value | Meaning
1 2 4 | Use01MM IsParseWhite AlternativeBlack - is not used

AVersion

Defines ACAD drawing file version.

TsgDWGVersion = (acR09, acR10, acR11, acR12, acR13, acR14, acR2000, acR2004, acR2007, acR2010, acR2013).

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | ExportToDXF | SaveCADtoFile | SaveCADtoFileWithXMLParams


ExportToDXF

ExportToDXF

The ExportToDXF function exports data from the specified metafile to DXF file.

Syntax:

BOOL ExporttoDXF(

  HANDLE hMetafile

  LPCSTR lpFileName

  DWORD dwFlags

);

Parameters:

hMetafile

Specifies the handle of the source Windows metafile to export data.

IpFileName

Points to a null-terminated string that specifies the target DXF file name.

dwFlags

Specifies the export mode. This parameter can combine the following values:

Value | Meaning
XP_USE01MM XP_PARSEWHITE | All coordinates are divided by 100 (as metafile 0.01 mm units) All white rectangles in the source metafile are treated as “erasing” elements.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

See Also

ExportToCADFile


GetBoxCAD

GetBoxCAD

The GetBoxCAD function determines the real width and height of the drawing.

Syntax:

int GetBoxCAD(

  HANDLE hObject,

  float *AbsWidht,

  float *AbsHeight

);

Parameters:

hObject | Identifies the CADImage object handle.
AbsWidth | Points to a floating-point value that is to receive the drawing width.
AbsHeight | Points to a floating-point value that is to receive the drawing height.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | CADGetBox


GetCADBorderSize

GetCADBorderSize

The GetCADBorderSize function gets a size of the drawing border and returns it as the ABorderSize parameter.

Syntax:

int GetCADBorderSize(

  HANDLE hObject,

  int *ABorderSize

);

Parameters:

hObject | Identifies the CADImage object handle.
ABorderSize | Contains size of the drawing border.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | SetCADBorderSize


GetCADBorderType

GetCADBorderType

The GetCADBorderType function gets type of the drawing border and returns it as the ABorderType parameter.

Syntax:

int GetCADBorderType(

  HANDLE hObject,

  int *ABorderType

);

Parameters:

hObject | Identifies the CADImage object handle.
ABorderType | Contains type of the drawing border.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | SetCADBorderSize


GetCADCoords

GetCADCoords

The GetCADCoords function gets coordinates of the point in the drawing and sets them in Coord.

Syntax:

int GetCADCoords(

  HANDLE hObject,

  float *AXScaled,

  float *AYScaled,

  LPFPOINT Coord

);

Parameters:

hObject | Identifies the CADImage object handle.
AXScaled | Defines ratio in percents between the X coordinate of a desired point in the drawing and its width.
AYScaled | Defines ratio in percents between the Y coordinate of a desired point in the drawing and its height.
Coord | Contains the desired point in the drawing.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate


GetDrawingMatrix

GetDrawingMatrix

The GetDrawingMatrix function reads the current mapping matrix of the drawing.

Syntax:

int SetDrawingMatrix(

  HANDLE THandle,

  AMatrix PDouble

);

Parameters:

Handle | Drawing handle.
AMatrix | A returned array consisting of 12 double values or a pointer to: TFMatrix = record case Integer of 0: (V1, V2, V3, V4: array[0 .. 2] of TsgFloat); 1: (M: array[0 .. 3, 0 .. 2] of TsgFloat); 2: (EX, EY, EZ, E0: TFPoint); 3: (V: array[0 .. 3] of TFPoint); end;

Return Value:

If the function succeeds, the return value is 1.

See Also

CADCreate | SetDrawingMatrix


GetEntityBox

GetEntityBox

The GetEntityBox function returns box of the entity from CADImage according to a 64-bit Handle.

Syntax:

int GetEntityBox (

  HANDLE AHandle,

UINT64 AObjHandle,

LPFRECT ARect

);

Parameters:

AHandle | Identifies the CADImage object handle.
AObjHandle | 64-bit Handle of the entity.
ARect | Pointer to the buffer that is to receive the extents of the CADImage object in Autocad coordinates.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | CADGetEntityHandle


GetExtentsCAD

GetExtentsCAD

The GetExtentsCAD function retrieves extents of the CADImage object.

Syntax:

int GetExtentsCAD(

  HANDLE Handle,

  LPFRECT ARect

);

Parameters:

Handle | Identifies the CADImage object handle.
ARect | Pointer to the buffer that is to receive extents of the CADImage object in Autocad coordinates.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

See Also

CADCreate | GetBoxCAD


GetIs3DCAD

GetIs3DCAD

The GetIs3DCAD function determines whether the drawing is three-dimensional.

Syntax:

int GetIs3DCAD (

  HANDLE Handle,

  int* AIs3D

);

Parameters:

Handle | Identifies the CADImage object handle.
AIs3D | Points to the integer value that is to receive the is 3D CADdrawing flag. AIs3D variable settings: 0 CAD object is not 3D drawing 1 CAD object is 3D drawing

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

See Also

CADCreate | CADIs3D


GetLastErrorCAD

GetLastErrorCAD

The GetLastErrorCAD function returns the last error code and sets the error message.

Syntax:

int GetLastErrorCAD(

  LPCSTR lpBuf,

  DWORD nSize

);

Parameters:

lpBuf | Points to the buffer for an error message. If this parameter is NULL, no error message is retrieved.
nSize | Specifies size of the buffer for an error message.

Return Value:

The return value is an error-code corresponding to one of the following error messages:

·ERROR_CAD_GENERAL

·ERROR_CAD_INVALID_HANDLE

·ERROR_CAD_INVALID_INDEX

·ERROR_CAD_FILE_NOT_FOUND

·ERROR_CAD_INVALID_CADDRAW

·ERROR_CAD_FILE_READ

·ERROR_CAD_UNSUPFORMAT_FILE

·ERROR_CAD_OUTOFRESOURCES

Note:

If lpBuf is not NULL, the specified buffer contains the corresponding error message as a null-terminated string.

See Also

CADCreate | CADGetLastError


GetMetafileOffsetPoint

GetMetafileOffsetPoint

The GetMetafileOffsetPoint function gets the current offset in AX,AY.

Syntax:

int GetMetafileOffsetPoint(

 double* dx,

 double* dx

);

Parameters:

dx | Offset in X-direction
dy | Offset in Y-direction

Return Value:

If the function succeeds, the return value is 1.

See Also

CADCreate | SetMetafileOffsetPoint


GetMetafileScale

GetMetafileScale

The GetMetafileScale function gets the current scale in AValue.

Syntax:

int SetMetafileScale(

 double* value

);

Parameters:

value

Scale

Return Value:

If the function succeeds, the return value is 1.

See Also

CADCreate | SetMetafileScale


GetNearestEntity

GetNearestEntity

The GetNearestEntity function determines the point that is nearest to the mouse cursor position.

Syntax:

int GetNearestEntity(

  HANDLE hObject,

  LPCSTR NearestEntityName,

  DWORD nSize,

  LPRECT R,

  LPPOINT APoint

);

Parameters:

hObject | Identifies the CADImage object handle.
NearestEntityName | Contains the name of the closest entity after calling GetNearestEntity function.
nSize | Specifies size of the buffer NearestEntityName for a name of the closest entity.
R | Specifies the RECT structure that contains the logical coordinates of the drawing rectangle.
APoint | Specifies the point relative to which search will be implemented.

Return Value:

If the function succeeds, the return value is 3.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

Note:

After executing the GetNearestEntity function APoint contains the closest knot point of the entity returned in NearestEntityName.

See Also

CADCreate | GetNearestEntityWCS


GetNearestEntityWCS

GetNearestEntityWCS

The GetNearestEntityWCS function determines a point that is nearest to the mouse cursor position.

Syntax:

int GetNearestEntityWCS(

  HANDLE hObject,

  LPCSTR NearestEntityName,

  DWORD nSize,

  LPRECT R,

  LPPOINT APoint2D,

  LPPOINT APoint3D,

);

Parameters:

hObject | Identifies the CADImage object handle.
NearestEntityName | Contains the name of the closest entity after calling the GetNearestEntityWCS function.
nSize | Specifies size of the NearestEntityName buffer for a name of the closest entity.
R | Specifies the RECT structure that contains logical coordinates of the drawing rectangle.
APoint2D | Specifies a 2D point (in screen coordinates) relative to which search will be implemented.
APoint3D | Specifies a 3D point (in CAD drawing units) relative to which search will be implemented.

Return Value:

If the function succeeds, the return value is 3.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

Note:

After executing GetNearestEntityWCS function APoint3D contains the closest knot point of the entity returned in NearestEntityName.

See Also

CADCreate | GetNearestEntity


GetPlugInInfo

GetPlugInInfo

The GetPlugInInfo gets information about the plug-in version and formats supported by the current plug-in version.

Syntax:

int GetPlugInInfo(

  LPCSTR Version,

  LPCSTR Formats

);

Parameters:

Version | Points to the string which will be initialized by the information on version.
Formats | Points to the string which will be initialized by the information on supported formats.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

See Also

GetSupportedExts


GetPointCAD

GetPointCAD

The GetPointCAD function converts coordinates of the CAD 3D point into coordinates of the flat screen coordinate system.

While working in 3D, there are both a fixed coordinate system and a movable one. The movable user coordinate system is useful for entering coordinates, establishing drawing planes and setting views. If it is needed to convert point defined in movable coordinate system into fixed screen coordinate system, one can use the GetPointCAD function.

Syntax:

int GetPointCAD(

  HANDLE Handle,

  LPDXFPOINT APoint

);

Parameters:

Handle | Identifies the CADImage object handle.
APoint | This parameters is used for both an input and an output parameter. As the input parameter it defines a point in movable CAD coordinates. As the output parameter it points to the DXFPOINT structure that receives a value of the corresponding 3D point in the fixed coordinate system.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

See Also

CADCreate | GetCADCoords


GetSupportedExts

GetSupportedExts

The GetSupportedExts function returns the list of the supported files.

Syntax:

int GetSupportedExts(

  LPWSTR ASupportedExts

);

Parameters:

ASupportedExts

List of file extensions

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | GetPlugInInfo


ProcessXML

ProcessXML

The ProcessXML function handles the XML call of AInputXML to CADImage. If it succeeds, the result is contained in AOutputXML.

Syntax:

int ProcessXML(

  HANDLE AHandle,

LPCSTR AInput,

LPCSTR AOutput,

int AMaxOutputXML,

);

Parameters:

AHandle | Identifies a CADImage object handle.
AInput | Input of XML data
AOutput | Output of XML data
AMaxOutputXML | Size of the output parameter

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate


ReadCAD

ReadCAD

The ReadCAD function returns DIB. We do not recommend to use this function. It is used for compatibility with IrfanView/XnView only.

Note: use ReadCADW for Unicode.

Syntax:

HANDLE ReadCAD(

  LPCSTR FileName,

  LPCSTR ErrorText

);

Parameters:

FileName | Points to a string containing a file name.
ErrorText | Receives text of the error message if the function fails.

Return Value:

Returns the handle of the memory region which contains the bitmap information. It can get the bitmap using this handle.

See Also

ReadCADW


ReadCADW

ReadCADW

The ReadCADW function returns DIB. We do not recommend to use this function. It is used for compatibility with IrfanView/XnView only.

Syntax:

HANDLE ReadCADW(

  LPWSTR FileName,

  LPWSTR ErrorText

);

Parameters:

FileName | Points to a string containing a file name.
ErrorText | This receives text of the error message if the function fails.

Return Value:

Returns the handle of the memory region which contains the bitmap information. It can get the bitmap using this handle.

See Also

ReadCAD


ReadCADInBMP

ReadCADInBMP

The ReadCADInBMP function returns handle of the bitmap that was loaded from CAD or other drawing supported by the library.

Syntax:

HANDLE ReadCADInBMP(

  LPCSTR FileName,

  LPCSTR ErrorText

);

Parameters:

FileName | Points to string containing a file name.
ErrorText | This receives text of the error message if the function fails.

Return Value:

Returns the handle of a bitmap object.

See Also

ReadCAD | ReadCADW


ResetDrawingBoxCAD

ResetDrawingBoxCAD

The ResetDrawingBoxCAD function invalidates a rectangular 3D CAD drawing area that was set by SetDrawingBoxCAD. It means that the whole drawing will be displayed.

Syntax:

int ResetDrawingBoxCAD(

  HANDLE Handle

);

Parameters:

Handle

Identifies the CADImage object handle.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

See Also

CADCreate | SetDrawingBoxCAD


RotToViewCAD

RotToViewCAD

The RotToViewCAD function sets beforehand specified views for CADImage.

Syntax:

int RotToViewCAD(

  HANDLE Handle

int ViewDirection

);

Parameters:

Handle

Identifies the CADImage object handle.

ViewDirection

Can have the following values:

Value | Meaning
1 2 3 4 5 6 7 8 9 10 | vdTop vdBottom vdLeft vdRight vdFront vdBack vdSWIsometric vdSEIsometric vdNWIsometric vdNEIsometric

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | SetRotateCAD


SaveCADtoBitmap

SaveCADtoBitmap

The SaveCADtoBitmap function saves currently displayed layout to the BMP file format with sizes predefined in R member of the CADDRAW structure.

Syntax:

int SaveCADtoBitmap(

  HANDLE hObject,

  LPCADDRAW lpcd,

  LPCSTR lpFileName

);

Parameters:

hObject | Identifies the CADImage object handle.
lpcd | Points to the CADDRAW structure containing the device context, logical coordinates, drawing format etc.
lpFileName | Points to a null-terminated string that specifies the BMP file name to which currently displayed layout will be saved.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | SaveCADtoGif | SaveCADtoJpeg | SaveCADtoPNG


SaveCADtoCAD

SaveCADtoCAD

The SaveCADtoCAD function saves currently imported drawing to the CAD file.

Syntax:

int SaveCADtoCAD(

  HANDLE hObject,

  LPCADEXPORTPARAMS ceParams,

  LPCSTR FileName

);

Parameters:

hObject | Identifies the CADImage object handle.
ceParams | Points to the CADEXPORTPARAMS structure that contains export parameters.
FileName | Points to a null-terminated string that contains the CAD file name to which currently displayed layout will be saved.

Return Value:

If the function succeeds, the return value is 1.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

If the function returns -1, a specified output file format is not supported.

Note:

This function is obsolete. We recommend you to use the SaveCADtoFileWithXMLParams function for export.

See Also

CADCreate | SaveCADtoFile | SaveCADtoFileWithXMLParams


SaveCADtoFile

SaveCADtoFile

The SaveCADtoFile function saves the imported CAD drawing to a file.

Syntax

int SaveCADtoFile(

  HANDLE Handle,

  LPCSTR Params,

  CADDRAWPROC CADDrawProc,

  PROGRESSPROC Proc,

);

Parameters

Handle | Identifies the CADImage object handle.
Params | Specifies XML parameters that represent the export settings.
CADDrawProc | Specifies a pointer to the drawing procedure.
Proc | Specifies a pointer to the progress procedure (represents progress of the export operation).

Return Value:

If the function succeeds, the return value is 1.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | SaveCADtoFileWithXMLParams


SaveCADtoFileWithXMLParams

SaveCADtoFileWithXMLParams

The SaveCADtoFileWithXMLParams function saves the imported CAD drawing to a file with specified parameters represented as an XML document.

Syntax

int SaveCADtoFileWithXMLParams(

  HANDLE Handle,

  LPCSTR Params,

  PROGRESSPROC Proc,

);

Parameters

Handle | Identifies the CADImage object handle.
Params | Specifies XML parameters that represent the export settings.
Proc | Specifies a pointer to the progress procedure (represents progress of the export operation).

Return Value:

If the function succeeds, the return value is 1.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

XML Parameters description | CADCreate | SaveCADtoFile


SaveCADtoEMF

SaveCADtoEMF

The SaveCADtoEMF function saves currently displayed layout to the EMF file format with sizes predefined in R member of the CADDRAW structure.

Syntax:

int SaveCADtoEMF(

  HANDLE hObject,

  LPCADDRAW lpcd,

  LPCSTR lpFileName

);

Parameters:

hObject | Identifies the CADImage object handle.
lpcd | Points to the CADDRAW structure containing the device context, logical coordinates, drawing format etc.
lpFileName | Points to a null-terminated string that specifies the name of the output EMF file.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | ExportToDXF | SaveCADtoFile | SaveCADtoFileWithXMLParams


SaveCADtoGif

SaveCADtoGif

The SaveCADtoGif function saves currently displayed layout to the GIF file format with sizes predefined in R member of the CADDRAW structure.

Syntax:

int SaveCADtoGif(

  HANDLE hObject,

  LPCADDRAW lpcd,

  LPCSTR lpFileName

);

Parameters:

hObject | Identifies the CADImage object handle.
lpcd | Points to the CADDRAW structure containing the device context, logical coordinates, drawing format etc.
lpFileName | Points to a null-terminated string that specifies the name of the output GIF file.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | SaveCADtoBitmap | SaveCADtoJpeg | SaveCADtoPNG


SaveCADtoJpeg

SaveCADtoJpeg

The SaveCADtoJpeg function saves currently displayed layout to the JPEG file format with sizes predefined in R member of the CADDRAW structure.

Syntax:

int SaveCADtoJpeg(

  HANDLE hObject,

  LPCADDRAW lpcd,

  LPCSTR lpFileName

);

Parameters:

hObject | Identifies the CADImage object handle.
lpcd | Points to the CADDRAW structure containing the device context, logical coordinates, drawing format etc.
lpFileName | Points to a null-terminated string that specifies the name of the output JPEG file.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CreatCAD | SaveCADtoBitmap | SaveCADtoPNG


SaveCADtoPNG

SaveCADtoPNG

The SaveCADtoPNG function saves currently displayed layout to the PNG file format with sizes predefined in R member of the CADDRAW structure.

Syntax:

int SaveCADtoPNG(

  HANDLE hObject,

  LPCADDRAW lpcd,

  LPCSTR lpFileName

);

Parameters:

hObject | Identifies the CADImage object handle.
lpcd | Points to the CADDRAW structure containing the device context, logical coordinates, drawing format etc.
lpFileName | Points to a null-terminated string that specifies the name of the output PNG file.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | SaveCADtoBitmap | SaveCADtoGif | SaveCADtoJpeg


SaveCADWithXMLParametrs

SaveCADWithXMLParametrs

The SaveCADWithXMLParametrs function saves the specified drawing to the file described in AXMLParametrs.

Syntax:

int SetDrawingMatrix(

  HANDLE THandle,

  AXMLParametrs PChar

);

Parameters:

Handle | Drawing handle.
AXMLParametrs | A string containing XML description of the output file.

Return Value:

If the function succeeds, the return value is zero.

If the function fails, the return value is 1. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | XML Export Parameters


SetBlackWhite

SetBlackWhite

The SetBlackWhite function sets the black/white or colored mode of drawing the image.

Syntax:

DWORD SetBlackWhite(

  HANDLE hObject,

  int CMode

);

Parameters:

hObject

Identifies the CADImage object handle.

CMode

Specifies the drawing mode.

·If CMode is equal to 1, then the CAD drawing object specified by hObject is drawn in the black/white mode.

·If CMode is equal to 0, then the CAD drawing object specified by hObject is drawn in the colored mode.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

Note:

In black/white mode the default color is defined by the SetDefaultColor function.

See Also

CADCreate


SetBMSize

SetBMSize

The SetBMSize function verifies the input parameter as size of the bitmap

Syntax:

BOOL SetBMSize(

  int Value

);

Parameters:

Value

Value that must be verified.

Return Value:

If the value is within the specified interval, the function returns true, otherwise, false.

Note:

Is not recommended for using in applications.

See Also

CADCreate


SetBMSize_stdcall

SetBMSize_stdcall

The SetBMSize_stdcall function calls the SetBMSize function.

Syntax:

BOOL SetBMSize_stdcall (

  int Value

);

Parameters:

Value

Value that must be verified.

Return Value:

If the value is within the specified interval, the function returns true, otherwise, false.

Note:

Is not recommended for using in applications.

See Also

CADCreate


SetCADBorderSize

SetCADBorderSize

The SetCADBorderSize function sets width of the border around the loaded image.

Syntax:

int SetCADBorderSize(

  HANDLE hObject,

  int BSize

);

Parameters:

hObject | Identifies the CADImage object handle
BSize | Specifies width of the border.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

Note:

Set BSize as integer value, if the second parameter of SetCADBorderType is Global. In this case the border width is defined in global units.

Set BSize as double value less than 1, if the second parameter of SetCADBorderType is Ratio. In this case theborder width is defined in percents respectively to the drawing size.

See Also

CADCreate | GetCADBorderSize


SetCADBorderType

SetCADBorderType

The SetCADBorderType function sets type of the drawing border: global points or ratio.

Syntax:

int SetCADBorderType(

  HANDLE hObject,

  int BType

);

Parameters:

hObject | Identifies the CADImage object handle
BType | Specifies the border type.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

Note:

If BType is equal to 0, then the border type is Global.

If BType is equal to 1, then the border type is Ratio.

If the border type is Global, the second parameter of SetCADBorderSize must contain an integer value. It defines the border width in global units.

If the border type is Ratio, the second parameter of SetCADBorderSize must contain a double value less than 1. It defines the border width in percents respectively to the drawing size.

See Also

CADCreate | GetCADBorderType


SetCADLayerColor

SetCADLayerColor

The SetCADLayerColor function sets color for the Layer.

Syntax:

int SetCADLayerColor(

  HANDLE Handle,

int Color

);

Parameters:

Handle | Identifies the CADImage object handle.
Color | Color of the layer.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | SetDefaultColor


SetClippingRectCAD

SetClippingRectCAD

The SetClippingRectCAD function sets a clipping rect for CADImage.

Syntax:

int SetClippingRectCAD(

  HANDLE Handle,

LPFRECT ABox

);

Parameters:

Handle | Identifies the CADImage object handle.
ABox | Specifies a rectangular area of the drawing that will be displayed.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | GetBoxCAD | GetExtentsCAD | SetDrawingBoxCAD


SetDefaultColor

SetDefaultColor

The SetDefaultColor function sets color of pens and brushes specified by the user.

Syntax:

int SetDefaultColor(

  HANDLE hObject,

  Color ADefaultColor

);

Parameters:

hObject | Identifies the CADImage object handle
ADefaultColor | Sets the color of pens and brushes for drawing the CAD drawing object specified by hObject.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

Note:

If the SetBlackWhite function is called with the CMode parameter equal to 1, the CAD drawing object specified by hObject is drawn with the color defined by the SetDefaultColor function.

See Also

CADCreate | SetCADLayerColor


SetDrawingBoxCAD

SetDrawingBoxCAD

The SetDrawingBoxCAD function sets a rectangular 3D CAD drawing area (defined in CAD coordinates) that will be displayed.

Syntax:

int SetDrawingBoxCAD(

  HANDLE hObject,

  LPFRECT ABox

);

Parameters:

hObject | Identifies the CADImage object handle
ABox | Specifies a rectangular area of the drawing that will be displayed.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | DrawCAD


SetDrawingMatrix

SetDrawingMatrix

The SetDrawingMatrix function sets the mapping matrix for the specified drawing.

Syntax:

int SetDrawingMatrix(

  HANDLE THandle,

  AMatrix PDouble

);

Parameters:

Handle | Drawing handle.
AMatrix | A pointer to the array of 12 double values or a pointer to TFMatrix = record case Integer of 0: (V1, V2, V3, V4: array[0 .. 2] of TsgFloat); 1: (M: array[0 .. 3, 0 .. 2] of TsgFloat); 2: (EX, EY, EZ, E0: TFPoint); 3: (V: array[0 .. 3] of TFPoint); end;

Return Value:

If the function succeeds, the return value is 1.

See Also

CADCreate | GetDrawingMatrix


SetMetafileOffsetPoint

SetMetafileOffsetPoint

The SetMetafileOffsetPoint function sets the origin of coordinates offset while importing to CAD.

Syntax:

int SetMetafileOffsetPoint(

 double dx,

 double dx

);

Parameters:

dx | Offset in X-direction
dy | Offset in Y-direction

Return Value:

If the function succeeds, the return value is 1.

See Also

CADCreate | GetMetafileOffsetPoint


SetMetafileScale

SetMetafileScale

The SetMetafileScale function sets scale for import to CAD.

Syntax:

int SetMetafileScale(

 double value

);

Parameters:

value

Scale

Return Value:

If the function succeeds, the return value is 1.

See Also

CADCreate | GetMetafileScale


SetNullLineWidthCAD

SetNullLineWidthCAD

The SetNullLineWidthCAD function sets the default width of the entities which line width is equal to zero.

Syntax:

int SetNullLineWidthCAD(

  HANDLE hObject,

  int ANullWidth

);

Parameters:

hObject | Identifies the CADImage object handle
ANullWidth | Specifies the width value.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | SetShowLineWeight


SetProcessMessagesCAD

SetProcessMessagesCAD

The SetProcessMessagesCAD function prohibits or permits checking of the message queue for posted messages, and retrieving the messages (if any exist) while computationally intensive (slow) operations such as loading, storing or transforming image data are being performed.

Syntax:

int SetProcessMessagesCAD(

  HANDLE hObject,

  int mode

);

Parameters:

hObject | Identifies the CADImage object handle
mode | ·If the mode is equal to 1, then checking of the message queue is permitted. ·If the mode is equal to 0, then checking of the message queue is prohibited.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | CADSetProcessMessages


SetProgressProc

SetProgressProc

The SetProgressProc function specifies the callback function that receives data about the stage of a lengthy operation.

Syntax:

int SetProgressProc(

  PROGRESSPROC AProgressProc,

);

Parameters:

AProgressProc

Specifies the callback function.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

See Also

CADCreate


SetRotateCAD

SetRotateCAD

The SetRotateCAD function rotates the image at a given angle (in degrees) around one of the axes (OX, OY or OZ).

Syntax:

int SetRotateCAD(

  HANDLE hObject,

  float AAngle,

  int AAxis

);

Parameters:

hObject

Identifies the CADImage object handle.

AAngle

Specifies the rotation angle

Aaxis

Specifies the coordinate axis around which the image is rotated:

Value | Meaning
0 | OX Axis
1 | OY Axis
2 | OZ Axis

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Function returns ‘2’, if the currently displayed image can’t be rotated (layouts of DWG/DXF)

See Also

CADCreate | RotToViewCAD


setshowlineweightcad

SetShowLineWeight

SetShowLineWeight

 Return to chapter overview

The SetShowLineWeightCAD function defines whether all entities in the drawing will be drawn with the line width set by the SetNullLineWidthCAD function or not.

Syntax:

int SetShowLineWeightCAD(

  HANDLE hObject,

  int AIsShow

);

Parameters:

hObject | Identifies a CADImage object handle.
AIsShow | If it is set False, then all entities in the drawing are drawn with the line width set by the SetNullLineWidthCAD function.

Return Value:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastErrorCAD.

See Also

CADCreate | SetNullLineWidthCAD


StopLoading

StopLoading

The StopLoading function stops the loading process.

Syntax:

int StopLoading();

Return Value:

The function returns 1, if the loading process has been stopped.

See Also

CloseCAD | CreateCAD | CreateCADEx


StRg

StRg

The StRg function provides registration of CAD DLL for current application without writing to Registry.

Syntax:

int StRg(

  LPCSTR User,

  LPCSTR EMail,

  LPCSTR Key,

);

Parameters:

User | Represents the content of the Name field from the registration data.
EMail | Represents the content of the E-mail field from the registration data.
Key | Represents the content of the Key field from the registration data.

Return Value:

If the function succeeds, the return value is 1.

If the function fails, the return value is zero.

See Also

StRgA | StRgW


StRgA

StRgA

The StRgA function provides registration of CAD DLL for current application without writing to Registry.

Syntax:

int StRgA(

  LPCSTR User,

  LPCSTR EMail,

  LPCSTR Key,

);

Parameters:

User | Represents the content of the Name field from the registration data.
EMail | Represents the content of the E-mail field from the registration data.
Key | Represents the content of the Key field from the registration data.

Return Value:

If the function succeeds, the return value is 1.

If the function fails, the return value is zero.

See Also

StRg | StRgW


StRgW

StRgW

The StRgW function provides registration of CAD DLL for current application without writing to Registry.

Syntax:

int StRgW(

  LPCWSTR User,

  LPCWSTR EMail,

  LPCWSTR Key,

);

Parameters:

User | Represents the content of the Name field from the registration data.
EMail | Represents the content of the E-mail field from the registration data.
Key | Represents the content of the Key field from the registration data.

Return Value:

If the function succeeds, the return value is 1.

If the function fails, the return value is zero.

See Also

StRg | StRgA


XML Parameters Description

Navigation: »No topics above this level«

XML Parameters Description

 Return to chapter overview

The description consists of two sections:

1. Description of XML Tags - definitions of every possible tag, with examples and their use.

2. Example of XML string - a string containing the tags listed in section 1.

3.XML Export Parameters (for the SaveCADWithXMLParametrs function).

See Also

CAD DLL Types | CAD DLL structures | CAD DLL Functions


Description of XML Tags

Navigation: XML Parameters Description >

Description of XML Tags

 Return to chapter overview

There are the following XML tags:

·<ExportParams>

o<Filename>

o<Ext>

o<CADParametrs>

§<XScale>

§<BackgroundColor>

§<DefaultColor>

o<GraphicParametrs>

§<PixelFormat>

§<Width>

§<Height>

§<DrawMode>

§<DrawRect>

The root element, or the base tag that all other tags/elements fall under. Contains one attribute: version that defines XML version.Example: <ExportParams version="1.0">

Name of the output file. Example: <Filename>C:\sample.dxf</Filename>

Output file extension. Example: <Ext>.dxf</Ext>

Parameters for export to CAD formats.

Scale factor along the X axis. Example: <XScale>1</XScale>

Background color of the output drawing. Example: <BackgroundColor>16777215</BackgroundColor>

Default color for the entities in the output drawing. Example: <DefaultColor>0</DefaultColor>

Parameters for export to raster formats.

Pixel format that describes the memory layout of each pixel in a bitmap. Example: <PixelFormat>6</PixelFormat>

Width of the output image (in pixels). Example: <Width>640</Width>

Height of the output image (in pixels). Example: <Height>480</Height>

Color mode of the output image (0 - color; 1 - black-and-white; 2 - gray scale). Example: <DrawMode>0</DrawMode>

Logical coordinates of the drawing rectangle. This element contains four attributes: Left, Top, Right, Bottom.

Example: <DrawRect Left="0" Top="0" Right="640" Bottom="480"/>

See Also

XML Parameters description | Example


Example of XML String

Navigation: XML Parameters Description >

Example of XML String

 Return to chapter overview

Example containing the listed tags:

<ExportParams version="1.0">
<Filename>C:\sample.dxf</Filename>
<Ext>.dxf</Ext>
<CADParametrs>
<XScale>1</XScale>
<BackgroundColor>16777215</BackgroundColor>
<DefaultColor>0</DefaultColor>
</CADParametrs>
<GraphicParametrs>
<PixelFormat>6</PixelFormat>
<Width>640</Width>
<Height>480</Height>
<DrawMode>0</DrawMode>
<DrawRect Left="0" Top="0" Right="640" Bottom="480"/>
</GraphicParametrs>
</ExportParams>

See Also

XML Parameters description | Description of XML Tags


XML Export Parameters

Navigation: XML Parameters Description >

XML Export Parameters

 Return to chapter overview

XML description of the output file obtained after calling the SaveCADWithXMLParametrs function:

<?xml version="1.0" encoding="utf-8"?>
<ExportParams>
<!-- Clipping -->
<ClipMode>Integer, cutting mode</ClipMode>
<ClipRect>TFRect, cutting area</ClipRect>
<!-- Raster -->
<Width>Integer,width of the result</Width>
<Height>Integer,height of the result</Height>
<MaxDim>Integer</MaxDim>
<Quality>Double, quality</Quality>
<MeasureInPixels>Boolean</MeasureInPixels>
<Transparent>Boolean, transparency</Transparent>
<DPUX>Integer</DPUX>
<DPUY>Integer</DPUY>
<SizeMode>TSizeMode</SizeMode>
<Compression>TsgTIFFCompressionType</Compression>
<BitPerPixel>TPixelFormat</BitPerPixel>
<Proportional>Boolean</Proportional>
<!-- CAD -->
<Version>TsgDWGVersion</Version>
<IsParseWhite>Boolean</IsParseWhite>
<UnitSize>Double</UnitSize>
<Use01MM>Boolean</Use01MM>
<LineWeightScale>Double</LineWeightScale>
<FillingEntity>Boolean</FillingEntity>
<OffsetPoint>TF2DPoint</OffsetPoint>
<LayersMode>Integer</LayersMode>
<PageWidth>Double</PageWidth>
<PageHeight>Double</PageHeight>
<Margin>Double</Margin>
<DrawMode>Integer</DrawMode>
<BackgroundColor>Integer</BackgroundColor>
<DefaultColor>Integer</DefaultColor>
<NullWidth>Double</NullWidth>
<SaveLineWeight>Boolean</SaveLineWeight>
<LayoutExportMode>Integer</LayoutExportMode>
<LayoutNameExportMode>String</LayoutNameExportMode>
<Title>String</Title>
<Author>String</Author>
<Subjct>String</Subjct>
<Keywords>String</Keywords>
<LineWeights>String</LineWeights>
<UseVectorLineWeight>Boolean</UseVectorLineWeight>
<UseExtentsFromPlotSettings>Boolean</UseExtentsFromPlotSettings>
<XScale>Double</XScale>
<IsConvertImageToOLE>Boolean</IsConvertImageToOLE>
</ExportParams>

TFRect - left,top,Z1,right,bottom,Z2

See Also

XML Parameters description | Description of XML Tags | SaveCADWithXMLParametrs


Examples

Navigation: »No topics above this level«

Examples

 Return to chapter overview

CAD DLL demo examples are presented in Delphi, Visual Basic .NET, Visual C++ and C#.

The demo examples are divided into 3 groups:

·Viewer

·Access to entities

·Export to CAD

See Also

Viewer | Access to Entities | Export to CAD


Viewer

Navigation: Examples >

Viewer

 Return to chapter overview

ViewDemo shows how to view CAD drawings with CAD DLL.

The demo includes examples for the following programming languages:

·C#:

·Delphi:

·Visual C++:

·Visual Basic .NET:

·Visual Basic:

See Also

Access to entities | Export to CAD


Access to Entities

Navigation: Examples >

Access to Entities

 Return to chapter overview

ImportDemo shows how to access the CAD drawing data with CAD DLL.

The demo includes examples for the following programming languages:

·C#:

·C++ Builder:

·Delphi:

·Visual Basic:

·Visual C++:

See Also

Viewer | Export to CAD


C#

Navigation: Examples > Access to Entities >

C#

 Return to chapter overview

CAD DLL Import Example for C#:

·Structures

·Methods

See Also

CAD DLL Import C# Example Structures | CAD DLL Import C# Example Methods


Structures

CAD DLL C# Example Types

Navigation: Examples > Access to Entities > C# >

CAD DLL C# Example Types

 Return to chapter overview

CAD DLL Import C# example includes the following structures:

·CADData

·CADPoint

See Also

CAD DLL Delphi Example Methods


Methods

CAD DLL Import C# Example Methods

Navigation: Examples > Access to Entities > C# >

CAD DLL Import C# Example Methods

 Return to chapter overview

CAD DLL Import C# example includes the following methods:

·CloseCADFile

·DrawEntity

·FitToWindow

·GetPoint

·ZoomExtents

See Also

CAD DLL Delphi Example Structures


CloseCADFile

Navigation: Examples > Access to Entities > C# > Methods >

CloseCADFile

 Return to chapter overview

The CloseCADFile method calls the CADClose function to close the loaded file.

Syntax

private void CloseCADFile()

See Also

DrawEntity | FitToWindow | GetPoint | ZoomExtents


DrawEntity

Navigation: Examples > Access to Entities > C# > Methods >

DrawEntity

 Return to chapter overview

DrawEntity is the callback method for CADEnum that renders the entities one by one using properties from the CADDATA structure.

Syntax

public static void DrawEntity(ref CADData EntData, IntPtr Param)

Parameters

EntData | The reference parameter that specifies the CADDATA structure
Param | Points to the optional callback function data.

See Also

CADPROC | CloseCADFile | FitToWindow | GetPoint | ZoomExtents


FitToWindow

Navigation: Examples > Access to Entities > C# > Methods >

FitToWindow

 Return to chapter overview

The FitToWindow method calculates the drawing area for the client area of the control.

Syntax

private RectangleF FitToWindow(Rectangle ClientR)

Parameters

ClientR

ClientR Specifies the client area

See Also

DrawEntity | CloseCADFile | GetPoint | ZoomExtents


GetPoint

Navigation: Examples > Access to Entities > C# > Methods >

GetPoint

 Return to chapter overview

The GetPoint method calculates a position of 3D point on the drawing area considering the current offset and scale values.

Syntax

public static Point GetPoint(CADPoint Point)

Parameters

Point

Specifies a 3D point in CAD drawing units

See Also

DrawEntity | CloseCADFile | FitToWindow | ZoomExtents


ZoomExtents

Navigation: Examples > Access to Entities > C# > Methods >

ZoomExtents

 Return to chapter overview

The ZoomExtents method fits the drawing to the client area proportionally.

Syntax

private void ZoomExtents()

See Also

DrawEntity | CloseCADFile | FitToWindow | GetPoint


Delphi

Navigation: Examples > Access to Entities >

Delphi

 Return to chapter overview

CAD DLL Import example for Borland / CodeGear / Embarcadero Delphi:

·Variables

·Functions

See Also

CAD DLL Delphi Example Variables | CAD DLL Delphi Example Functions


Variables of CAD Importer SDK DLL Delphi Version

CAD DLL Import Delphi Example Variables

Navigation: Examples > Access to Entities > Delphi >

CAD DLL Import Delphi Example Variables

Return to chapter overview

CAD DLL Delphi example includes the following variables:

·EData

·IsInsideInsert

See Also

CAD DLL Delphi Example Functions


EData

Navigation: Examples > Access to Entities > Delphi > Variables >

EData

 Return to chapter overview

The EData variable defines a pointer to the CADData structure.

Syntax

var

EData: PcadData;

See Also

IsInsideInsert


IsInsideInsert

Navigation: Examples > Access to Entities > Delphi > Variables >

IsInsideInsert

 Return to chapter overview

The IsInsideInsert variable defines whether current entity belongs to the last passed INSERT entity.

Syntax

var

IsInsideInsert: Boolean = False;

Note

If EData.Tag of the current entity is equal to DXF_BEGIN_INSERT, then IsInsideInsert is set to True and EData.Text contains the name of the INSERT entity. Unless EData.Tag is not equal to DXF_END_INSERT, all entities belong to this INSERT.

See Also

EData


Functions of CAD Importer SDK DLL Delphi Version

CAD DLL Import Delphi Example Functions

Navigation: Examples > Access to Entities > Delphi >

CAD DLL Import Delphi Example Functions

 Return to chapter overview

CAD DLL Import Delphi example includes the following functions:

·Error

·GetPoint

·GetPointsList

·GetSpline

See Also

CAD DLL Delphi Example Variables


DoLines

Navigation: Examples > Access to Entities > Delphi > Functions >

DoLines

 Return to chapter overview

The DoLines procedure creates the list of ticks of the dotted line.

Syntax

procedure DoLines;

See Also

Error | GetPoint | GetPointsList | GetSpline


Error

Navigation: Examples > Access to Entities > Delphi > Functions >

Error

 Return to chapter overview

The Error procedure generates exception based on the CADGetLastError function.

Syntax

procedure Error;

See Also

DoLines | GetPoint | GetPointsList | GetSpline


GetPoint

Navigation: Examples > Access to Entities > Delphi > Functions >

GetPoint

 Return to chapter overview

The GetPoint function converts CAD units to display pixels with scale.

Syntax

function GetPoint(

 const P:

TFPoint): TPoint;

Parameters

P

Point for conversion.

Return Value

The return value is a display point.

See Also

DoLines | Error | GetPointsList | GetSpline


GetPointsList

Navigation: Examples > Access to Entities > Delphi > Functions >

GetPointsList

 Return to chapter overview

The GetPointsList procedure converts the PFPoint-list in the PPoint-list with converting CAD units to display pixels.

Syntax

procedure GetPointsList(

SingPoints,

IntPts: TList);

Parameters

SingPts | List of the PFPoint points (pointers to TFPoint structures) for conversion.
IntPts | List of the PPoint-points with Count=0 for writing converted points. This list should be created and deleted in the procedure that calls the GetPointsList procedure.

See Also

DoLines | Error | GetPoint | GetSpline


GetSpline

Navigation: Examples > Access to Entities > Delphi > Functions >

GetSpline

 Return to chapter overview

The GetSpline function creates a spline and returns it as a list of points.

Syntax

function GetSpline(

 ControlPoints,

 FitPoints,

 Knots: TList;

 ChordLen: Single

): TList;

Parameters

ControlPoints | List of controlpoints.
FitPoints | List of fitpoints.
Knots | List of knots.

Return Value

The return value is a spline as a list of points.

See Also

DoLines | Error | GetPoint | GetPointsList


Visual Basic

Navigation: Examples > Access to Entities >

Visual Basic

 Return to chapter overview

CAD DLL Import example Visual Basic .NET:

·Variables

·Types

·Functions

See Also

CAD DLL Visual Basic Example Variables | CAD DLL Visual Basic Example Types | CAD DLL Visual Basic Example Functions


Variables of CAD Importer SDK DLL Visual Basic

CAD DLL Import Visual Basic Example Variables

Navigation: Examples > Access to Entities > Visual Basic >

CAD DLL Import Visual Basic Example Variables

 Return to chapter overview

CAD DLL Visual Basic example includes the following variables:

·drag

·FScale

·KX

·KY

·PreviousPoint

·Offset

See Also

CAD DLL Visual Basic Example Types | CAD DLL Visual Basic Example Fucntions


drag

Navigation: Examples > Access to Entities > Visual Basic > Variables >

drag

 Return to chapter overview

The drag variable is a flag. Drag is True, if the drawing is moving. Otherwise, Drag = False

Syntax

Dim drag As Boolean

See Also

KX | KY | PreviousPoint | Offset | FScale


FScale

Navigation: Examples > Access to Entities > Visual Basic > Variables >

FScale

 Return to chapter overview

The FScale variable contains drawing scale factor.

Syntax

Dim FScale As Long

See Also

drag | KX | KY | PreviousPoint | Offset | FScale


KX

Navigation: Examples > Access to Entities > Visual Basic > Variables >

KX

 Return to chapter overview

The KX variable is a ratio of form width to the right X-coordinate.

Syntax

Dim KX As Single

See Also

drag | KX | KY | PreviousPoint | Offset | FScale


KY

Navigation: Examples > Access to Entities > Visual Basic > Variables >

KY

 Return to chapter overview

The KY variable is a ratio of form width to the bottom Y-coordinate.

Syntax

Dim KY As Single

See Also

drag | KX | PreviousPoint | Offset | FScale


Offset

Navigation: Examples > Access to Entities > Visual Basic > Variables >

Offset

 Return to chapter overview

The Offset variable an instance of POINTAPI type, which contains drawing displacement from initial position. The displacement may be changed by mouse manipulations.

Syntax

Dim Offset As POINTAPI

See Also

drag | KX | KY | PreviousPoint | Offset | FScale


PreviousPoint

Navigation: Examples > Access to Entities > Visual Basic > Variables >

PreviousPoint

 Return to chapter overview

An instance of POINTAPI type, which contains previous mouse position.

Syntax

Dim PreviousPoint As POINTAPI

See Also

drag | KX | KY | PreviousPoint | Offset | FScale


Types of CAD Importer SDK DLL Visual Basic version

CAD DLL Import Visual Basic Example Types

Navigation: Examples > Access to Entities > Visual Basic >

CAD DLL Import Visual Basic Example Types

 Return to chapter overview

CAD DLL Visual Basic example includes the following types:

·CADData

·CADExtendedData

·CADParam

·LOGFONT

·POINTAPI

·RECT

·RECTAPI

See Also

Variables of CAD DLL Import Visual Basic Example | CAD DLL Visual Basic Example Functions


CADParam

Navigation: Examples > Access to Entities > Visual Basic > Types >

CADParam

 Return to chapter overview

The CADParam type contains properties of all entities.

Syntax

Public Type CADParam

    hWnd As Long

    hDC As Long

    offset As POINTAPI

    ScaleFactor As Single

    DrawMode As Long

    CircleDrawMode As Long

    GetArcsCurves As Boolean

    IsInsideInsert As Long

    Thickness As Boolean

End Type

Parameters

hWnd

Defines client's window handle.

hDC

Defines client's device context.

offset

Defines offset of the drawing area along OX and OY axis respectively to the top-left corner of the client's drawing box.

ScaleFactor

Defines the scale parameter.

DrawMode

Defines the way how lines with noncontinuous line type have to be drawn.

Value | Meaning
ID_DRAWINGSTYLE_DASHDOTS = 0 | Lines will be drawn with the line type of source lines (read from the CAD file).
ID_DRAWINGSTYLE_WINAPI = 1 | Lines will be drawn with equal WinAPI line type most similar to the one read from the CAD file.
ID_DRAWINGSTYLE_WINAPI = 2 | Lines will be drawn with the solid type.

CircleDrawMode

Defines the way how circles, ellipses or arcs with noncontinuous line type have to be drawn.

Value | Meaning
0 | Circles, ellipses or arcs will be drawn with the type of source entities (read from the CAD file).
1 | Circles, ellipses or arcs will be drawn with equal WinAPI line type the most similar to the one read from the CAD file.
2 | Circles, ellipses or arcs will be drawn with the solid type.

GetArcsCurves

Defines the way how rotated circles, ellipses and arcs will be drawn.

Value | Meaning
0 | Rotated circles, ellipses and arcs will be drawn as polylines.
1 | Rotated circles, ellipses and arcs will be drawn by Windows API means (i.e. without taking into account rotating parameters).

Get more information in the description of the CADProhibitCurvesAsPoly function.

IsInsideInsert

Defines if the current entity belongs to the INSERT.

Value | Meaning
0 | Entity does not belong to the current INSERT.
1 | Entity belongs to the current INSERT.

Thickness

Defines thickness of the current entity.

See Also

CADData | CADExtendedData | CADPoint | LOGFONT | POINTAPI | RECT | RECTAPI


CADPoint

Navigation: Examples > Access to Entities > Visual Basic > Types >

CADPoint

 Return to chapter overview

The CADPoint type contains 3D point coordinates.

Syntax

Public Type CADPoint

    X As Double

    Y As Double

    Z As Double

End Type

See Also

CADData | CADExtendedData | CADParam | LOGFONT | POINTAPI | RECT | RECTAPI


LOGFONT

Navigation: Examples > Access to Entities > Visual Basic > Types >

LOGFONT

 Return to chapter overview

The LOGFONT type contains font parameters.

Syntax

Type LOGFONT

        lfHeight As Long

        lfWidth As Long

        lfEscapement As Long

        lfOrientation As Long

        lfWeight As Long

        lfItalic As Byte

        lfUnderline As Byte

        lfStrikeOut As Byte

        lfCharSet As Byte

        lfOutPrecision As Byte

        lfClipPrecision As Byte

        lfQuality As Byte

        lfPitchAndFamily As Byte

        lfFaceName(LF_FACESIZE) As Byte

End Type

Parameters

lfHeight | Specifies height, in logical units, of the font's character cell or character. The character height value (also known as the em height) is the character cell height value minus the internal-leading value.
lfWidth | Specifies the average width, in logical units, of characters in the font. If lfWidth is zero, the aspect ratio of the device is matched against the digitization aspect ratio of the available fonts to find the closest match determined by the absolute value of the difference.
lfEscapement | Specifies the angle, in tenths of degrees, between the escapement vector and the x-axis of the device. The escapement vector is parallel to the base line of a row of text.
lfOrientation | Specifies the angle, in tenths of degrees, between each character's base line and the x-axis of the device.
lfWeight | Specifies the weight of the font in the range from 0 to 1000. For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used.
lfItalic | Specifies the italic font if it set to TRUE.
lfUnderline | Specifies the underlined font if it set to TRUE.
lfStrikeOut | Specifies the strikeout font if it set to TRUE.
lfCharSet | Specifies the character set.
lfOutPrecision | Specifies the output precision. The output precision defines how closely the output must match the requested font height, width, character orientation, escapement, pitch and font type.
lfClipPrecision | Specifies the clipping precision. The clipping precision defines how to clip characters that are partially outside the clipping region.
lfQuality | Specifies the output quality.
lfPitchAndFamily | Specifies the pitch and family of the font.
lfFaceName | A null-terminated string that specifies the typeface name of the font. The length of this string must not exceed 32 characters, including the terminating null character.

See Also

CADData | CADExtendedData | CADParam | CADPoint | POINTAPI | RECT | RECTAPI


POINTAPI

Navigation: Examples > Access to Entities > Visual Basic > Types >

POINTAPI

 Return to chapter overview

The POINTAPI type contains the coordinates of the 2D point.

Syntax

Type POINTAPI

    X As Long

    Y As Long

End Type

See Also

CADData | CADExtendedData | CADParam | CADPoint | LOGFONT | RECT | RECTAPI


RECT

Navigation: Examples > Access to Entities > Visual Basic > Types >

RECT

 Return to chapter overview

The RECT type contains rectangle coordinates.

Syntax

Private Type RECT

        Left As Long

        Top As Long

        Right As Long

        Bottom As Long

End Type

See Also

CADData | CADExtendedData | CADParam | CADPoint | LOGFONT | POINTAPI | RECTAPI


RECTAPI

Navigation: Examples > Access to Entities > Visual Basic > Types >

RECTAPI

 Return to chapter overview

The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle.

Syntax

Type RECTAPI

    TopLeft As POINTAPI

    BottomRight As POINTAPI

End Type

See Also

CADData | CADExtendedData | CADParam | CADPoint | LOGFONT | POINTAPI | RECT


Functions of CAD Importer SDK DLL Visual Basic version

Functions of CAD Importer DLL Visual Basic Example

Navigation: Examples > Access to Entities > Visual Basic >

Functions of CAD Importer DLL Visual Basic Example

Return to chapter overview

CAD DLL Visual Basic example includes the following functions:

·BeginViewport

·CADConvert

·CADCreate

·CADEnum

·CADGetBox

·CADGetSplineParams

·CADGetSplinePointsCount

·CADGetViewPortParams

·CADGetViewPortPointsCount

·CADGetSingleFromBytes

·ConvVariantToArray

·EndViewport

See Also

CAD DLL Import Visual Basic Variables | CAD DLL Import Visual Basic Example Types


BeginViewport

Navigation: Examples > Access to Entities > Visual Basic > Functions >

BeginViewport

 Return to chapter overview

The BeginViewport function creates a clipping region according to the VIEWPORT boundary before drawing the VIEWPORT and its contents.

Syntax

Public Sub BeginViewport(

 Param As CADParam,

 EData As CADData)

Parameters

Param | Structure application parameters.
EData | Structure with viewport data.

See Also

CADConvert | CADCreate | CADEnum | CADGetBox | CADGetSingleFromBytes | CADGetSplineParams | CADGetSplinePointsCount | CADGetViewPortParams | CADGetViewPortPointsCount | ConvVariantToArray | EndViewport


ConvVariantToArray

Navigation: Examples > Access to Entities > Visual Basic > Functions >

ConvVariantToArray

 Return to chapter overview

The ConvVariantToArray function converts array of variant variables into array of points.

Syntax

Private Sub ConvVariantToArray(

 VarArray As Variant,

 CadArray() As CADPOINT,

 ByVal Size As Long)

Parameters

VarArray | Source array of variant variables.
CadArray() | Destination array of CAD-points.
Size | Size of destination array.

See Also

CADConvert | CADCreate | CADEnum | CADGetBox | CADGetSingleFromBytes | CADGetSplineParams | CADGetSplinePointsCount | CADGetViewPortParams | CADGetViewPortPointsCount | EndViewport


EndViewport

Navigation: Examples > Access to Entities > Visual Basic > Functions >

EndViewport

 Return to chapter overview

The EndViewport function makes necessary actions after drawing the VIEWPORT and its contents.

Syntax

Public Sub EndViewport(

 Param As CADParam)

Parameters

Param

Contains application parameters.

See Also

CADConvert | CADCreate | CADEnum | CADGetBox | CADGetSingleFromBytes | CADGetSplineParams | CADGetSplinePointsCount | CADGetViewPortParams | CADGetViewPortPointsCount | ConvVariantToArray


Visual C++

Navigation: Examples > Access to Entities >

Visual C++

 Return to chapter overview

CAD DLL Import Visual C++ Example:

·Functions


Functions of CAD Importer SDK DLL VisualC++

CAD DLL Import Visual C++ Example Functions

Navigation: Examples > Access to Entities > Visual C++ >

CAD DLL Import Visual C++ Example Functions

 Return to chapter overview

CAD DLL Import Visual C++ example includes the following functions:

·GetPoint


getpoint_2

GetPoint

Navigation: Examples > Access to Entities > Visual C++ > Functions >

GetPoint

 Return to chapter overview

The GetPoint function converts CAD units to display pixels with the corresponding scale.

Syntax

POINT GetPoint(

  FPOINT Point,

  POINT offset,

  double Scale

)

Parameters

Point | Point for conversion.
offset | Offset for point.
Scale | Scale for point.

Return Value

The return value is a display point.

See Also

Functions


Export to CAD

Navigation: Examples >

Export to CAD

 Return to chapter overview

ExportDemo shows how to save metafiles to the DXF file format. The demo uses the ExportToDXF function.

The demo includes examples for the following programming languages:

·C++ Builder:

·Delphi:

·Visual Basic:

·Visual C++:

See Also

ExportToDXF | Viewer | Access to Entities


CAD DLL Versions Comparison

Navigation: »No topics above this level«

CAD DLL Versions Comparison

 Return to chapter overview

CAD DLL is available in three versions: Export, Import and Enterprise:

 | CAD DLL Enterprise | CAD DLL Import | CAD DLL Export
Reading | tick | tick | -
Access to entities | tick | tick | -
Export to raster formats: tiff / jpg / bmp etc. | tick | tick | -
Export to vector formats: dxf / pdf / plt / cgm etc. | tick | - | tick

See Also

Introduction | Supported Formats | What's new | Disclaim and Copyright/Trademark Information | Details


Disclaim and Copyright/Trademark Information

License Agreement

Navigation: »No topics above this level«

License Agreement

 Return to chapter overview

CAD DLL License Agreement and Limited Warranty

This Soft Gold License Agreement ("LICENSE AGREEMENT") is a legal agreement between you (either individual or an entity) and Soft Gold Limited ("SOFT GOLD") for CAD DLL ("SOFTWARE"). By installing, copying, accessing, or otherwise using the SOFTWARE, you agree to be bound by the terms of this LICENSE AGREEMENT. If you do not agree to the terms of this LICENSE AGREEMENT, you must cease using the SOFTWARE immediately.

1.OWNERSHIP

All copyrights to SOFTWARE and everything that comes with it are exclusively owned by the author - SOFT GOLD, CADSoftTools trademark.

This SOFTWARE is protected by copyright laws and international copyright treaties. At all times SOFT GOLD retains full title to the SOFTWARE. Subject to your acceptance of and accordance with the terms and conditions stated in this LICENSE AGREEMENT, you shall be granted a SOFTWARE license. Any previous agreement with SOFT GOLD is superseded by this LICENSE AGREEMENT.

2.UNREGISTERED VERSION

You may distribute the unregistered version of SOFTWARE freely, provided that all files are included and remain unmodified and that no extra files have been added to the package. You may not ask any money for the distribution.You may use the unregistered version of SOFTWARE free of charge for testing purposes, but if you want to use it for other purposes than testing - you have to register it with the author.

The unregistered version have some restrictions: Nagscreen, demo text when saving, copying and printing images.

3.GRANT OF LICENSE AND SCOPE OF USE

3.1. Grant of license.

Subject to the terms and conditions of this License, SOFT GOLD grants to you, if you are an individual, or, if you are an entity, one (1) designated person in your organization ("Named Developer") a personal, nonexclusive, and limited license to use the SOFTWARE solely to create your own application programs and other works ("Works"). You may install the SOFTWARE on a reasonable number of machines provided that the Named Developer is the only individual permitted to use the SOFTWARE. Subject to the other terms and conditions of this License, you may distribute your Works to others for production use. SOFT GOLD reserves the right to refuse granting a license without reasons explanation. All rights not specifically granted to you herein are retained by SOFT GOLD.

3.2 Multiple Licensed Copies.

You may purchase from SOFT GOLD or its authorized reseller additional licenses to permit multiple Named Developers to use the SOFTWARE (each, a "Named Developer License"). Such rights will be effective only when granted in writing by SOFT GOLD or its authorized reseller and are conditioned upon your payment of the applicable fees. If you purchase additional Named Developer Licenses for the SOFTWARE then you are granted for each Named Developer License the personal, nonexclusive, nontransferable and limited license to designate one individual in your organization as the Named Developer and permit such Named Developer to install and use the SOFTWARE solely as permitted under Section 3.1. In such case, the SOFTWARE may be used exclusively by the specifically designated Named Developer, subject to all the terms and conditions of this License. You agree that you will not designate more Named Developers than the number of Named Developer Licenses that SOFT GOLD or its authorized reseller has expressly granted to you and you will not allow the SOFTWARE to be used by any individuals other than the Named Developers designated by you from time to time. You agree to maintain accurate records of the Named Developer designated by you to use the SOFTWARE under each Named Developer License you hold.

3.3 Server licenses

3.3.1 On-Premises licenses

Subject to the terms and conditions of this License, SOFT GOLD grants to you, if you are an entity ("Licensee") a personal, nonexclusive and limited license, which allows to install and use the SOFTWARE on one (1) server or Web-server without end-users royalties. You may also make a reasonable number of copies of the SOFTWARE to backup devices such as hard disks, optical media, or tape and one (1) physical CD media backup copy of the SOFTWARE solely to replace the original copy provided to you if the original copy is damaged or destroyed. SOFT GOLD reserves the right to refuse granting a license without explanation of reasons. All rights not specifically granted to you herein are retained by SOFT GOLD.

The SOFTWARE may be used by all employees of Licensee at facilities governed by Licensee in connection with the server or Web-server. Licensee must use commercially reasonable efforts to restrict network or any other access to the SOFTWARE by anyone outside of Licensee's facilities who is not authorized to use the SOFTWARE.

3.3.2 Web-licenses

Terms and conditions of granting a web-license shall be discussed with SOFT GOLD.

3.3.3 Cloud licenses

Terms and conditions of granting a cloud license shall be discussed with SOFT GOLD.

3.4 Special licenses

If necessary Soft Gold Ltd is entitled to grant you a special license which conditions are preliminarily discussed by the parties and don’t contradict conditions of standard license.

4.DISCLAIMER OF WARRANTY

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. BECAUSE OF THE VARIOUS HARDWARE AND SOFTWARE ENVIRONMENTS INTO WHICH SOFTWARE MAY BE PUT, NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.YOU ASSUME THE WHOLE RISK CONCERNING QUALITY AND WORK OF SOFTWARE.IF THE SOFTWARE PROVES TO BE DEFECTIVE YOU ASSUME COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

Good data processing procedure dictates that any program be thoroughly tested with non-critical data before relying on it. The user must assume the entire risk of using the program.

You may not alter this software in any way, including changing or removing any windows.

5.AGREEMENT PERTAINING TO THE RELEASE OF SOURCE CODE

5.1 Recipient WILL NOT distribute the source. Particularly this includes such files as .dcu, .dfm, .pas and others which SOFTWARE has provided.

5.2 SOFT GOLD reserves the right to change any part of the source in future versions of the product. These changes may include removal of classes, properties and methods or creation of new classes, properties and methods.

6. ENGAGING IN ANY OF THE ACTIVITIES LISTED BELOW WILL TERMINATE THE SOFTWARE LICENSE. IN ADDITION TO SOFTWARE LICENSE TERMINATION, SOFTWARE MAY PURSUE CRIMINAL,CIVIL, OR ANY OTHER AVAILABLE REMEDIES.

6.1. Removal of proprietary notices, labels or marks from the SOFTWARE or SOFTWARE Documentation.

6.2. Utilize the SOFTWARE for the creation of products (whether it be freeware, shareware or a commercial product) which competes directly or indirectly with software published at www.cadsofttools.com, www.cadsofttools.ru, www.cadsofttools.de

6.3. Disclose the SOFTWARE to any person or party, involved in the creation of products which competes directly or indirectly with software published at www.cadsofttools.com.

6.4. Violation of the section 5 of this LICENSE AGREEMENT

7. LIMITATIONS OF DAMAGES

SOFT GOLD LTD SHALL NOT BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING DAMAGES FOR LOSS OF BUSINESS, LOSS OF PROFITS, OR THE LIKE), WHETHER BASED ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR OTHERWISE, EVEN IF SOFT GOLD LTD OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND EVEN IF A REMEDY SET FORTH HEREIN IS FOUND TO HAVE FAILED OF ITS ESSENTIAL PURPOSE.

Thank you for using CAD DLL!

Soft Gold Ltd., 2015

Address:

Russia, 300057 Tula, Malye Gonchary 14.

Tel: +1 (800) 469-9789

World Wide Web: http://www.cadsofttools.com

E-mail: info@cadsofttools.com

See Also

Introduction | CAD DLL Versions Comparison | Details


Details

Navigation: »No topics above this level«

Details

 Return to chapter overview

The following libraries that were made by exterior developers are used in this program:

·GraphicEx by Dipl. Ing. Mike Lischke www.delphi-gems.com

·Library for animated GIF files support by Anders Melander, anders@melander.dk

·PASZLIB 1.0 by Jacques Nomssi Nzali: http://www.nomssi.de/paszlib/paszlib.html

See Also

Introduction | CAD DLL Versions Comparison | Disclaim and Copyright/Trademark Information


sample

Navigation: »No topics above this level«

sample

 Return to chapter overview

User Interface Design and Development > Windows Management > Windows User Interface > Window Classes Functions > SetWindowLongPtr

minus Collapse All Language: C/C++

WINDOWS API

SetWindowLongPtr

The SetWindowLongPtr function changes an attribute of the specified window. The function also sets a value at the specified offset in the extra window memory. This function supersedes the SetWindowLong function. To write code that is compatible with both 32-bit and 64-bit versions of Microsoft® Windows®, use SetWindowLongPtr.

Syntax

Copy Code

LONG_PTR SetWindowLongPtr(

 HWND hWnd,

 int nIndex,

 LONG_PTR dwNewLong

);

minus Parameters

hWnd

[in] Handle to the window and, indirectly, the class to which the window belongs. The SetWindowLongPtr function fails if the window specified by the hWnd parameter does not belong to the same process as the calling thread.

nIndex

[in] Specifies the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus the size of an integer. To set any other value, specify one of the following values.

GWL_EXSTYLE

Sets a new extended window style. For more information, see CreateWindowEx.

GWL_STYLE

Sets a new window style.

GWLP_WNDPROC

Sets a new address for the window procedure.

GWLP_HINSTANCE

Sets a new application instance handle.

GWLP_ID

Sets a new identifier of the window.

GWLP_USERDATA

Sets the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero.

The following values are also available when the hWnd parameter identifies a dialog box.

DWLP_DLGPROC

Sets the new pointer to the dialog box procedure.

DWLP_MSGRESULT

Sets the return value of a message processed in the dialog box procedure.

DWLP_USER

Sets new extra information that is private to the application, such as handles or pointers.

dwNewLong

[in] Specifies the replacement value.

minus Return Value

If the function succeeds, the return value is the previous value of the specified offset.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

If the previous value is zero and the function succeeds, the return value is zero, but the function does not clear the last error information. To determine success or failure, clear the last error information by calling SetLastError(0), then call SetWindowLongPtr. Function failure will be indicated by a return value of zero and a GetLastError result that is nonzero.

minus Example Code

Copy Code

case WM_CREATE:

// move the AllWin32StatBoxThreadedGUI class pointer into the

// userdata of the window.

lpCreateParams = (MDICREATESTRUCT *)((CREATESTRUCT *)lParam->lpCreateParams;

::SetWindowLongPtr(hwnd, GWLP_USERDATA, static_cast <LONG_PTR>(lpCreateParams->lParam));

minus Remarks

Certain window data is cached, so changes you make using SetWindowLongPtr will not take effect until you call the SetWindowPos function.

If you use SetWindowLongPtr with the GWLP_WNDPROC index to replace the window procedure, the window procedure must conform to the guidelines specified in the description of the WindowProc callback function.

If you use SetWindowLongPtr with the DWLP_MSGRESULT index to set the return value for a message processed by a dialog box procedure, the dialog box procedure should return TRUE directly afterwards. Otherwise, if you call any function that results in your dialog box procedure receiving a window message, the nested window message could overwrite the return value you set by using DWLP_MSGRESULT.

Calling SetWindowLongPtr with the GWLP_WNDPROC index creates a subclass of the window class used to create the window. An application can subclass a system class, but should not subclass a window class created by another process. The SetWindowLongPtr function creates the window subclass by changing the window procedure associated with a particular window class, causing the system to call the new window procedure instead of the previous one. An application must pass any messages not processed by the new window procedure to the previous window procedure by calling CallWindowProc. This allows the application to create a chain of window procedures.

Reserve extra window memory by specifying a nonzero value in the cbWndExtra member of the WNDCLASSEX structure used with the RegisterClassEx function.

Do not call SetWindowLongPtr with the GWLP_HWNDPARENT index to change the parent of a child window. Instead, use the SetParent function.

If the window has a class style of CS_CLASSDC or CS_PARENTDC, do not set the extended window styles WS_EX_COMPOSITED or WS_EX_LAYERED.

note Note

ASCIIEncoding supports only the Unicode character values between U+0000 and U+007F. Therefore, UTF8Encoding, UnicodeEncoding, and UTF32Encoding are better suited for globalized applications.

minus Function Information

Header | Declared in Winuser.h, include Windows.h
Import library | User32.lib
Minimum operating systems | Windows 95, Windows NT 3.1
Unicode | Implemented as Unicode and ANSI versions on Windows NT, Windows 2000, Windows XP

minus See Also

Window Class Overview | CallWindowProc | GetWindowLongPtr | RegisterClassEx | SetParent | WindowProc | WNDCLASSEX

© 2003-2007 Soft Gold Ltd.

test