Overview of ZWCAD Cloud SDK
The ZWCAD Cloud SDK is a secondary development kit used to implement online browsing of DWG, DXF, and DWF drawing files.
website·Indexed 34 days ago
https://cloud2d.zwsoft.cn/doc/Developer documentation for the ZwCloud2D API, featuring guides for CAD drawing operations such as creating lines, polylines, circles, and arcs, as well as advanced presentation features including electronic signatures, file comparison, and custom comment panels. Includes detailed class references for ZwDbEntity types like ZwDbLine, ZwDbPolyline, and ZwDbHatch, and geometry types such as Point3D and Vector3D.
const instance = new ZwCloud2D.ZwDataDefinition.ZwDbEntity.ZwDbEntityProto();The ZwDataDefinition namespace provides data structures and definitions for CAD data management, including layer information and geometry. It contains the following sub-namespaces and classes:
Namespaces:
ZwDbEntity: Entity-related definitions.ZwGeometry: Geometry-related definitions.Classes:
ZwDbLayerInfo: Layer information.ZwDbLayerTable: Layer table management.ZwDbLayerTableRecord: Represents a CAD layer table record.ZwDbLeader class represents a leader annotation entity in CAD drawing. It defines the properties and behaviors used to add annotation markers with leader lines to a drawing.CommentListItem object defines the full data structure for a single comment in the comment system. It includes metadata about the creator, the location of the comment within a drawing (document and layout), the content, and threading information via parentId and replyList.interface CommentListItem {
id: string; // Unique ID of the comment record
docId: string; // ID of the drawing where the comment is posted
handleId: string; // ID of the layout within the drawing where the comment is posted
creator: string; // Username of the creator
createTime: number; // Creation timestamp
createBy: string; // User ID of the creator
content: string; // Comment content
parentId?: string; // ID of the parent comment being replied to (optional)
isTransferred?: boolean | string; // Indicates if the comment was transferred (e.g., during file comparison)
commentStatus?: CommentStatus; // Status: 0 (Unreplied), 1 (Replied/Pending Confirmation), 2 (Confirmed)
updateTime?: number; // Update timestamp (optional)
avatarUrl?: string; // URL to creator's avatar (optional)
realContent?: string; // Plain text version of the comment content (optional)
atUserIds?: string; // IDs of users mentioned via @ (optional)
atUserList?: object[]; // List of users mentioned via @ (optional)
mark?: string; // Special markers in the comment (optional)
layoutName?: string; // Name of the layout (optional)
level?: number; // Nesting level of the comment (optional)
replyList?: CommentListItem[]; // List of replies to this comment (optional)
}ZwEditor namespace provides the core API for managing a CAD viewer, including configuration for the user interface, rendering engine, command availability, and event handling. It contains specialized sub-namespaces for database management (ZwDbDatabase) and rendering (ZwRenderer).CommentAttachment object defines the structure for image attachments within the comment system. It contains metadata about the file and the raw binary data.interface CommentAttachment {
/** Unique identifier for the attachment */
attachmentId: string;
/** The type of attachment, specifically "image" */
type: "image";
/** Attachment data in ArrayBuffer format */
data: ArrayBuffer;
/** The filename of the attachment */
name: string;
/** Optional method to download the original thumbnail file */
downloadThumbnailOriginalFile?: () => Promise<ArrayBuffer>;
}getUserInfo function to retrieve detailed information about the current SDK user.ZwDataProcessor.getUserInfo();ZwDbLayerInfo class is used to store and manage metadata for a specific layer in the CAD environment. It contains properties related to the layer's visual appearance (color, line weight, transparency), state (hidden, frozen, locked), and identification (name, handle, index).ZwDbLayerTableRecord class represents a CAD layer table record. It is used to manage and store layer information within a CAD drawing, with each record corresponding to the attribute data of a single layer.