ZwCloud2D API Documentation

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.

Tokens
101.1K
Snippets
664
Records
796
Agent score
50%

What's inside ZwCloud2D

  1. Overview of ZwDbEntityProto

    ZwDbEntityProto is the base class for all CAD drawing entities. It defines common properties and characteristics shared by all CAD entities, including display properties, layer attributes, and extended data (XData). Many specific entity types (such as ZwDbLine, ZwDbCircle, ZwDbPolyline, etc.) inherit from this class.
    const instance = new ZwCloud2D.ZwDataDefinition.ZwDbEntity.ZwDbEntityProto();
  2. Overview of ZwDataDefinition Namespace

    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.
  3. Overview of Cloud2D API Integration Options

    Cloud2D provides multiple API interfaces to support professional applications and industry ecosystem expansion. Available integration methods include Restful APIs and JavaScript APIs, with support for command extensions.
  4. Use the CommentListItem type for comment data

    The 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)
    }
  5. Use the CommentAttachment type for comment image attachments

    The 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>;
    }