### Example: Get and Save BOM Template File Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.getbomtemplatefile.html Example of how to get a specified BOM template file and then save it. This code is part of the BETA API. ```javascript // 获取指定模板的文件 const templateFile = await eda.pcb_ManufactureData.getBomTemplateFile('MyCustomTemplate'); if (templateFile) { await eda.sys_FileSystem.saveFile(templateFile); } ``` -------------------------------- ### Pad Shape Configuration Examples Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.tpcb_primitivepadshape.html Examples of how to structure the array for different pad shape types. ```typescript [EPCB_PrimitivePadShapeType.ELLIPSE, width, height] ``` ```typescript [EPCB_PrimitivePadShapeType.RECTANGLE, width, height, round] ``` ```typescript [EPCB_PrimitivePadShapeType.REGULAR_POLYGON, diameter, numberOfSides] ``` ```typescript [EPCB_PrimitivePadShapeType.POLYLINE_COMPLEX_POLYGON, complexPolygon] ``` -------------------------------- ### Example Usage of deleteBomTemplate Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.deletebomtemplate.html This example demonstrates how to call the deleteBomTemplate method and handle the success or failure response. It logs a message to the console indicating the outcome. ```javascript // 删除指定的 BOM 模板 const success = await eda.pcb_ManufactureData.deleteBomTemplate('MyCustomTemplate'); if (success) { console.log('BOM 模板删除成功'); } else { console.log('删除失败,可能是默认模板或模板不存在'); } ``` -------------------------------- ### 添加 "exportFilePath" 配置项解决 "Failed to get 'downloads' path" 错误 Source: https://prodocs.lceda.cn/cn/faq/client/index.html 当遇到 "Failed to get 'downloads' path" 错误时,可以通过在 "文档-lceda-rpo-config.json" 文件中添加 "exportFilePath" 配置项来解决。重启软件后生效。 ```json "exportFilePath": "C:\\Users\\win10\\Downloads", ``` -------------------------------- ### Example Reconciler Instance Structure Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.isys_reactcomponentizationdialogreconcilerinstance.html This example shows the structure of a reconciler instance, including its default export and constants for event priorities and root types. Ensure these constants are correctly imported if using this structure. ```typescript const ReconcilerInstance = { default: Reconciler, constants: { ContinuousEventPriority, DiscreteEventPriority, DefaultEventPriority, ConcurrentRoot, }, }; ``` -------------------------------- ### GET SYS_Storage.getExtensionAllUserConfigs Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.sys_storage.getextensionalluserconfigs.html Retrieves all user configurations associated with the current extension. ```APIDOC ## SYS_Storage.getExtensionAllUserConfigs() ### Description Retrieves all user configuration settings for the current extension. ### Method Method Call ### Signature `getExtensionAllUserConfigs(): { [key: string]: any; }` ### Returns - **Object** ({ [key: string]: any; }) - An object containing all user configuration information for the extension. ### Remarks - This method is only valid within an extension environment. Calling this method in an independent script environment will throw an Error. ``` -------------------------------- ### Upload BOM Template File Example Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.uploadbomtemplatefile.html Demonstrates reading a file from the file system and uploading it as a BOM template. ```javascript // 从文件选择器读取模板文件 const templateFile = await eda.sys_FileSystem.openReadFileDialog('.xlsx'); if (templateFile) { const templateName = await eda.pcb_ManufactureData.uploadBomTemplateFile( templateFile, 'MyCustomTemplate' ); if (templateName) { console.log('模板上传成功:', templateName); } } ``` -------------------------------- ### Get Arc Start X-Coordinate Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitivearc.getstate_startx.html Retrieves the starting X-coordinate value for an arc primitive. ```typescript getState_StartX(): number; ``` -------------------------------- ### Retrieve and Save PCB Information File Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.getpcbinfofile.html Example demonstrating how to fetch a PCB information file by name and save it to the local file system. ```javascript const pcbInfoFile = await eda.pcb_ManufactureData.getPcbInfoFile('Board_Information'); if (pcbInfoFile) { await eda.sys_FileSystem.saveFile(pcbInfoFile); } ``` -------------------------------- ### Retrieve and save PADS file Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.getpadsfile.html Example showing how to fetch a PADS file by name and save it to the local file system. ```javascript // 获取 PADS 格式文件 const padsFile = await eda.pcb_ManufactureData.getPadsFile('Converted_To_PADS'); if (padsFile) { await eda.sys_FileSystem.saveFile(padsFile); } ``` -------------------------------- ### Get Arc Start Y-Coordinate Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitivearc.getstate_starty.html Retrieves the Y-coordinate of the arc's starting position as a number. ```typescript getState_StartY(): number; ``` -------------------------------- ### GET getState_StartX Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.isch_primitivearc.getstate_startx.html Retrieves the starting X coordinate of the arc primitive. ```APIDOC ## GET ISCH_PrimitiveArc.getState_StartX() ### Description Retrieves the starting X coordinate of the arc primitive. ### Method GET ### Endpoint ISCH_PrimitiveArc.getState_StartX() ### Response #### Success Response (200) - **value** (number) - The starting X coordinate of the arc. ``` -------------------------------- ### Examples of Generating and Saving Gerber Files Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.getgerberfile.html Demonstrates how to generate Gerber files with default settings, save them to the local file system, and perform custom exports with specific layers and objects. ```javascript // 导出默认的 Gerber 文件 const gerberFile = await eda.pcb_ManufactureData.getGerberFile('MyBoard_Gerber'); if (gerberFile) { console.log('Gerber 文件已生成:', gerberFile); } // 导出并保存到本地 const gerberFile = await eda.pcb_ManufactureData.getGerberFile( 'MyBoard_Gerber', false, ESYS_Unit.MILLIMETER, { integerNumber: 2, decimalNumber: 6 } ); if (gerberFile) { await eda.sys_FileSystem.saveFile(gerberFile,'Gerber.zip'); } // 自定义导出层和对象 const gerberFile = await eda.pcb_ManufactureData.getGerberFile( 'Custom_Gerber', false, ESYS_Unit.INCH, { integerNumber: 3, decimalNumber: 5 }, { metallicDrillingInformation: true, nonMetallicDrillingInformation: true, drillTable: false, flyingProbeTestingFile: false }, [{ layerId: 1, isMirror: false }, { layerId: 2, isMirror: false }, { layerId: 11, isMirror: false }], ['Pad', 'Via', 'Track', 'BoardOutline'] ); ``` -------------------------------- ### 重命名 config.json 文件解决客户端启动问题 Source: https://prodocs.lceda.cn/cn/faq/client 当客户端配置文件损坏导致启动失败时,可尝试将 `config.json` 文件重命名(例如 `config1.json`)来解决。此方法适用于配置文件损坏的症状。 ```bash mv config.json config1.json ``` -------------------------------- ### GET IPCB_PrimitiveArc.getState_StartY() Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitivearc.getstate_starty.html Retrieves the starting Y-coordinate value for an arc primitive. ```APIDOC ## GET IPCB_PrimitiveArc.getState_StartY() ### Description Retrieves the starting Y-coordinate of the arc primitive. ### Method GET ### Endpoint IPCB_PrimitiveArc.getState_StartY() ### Response #### Success Response (200) - **value** (number) - The starting Y-coordinate of the arc. ``` -------------------------------- ### GET IPCB_PrimitiveArc.getState_StartX() Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitivearc.getstate_startx.html Retrieves the starting X coordinate of the arc primitive. ```APIDOC ## GET IPCB_PrimitiveArc.getState_StartX() ### Description Retrieves the current starting X coordinate value of the arc primitive. ### Method GET ### Endpoint IPCB_PrimitiveArc.getState_StartX() ### Response #### Success Response (200) - **return** (number) - The starting X coordinate of the arc. ``` -------------------------------- ### Retrieve and Log BOM Templates Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.getbomtemplates.html Example usage showing how to fetch and iterate through the list of available BOM templates. ```javascript // 获取所有可用的 BOM 模板 const templates = await eda.pcb_ManufactureData.getBomTemplates(); console.log('可用的 BOM 模板:', templates); templates.forEach((template, index) => { console.log(`${index + 1}. ${template}`); }); ``` -------------------------------- ### Get Interactive Mode State Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitivearc.getstate_interactivemode.html Call this method to retrieve the current interactive mode of the EPCB_PrimitiveArcInteractiveMode. No setup is required. ```typescript getState_InteractiveMode(): EPCB_PrimitiveArcInteractiveMode; ``` -------------------------------- ### Get Component Layer Status - TypeScript Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitivecomponent.getstate_layer.html Call this method to retrieve the `TPCB_LayersOfComponent` object representing the layer status of the component. No specific setup is required beyond having an instance of the component. ```typescript getState_Layer(): TPCB_LayersOfComponent; ``` -------------------------------- ### Retrieve and Save IDX File Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.getidxfile.html Example demonstrating how to fetch an IDX file by name and save it to the local file system. ```javascript const idxFile = await eda.pcb_ManufactureData.getIdxFile('Design_Exchange'); if (idxFile) { await eda.sys_FileSystem.saveFile(idxFile); } ``` -------------------------------- ### Export IPC-D-356A File Example Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.getipcd356afile.html Demonstrates how to retrieve an IPC-D-356A file by name and save it to the local file system. ```javascript const ipcFile = await eda.pcb_ManufactureData.getIpcD356AFile('IPC_D356A_Test'); if (ipcFile) { await eda.sys_FileSystem.saveFile(ipcFile); } ``` -------------------------------- ### Set Start Y Coordinate for IPCB_PrimitiveLine Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitiveline.setstate_starty.html Sets the starting Y position for the line primitive. This method returns the IPCB_PrimitiveLine object itself. ```typescript setState_StartY(startY: number): IPCB_PrimitiveLine; ``` -------------------------------- ### Get Property Designator Status Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitivecomponent.getstate_designator.html Call this method to get the designator status of a property. It returns a string or undefined. ```typescript getState_Designator(): string | undefined; ``` -------------------------------- ### 创建 trace 文件夹以输出日志 Source: https://prodocs.lceda.cn/cn/faq/client 在专业版中,于 `LCEDA-PRO` 文件夹下的 `logs` 文件夹内创建 `trace` 文件夹,可用于输出客户端启动日志,便于技术支持排查问题。 ```bash mkdir trace ``` -------------------------------- ### Set Start X Coordinate for IPCB_PrimitiveLine Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitiveline.setstate_startx.html Sets the starting X coordinate for the line primitive. This method returns the IPCB_PrimitiveLine object itself. ```typescript setState_StartX(startX: number): IPCB_PrimitiveLine; ``` -------------------------------- ### Create Project Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.dmt_project.html Creates a new project. This method is currently in BETA. ```APIDOC ## POST /api/projects/create ### Description Creates a new project with the specified details. ### Method POST ### Endpoint /api/projects/create ### Parameters #### Request Body - **projectFriendlyName** (string) - Required - The user-friendly name for the project. - **projectName** (string) - Required - The internal name for the project. - **teamUuid** (string) - Required - The UUID of the team the project belongs to. - **folderUuid** (string) - Required - The UUID of the folder where the project will be created. - **description** (string) - Optional - A description for the project. - **collaborationMode** (string) - Optional - The collaboration mode for the project. ``` -------------------------------- ### 重命名配置文件解决客户端无反应问题 Source: https://prodocs.lceda.cn/cn/faq/client/index.html 当双击客户端无反应时,可以尝试删除或重命名安装路径下的 "config.json" 文件(或 "文档/LCEDA-Pro/config.json"),然后重新启动客户端。这有助于解决配置文件损坏导致的问题。 ```bash 将文件名改为LCEDA-pro1,然后再双击打开客户端就可以了 ``` ```bash 将文档/LCEDA-Pro/config.json,重命名成别的,比如 config1.json,然后再启动客户端 ``` -------------------------------- ### Set Starting Y Position - TypeScript Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitivearc.setstate_starty.html Use this method to define the Y-coordinate for the start of an arc. The method returns the `IPCB_PrimitiveArc` object for chaining. ```typescript setState_StartY(startY: number): IPCB_PrimitiveArc; ``` -------------------------------- ### Set Starting Point Y for ISCH_PrimitiveArc Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.isch_primitivearc.setstate_starty.html Use this method to set the Y-coordinate for the starting point of a primitive arc. This API is in BETA and subject to change. ```typescript setState_StartY(startY: number): ISCH_PrimitiveArc; ``` -------------------------------- ### LIB_Device.create() Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.lib_device.create.html Creates a new device in the library. This API is currently in BETA. ```APIDOC ## LIB_Device.create() ### Description Creates a new device in the library. This API is currently in BETA and subject to change. ### Method create ### Endpoint Not applicable (this is a method call, not an HTTP endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **libraryUuid** (string) - Required - The UUID of the library where the device will be created. This can be obtained using interfaces within LIB_LibrariesList. - **deviceName** (string) - Required - The name of the device. - **classification** (ILIB_ClassificationIndex | Array) - Optional - The classification for the device. - **association** ({ symbolType?: ELIB_SymbolType; symbolUuid?: string; symbol?: { uuid: string; libraryUuid: string; }; footprintUuid?: string; footprint?: { uuid: string; libraryUuid: string; }; model3D?: { uuid: string; libraryUuid: string; }; imageData?: File | Blob; }) - Optional - Associations for the device, including symbol, footprint, and 3D model. If `symbolType` is specified, a new symbol will be created. If no symbol is created and no symbol association is provided, the device cannot be created. - **description** (string) - Optional - A description for the device. - **property** (ILIB_DeviceExtendPropertyItem) - Optional - Additional properties for the device. Only `designator`, `addIntoBom`, and `addIntoPcb` have default values. ### Request Example ```typescript // Example usage (assuming necessary library and types are imported) const deviceUuid = await LIB_Device.create( "your-library-uuid", "MyNewDevice", ["Category1", "SubCategoryA"], { symbolType: ELIB_SymbolType.SMT, symbol: { uuid: "symbol-uuid", libraryUuid: "your-library-uuid" }, footprint: { uuid: "footprint-uuid", libraryUuid: "your-library-uuid" }, model3D: { uuid: "model3d-uuid", libraryUuid: "your-library-uuid" }, imageData: fileObjectOrBlob }, "This is a description for the new device.", { designator: "R1", addIntoBom: true, addIntoPcb: true } // Example property ); console.log("Created device UUID:", deviceUuid); ``` ### Response #### Success Response (200) - **string | undefined** - The UUID of the created device, or undefined if creation failed. ``` -------------------------------- ### Set Start X Position for IPCB_PrimitiveArc Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitivearc.setstate_startx.html Use this method to set the starting X-coordinate of the arc. The method returns the `IPCB_PrimitiveArc` object for chaining. ```typescript setState_StartX(startX: number): IPCB_PrimitiveArc; ``` -------------------------------- ### Save Test Point Report to Local File System Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.gettestpointfile.html Example demonstrating how to retrieve a test point report and save it locally using the SYS_FileSystem interface. ```javascript // 保存测试点报告文件到本地 const testPointFile = await eda.pcb_ManufactureData.getTestPointFile('Test_Point_Report', 'xlsx'); if (testPointFile) { await eda.sys_FileSystem.saveFile(testPointFile); } ``` -------------------------------- ### PCB Component and Primitive Connections Source: https://prodocs.lceda.cn/cn/format/pcb/primitive Example showing how PCB components and primitives are defined and connected. It includes DOCTYPE, COMPONENT, VIA, PAD, and CONNECT definitions for a PCB context. ```json ["DOCTYPE", "PCB", "1.0"] ["COMPONENT", "e13", 5, 1, ...] ["VIA", "e13e20", 0, "GND", "asdf", .... ["PAD", "e13e25", 1, "GND", 0, "1", .... ["CONNECT", "e13", ["e13e20", "e13e25"]] ``` -------------------------------- ### Get Network Length - TypeScript Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_net.getnetlength.html Use this method to get the length of a specific network by its name. Returns undefined if the network does not exist, or 0 if it has no length. ```typescript getNetLength(net: string): Promise; ``` -------------------------------- ### Exporting Pick and Place Files Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.getpickandplacefile.html Demonstrates how to retrieve a coordinate file in Excel format using millimeter units and save it locally. ```javascript // 导出毫米单位的 Excel 格式坐标文件 const pnpFile = await eda.pcb_ManufactureData.getPickAndPlaceFile( 'PickAndPlace', 'xlsx', ESYS_Unit.MILLIMETER ); if (pnpFile) { await eda.sys_FileSystem.saveFile(pnpFile); } ``` -------------------------------- ### Get Ratline Calculation Status Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_document.getcalculatingratlinestatus.html Call this method to get the current status of the ratline calculation. It returns a Promise that resolves to an enum indicating the status. ```typescript getCalculatingRatlineStatus(): Promise; ``` -------------------------------- ### Exporting Netlist Files in Different Formats Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.getnetlistfile.html Demonstrates how to export netlists for JLCEDA Pro, Altium Designer, and PADS, including an example of saving the file locally. ```javascript // 导出嘉立创 EDA 专业版格式网表 const netlistFile = await eda.pcb_ManufactureData.getNetlistFile( 'MyNetlist', ESYS_NetlistType.JLCEDA_PRO ); if (netlistFile) { await eda.sys_FileSystem.saveFile(netlistFile); } // 导出 Altium Designer 格式 const altiumNetlist = await eda.pcb_ManufactureData.getNetlistFile( 'Netlist_Altium', ESYS_NetlistType.ALTIUM_DESIGNER ); // 导出 PADS 格式 const padsNetlist = await eda.pcb_ManufactureData.getNetlistFile( 'Netlist_PADS', ESYS_NetlistType.PADS ); ``` -------------------------------- ### Exporting a PDF File Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.getpdffile.html Example demonstrating how to call getPdfFile and save the resulting file using the system file system API. ```javascript // 导出多页 PDF(包含所有图层) const pdfFile = await eda.pcb_ManufactureData.getPdfFile( 'PCB_Documentation', EPCB_PdfOutputMethod.MULTI_PAGE_PDF ); if (pdfFile) { await eda.sys_FileSystem.saveFile(pdfFile); } ``` -------------------------------- ### Set Start X Coordinate for ISCH_PrimitiveArc Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.isch_primitivearc.setstate_startx.html Updates the starting X coordinate of the arc primitive. This method returns the ISCH_PrimitiveArc object to allow for method chaining. ```typescript setState_StartX(startX: number): ISCH_PrimitiveArc; ``` -------------------------------- ### SYS_ClientUrl.request() Method Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.sys_clienturl.request.html Initiates an instant request with specified URL, method, data, and options. ```APIDOC ## POST /websites/prodocs_lceda_cn_cn/request ### Description Initiates an instant request to a specified URL with optional method, data, and options. ### Method POST ### Endpoint /websites/prodocs_lceda_cn_cn/request ### Parameters #### Query Parameters - **url** (string) - Required - The URL to which the request is sent. - **method** ('GET' | 'POST' | 'HEAD' | 'PUT' | 'DELETE' | 'PATCH') - Optional - The HTTP method for the request. Defaults to 'GET' if not provided. - **data** (string | Blob | FormData | URLSearchParams) - Optional - The data to be sent with the request. Ignored if method is 'HEAD' or 'GET'. - **options** ({ headers?: { [header: string]: any; }; integrity?: string; }) - Optional - Additional request options, including headers and integrity. - **succeedCallFn** ((data: Response) => void | Promise) - Optional - A callback function to be executed upon successful request completion. ### Request Example ```json { "url": "https://example.com/api/data", "method": "POST", "data": "key=value", "options": { "headers": { "Content-Type": "application/x-www-form-urlencoded" } } } ``` ### Response #### Success Response (200) - **Response** (Response) - The Fetch API Response object. #### Response Example ```json { "example": "Response object from Fetch API" } ``` ### Remarks - Cross-Origin Resource Sharing (CORS) must be enabled on the requested site. - The user must have the extension's external interaction permission enabled; otherwise, the interface will always throw an Error. ``` -------------------------------- ### Get Wire Primitive Signature Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.sch_primitivewire.get_1.html This is the TypeScript signature for the get method. It takes an array of primitive IDs and returns a Promise that resolves to an array of ISCH_PrimitiveWire objects. ```typescript get(primitiveIds: Array): Promise>; ``` -------------------------------- ### 修改 DNS 服务器解决登录二维码加载问题 Source: https://prodocs.lceda.cn/cn/faq/client 当二维码加载不出来时,可以尝试修改电脑的 DNS 服务器为 `114.114.114.114` 来解决。此操作需在网络连接属性中进行。 ```bash 设置首选DNS服务器为 114.114.114.114 ``` -------------------------------- ### Get Via Primitive Signature Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_primitivevia.get_1.html This is the TypeScript signature for the get method. It accepts an array of primitive IDs and returns a Promise resolving to an array of IPCB_PrimitiveVia objects. ```typescript get(primitiveIds: Array): Promise>; ``` -------------------------------- ### Retrieve and Save Auto Layout JSON Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.getautolayoutjsonfile.html Example demonstrating how to fetch the auto layout JSON file and save it to the local file system. ```javascript const autoLayoutJson = await eda.pcb_ManufactureData.getAutoLayoutJsonFile('AutoLayout_Json'); if (autoLayoutJson) { await eda.sys_FileSystem.saveFile(autoLayoutJson); } ``` -------------------------------- ### Get Bus Primitive Signature Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.sch_primitivebus.get_1.html This is the TypeScript signature for the get method. It takes an array of strings (primitive IDs) and returns a Promise that resolves to an array of ISCH_PrimitiveBus objects. ```typescript get(primitiveIds: Array): Promise>; ``` -------------------------------- ### Get PCB Primitive Pad Signature Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_primitivepad.get_1.html This is the TypeScript signature for the get method. It takes an array of primitive IDs and returns a Promise resolving to an array of PCB_PrimitivePad objects. ```typescript get(primitiveIds: Array): Promise>; ``` -------------------------------- ### PCB_PrimitivePad.create() Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_primitivepad.create.html Creates a PCB pad with specified properties. ```APIDOC ## PCB_PrimitivePad.create() ### Description Creates a PCB pad. ### Method POST (Implied, as it's a creation operation) ### Endpoint /websites/prodocs_lceda_cn_cn/PCB_PrimitivePad/create ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **layer** (TPCB_LayersOfPad) - Required - The layer for the pad. - **padNumber** (string) - Required - The pad number. - **x** (number) - Required - The X coordinate of the pad's position. - **y** (number) - Required - The Y coordinate of the pad's position. - **rotation** (number) - Optional - The rotation angle of the pad. - **pad** (TPCB_PrimitivePadShape) - Optional - The shape of the pad. Required before special pad shapes are implemented. - **net** (string) - Optional - The net name. - **hole** (TPCB_PrimitivePadHole | null) - Optional - The hole definition. `null` indicates no hole. - **holeOffsetX** (number) - Optional - The X offset for the hole. - **holeOffsetY** (number) - Optional - The Y offset for the hole. - **holeRotation** (number) - Optional - The rotation angle of the hole relative to the pad. - **metallization** (boolean) - Optional - Specifies if the hole wall is metallized. - **padType** (EPCB_PrimitivePadType) - Optional - The type of the pad. - **specialPad** (TPCB_PrimitiveSpecialPadShape) - Optional - The special pad shape. Currently not implemented, do not use. - **solderMaskAndPasteMaskExpansion** (IPCB_PrimitiveSolderMaskAndPasteMaskExpansion | null) - Optional - Solder mask and paste mask expansion. `null` means rules are followed. - **heatWelding** (IPCB_PrimitivePadHeatWelding | null) - Optional - Heat welding optimization parameters. - **primitiveLock** (boolean) - Optional - Whether to lock the primitive. ### Request Example ```json { "layer": "TOPLAYER", "padNumber": "1", "x": 100.0, "y": 150.0, "rotation": 90, "pad": {"shape": "RECT", "width": 50, "height": 50}, "net": "GND", "hole": {"shape": "ROUND", "diameter": 20}, "holeOffsetX": 5, "holeOffsetY": 5, "holeRotation": 45, "metallization": true, "padType": "SMT", "solderMaskAndPasteMaskExpansion": null, "heatWelding": null, "primitiveLock": false } ``` ### Response #### Success Response (200) - **IPCB_PrimitivePad | undefined** - The created pad primitive object or undefined if creation failed. #### Response Example ```json { "padId": "pad_12345", "layer": "TOPLAYER", "padNumber": "1", "x": 100.0, "y": 150.0, "rotation": 90, "net": "GND" } ``` ``` -------------------------------- ### Get PCB Primitive Image Signature Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_primitiveimage.get_1.html This is the TypeScript signature for the get method. It takes an array of primitive IDs and returns a Promise that resolves to an array of PCB_PrimitiveImage objects. ```typescript get(primitiveIds: Array): Promise>; ``` -------------------------------- ### PRIMITIVE Configuration: VIA Source: https://prodocs.lceda.cn/cn/format/pcb/primitive Configure a VIA primitive. 'display' is set to 1 (visible) and 'pick' is set to 0 (not selectable). ```json { "type": "PRIMITIVE","id": "VIA", "ticket": 1 }|| { "display":1, "pick":0, }| ``` -------------------------------- ### 通过命令行运行客户端输出日志 Source: https://prodocs.lceda.cn/cn/faq/client/index.html 在专业版中,当客户端启动出现问题时,可以通过在命令行窗口运行客户端来输出详细的日志信息,以便技术支持排查。日志文件会输出在 "trace" 文件夹内。 ```bash 命令行窗口会开始运行客户端,会输出日志 ``` -------------------------------- ### Get Bus Primitive Signature Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.sch_primitivebus.get.html This is the TypeScript signature for the get() method. It takes a string of primitive IDs and returns a Promise that resolves to an ISCH_PrimitiveBus object or undefined if retrieval fails. ```typescript get(primitiveIds: string): Promise; ``` -------------------------------- ### Get Arc Primitive Signature Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.sch_primitivearc.get.html This is the TypeScript signature for the get method of SCH_PrimitiveArc. It takes a primitive ID as a string and returns a Promise that resolves to an ISCH_PrimitiveArc object or undefined if retrieval fails. ```typescript get(primitiveIds: string): Promise; ``` -------------------------------- ### 设置 DNS 服务器解决登录二维码加载问题 Source: https://prodocs.lceda.cn/cn/faq/client/index.html 如果登录时二维码加载不出来,可以尝试修改电脑的DNS服务器设置。将首选DNS服务器设置为 "114.114.114.114",有助于解决网络解析问题。 ```bash 在控制面板-网络链接属性——Internet协议版本4(TCP/IPv4)-首选DNS服务器输入114 114 114 114 ``` -------------------------------- ### Create React Instance Object Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.isys_reactcomponentizationdialogreactinstance.html This example shows how to create a React instance object that conforms to the ISYS_ReactComponentizationDialogReactInstance interface. It assigns specific React functions and hooks to the corresponding properties. ```typescript const ReactInstance = { createContext: React.createContext, useContext: React.useContext, useRef: React.useRef, useEffect: React.useEffect, createElement: React.createElement, }; ``` -------------------------------- ### Get Minimum Wire Length for Pad Pair Group Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_drc.getpadpairgroupminwirelength.html Use this method to get the minimum wire length for a specified pad pair group. The API is in BETA and subject to change. ```typescript getPadPairGroupMinWireLength(padPairGroupName: string): Promise>; ``` -------------------------------- ### getIpcD356AFile Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_manufacturedata.getipcd356afile.html Retrieves the IPC-D-356A file for the current PCB project. This API is currently in BETA. ```APIDOC ## getIpcD356AFile ### Description Retrieves the IPC-D-356A file. This API is currently in BETA and subject to change. ### Method Method: getIpcD356AFile() ### Parameters #### Path Parameters - **fileName** (string) - Optional - The name of the file to retrieve. ### Response - **Promise** - Returns the IPC-D-356A file data or undefined if not found. ### Request Example ```javascript const ipcFile = await eda.pcb_ManufactureData.getIpcD356AFile('IPC_D356A_Test'); if (ipcFile) { await eda.sys_FileSystem.saveFile(ipcFile); } ``` ``` -------------------------------- ### Get Current Document Info - TypeScript Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.dmt_selectcontrol.getcurrentdocumentinfo.html Call this method to get the document type, UUID, project UUID, or library UUID of the currently focused document. Returns undefined if retrieval fails. This API is in BETA. ```typescript getCurrentDocumentInfo(): Promise; ``` -------------------------------- ### PCB_PrimitiveVia Methods Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_primitivevia.html Overview of the methods available for interacting with PCB via primitives. ```APIDOC ## PCB_PrimitiveVia Methods ### Description Methods for managing PCB via primitives including creation, modification, and retrieval. ### Methods - **create(net, x, y, holeDiameter, diameter, viaType, designRuleBlindViaName, solderMaskExpansion, primitiveLock)**: Creates a new via. - **delete(primitiveIds)**: Deletes specified vias (BETA). - **get(primitiveIds)**: Retrieves specified vias (BETA). - **getAll(net, primitiveLock)**: Retrieves all vias (BETA). - **getAllPrimitiveId(net, primitiveLock)**: Retrieves all via primitive IDs (BETA). - **modify(primitiveId, property)**: Modifies an existing via (BETA). ``` -------------------------------- ### ISCH_PrimitiveArc.getState_StartY() Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.isch_primitivearc.getstate_starty.html Retrieves the Y-coordinate of the starting point for an attribute. ```APIDOC ## ISCH_PrimitiveArc.getState_StartY() ### Description Retrieves the Y-coordinate of the starting point for an attribute. ### Method N/A (This is a method call, not a REST endpoint) ### Endpoint N/A ### Parameters None ### Request Example ```typescript getState_StartY() ``` ### Response #### Success Response (200) - **returnValue** (number) - The Y-coordinate of the starting point. ``` -------------------------------- ### SYS_Window.openUI() Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.sys_window.openui.html Opens a UI window based on the provided name and optional arguments. ```APIDOC ## SYS_Window.openUI() ### Description Opens a UI window. Note: This is a non-public interface provided as-is; parameters may change in future versions without notice. ### Method Method Call ### Parameters #### Arguments - **uiName** (string) - Required - The name of the UI to open. - **args** ({ [key: string]: any; }) - Optional - An object containing optional parameters. ### Response - **Returns** (Promise) - A promise that resolves when the UI window is opened. ``` -------------------------------- ### 查看 SDK 项目文件结构 Source: https://prodocs.lceda.cn/cn/api/guide/how-to-start.html 展示 pro-api-sdk 项目的目录结构,帮助开发者理解各配置文件的作用。 ```text ├───.husky 自动脚本目录 ├───.vscode VS Code 配置文件目录 │ ├───extensions.json 推荐安装的扩展配置 │ └───settings.json 扩展配置 ├───build 扩展包编译目录 │ ├───dist 扩展包编译结果目录 │ └───packaged.ts 编译脚本 ├───config ESBuild 配置目录 ├───dist 扩展主代码编译结果目录 ├───iframe IFrame 内联框架目录 ├───images 扩展预览图目录 │ ├───banner.png 扩展条幅展示图 │ └───logo.png 扩展 Logo 图 ├───locales 扩展多语言目录 │ ├───en.json 英语语言翻译文件 │ └───zh-Hans.json 简体中文语言翻译文件 ├───node_modules NPM 依赖模块目录 ├───src 扩展主要源代码目录 ├───.edaignore EDA 忽略文件配置 ├───.editorconfig 编辑器基础格式配置 ├───.eslintrc.js ESLint 自动代码约束配置 ├───.gitattributes Git 属性配置 ├───.gitignore Git 忽略文件配置 ├───.prettierignore Prettier 忽略文件配置 ├───.prettierrc.js Prettier 自动格式化配置 ├───LICENSE 开源授权协议 ├───README.md 项目简介 ├───extension.json 嘉立创 EDA 专业版扩展配置 ├───package.json NPM 软件包配置 ├───package-lock.json NPM 软件包依赖锁定配置 └───tsconfig.json TypeScript 编译配置 ``` -------------------------------- ### IPCB_PrimitiveLine.getState_StartX() Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitiveline.getstate_startx.html Retrieves the starting X position of a property. ```APIDOC ## IPCB_PrimitiveLine.getState_StartX() ### Description Gets the attribute status: starting position X. ### Method This is a method call, not a standard HTTP method. ### Endpoint N/A (This is a method within a class/object). ### Parameters This method does not accept any parameters. ### Request Example ```typescript // No request body for this method ``` ### Response #### Success Response - **number** - The starting X position. #### Response Example ```json 123.45 ``` ``` -------------------------------- ### SYS_Setting Class Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.sys_setting.html Provides methods for system settings management. ```APIDOC ## SYS_Setting Class ### Description Represents system settings and provides methods to manage them. ### Methods #### restoreDefault() ##### Description _(BETA)_ Restores global settings to their default values. ##### Method N/A (Class method or instance method without explicit HTTP verb) ##### Endpoint N/A ##### Parameters None ##### Request Body None ##### Request Example None ##### Response None (Typically void or status indicator) ##### Response Example None ``` -------------------------------- ### GET ISCH_PrimitiveComponent.primitiveId Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.isch_primitivecomponent.primitiveid.html Accessing the primitiveId property of the ISCH_PrimitiveComponent. ```APIDOC ## Property: primitiveId ### Description Represents the unique identifier (ID) for the primitive component. ### Type string (Optional) ### Signature ```typescript protected primitiveId?: string; ``` ``` -------------------------------- ### PCB_PrimitiveVia.create() Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_primitivevia.create.html Creates a new via primitive on the PCB. ```APIDOC ## PCB_PrimitiveVia.create() ### Description Creates a new via primitive on the PCB with specified network, position, and physical dimensions. ### Parameters #### Arguments - **net** (string) - Required - 网络名称 - **x** (number) - Required - 坐标 X - **y** (number) - Required - 坐标 Y - **holeDiameter** (number) - Required - 孔径 - **diameter** (number) - Required - 外径 - **viaType** (EPCB_PrimitiveViaType) - Optional - 过孔类型 - **designRuleBlindViaName** (string | null) - Optional - 盲埋孔设计规则项名称,定义过孔的开始层与结束层,null 表示非盲埋孔 - **solderMaskExpansion** (IPCB_PrimitiveSolderMaskAndPasteMaskExpansion | null) - Optional - 阻焊/助焊扩展,null 表示跟随规则 - **primitiveLock** (boolean) - Optional - 是否锁定 ### Response - **Promise** - 返回创建的过孔图元对象 ``` -------------------------------- ### GET getState_Name Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.isch_primitivecomponent.getstate_name.html Retrieves the name attribute of the ISCH_PrimitiveComponent. ```APIDOC ## GET ISCH_PrimitiveComponent.getState_Name() ### Description Retrieves the name attribute of the primitive component. ### Method GET ### Returns - **string | undefined** - The name of the component, or undefined if not set. ``` -------------------------------- ### Get X-coordinate state Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitivecomponent.getstate_x.html Retrieves the X-coordinate as a number. ```typescript getState_X(): number; ``` -------------------------------- ### Associating Elements with Partitions Source: https://prodocs.lceda.cn/cn/format/pcb/partition Describes how to link PCB elements (e.g., VIAs) to a specific partition. ```APIDOC ## Element Partition Association ### Description To associate a PCB element with a partition, include the `partitionId` field in the element's data structure. ### Fields - **partitionId** (string) - Required - The ID of the partition to which the element belongs ### Example (VIA) { "type": "VIA", "id": "viaUuid", "ticket": 1, "partitionId": "partitionId", "groupId": 0, "locked": 1, "zIndex": 3.223, "netName": "GND", "ruleName": "asdf", "centerX": 100, "centerY": 200, "holeDiameter": 5, "viaDiameter": 9, "viaType": 0, "topSolderExpansion": null, "bottomSolderExpansion": null, "unusedInnerLayers": [17] } ``` -------------------------------- ### GET IPCB_PrimitiveAPI.getAll Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitiveapi.getall.html Retrieves all IPCB_Primitive objects from the API. ```APIDOC ## GET IPCB_PrimitiveAPI.getAll ### Description Retrieves a list of all IPCB_Primitive objects. This method can return the array directly or via a Promise. ### Method GET ### Endpoint IPCB_PrimitiveAPI.getAll ### Response #### Success Response (200) - **Array** - A list of primitive objects. ``` -------------------------------- ### PCB_Document.importAutoLayoutJsonFile() Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_document.importautolayoutjsonfile.html Imports an automatic layout file in JSON format. This API is currently in BETA. ```APIDOC ## PCB_Document.importAutoLayoutJsonFile() ### Description Imports an automatic layout file (JSON). ### Method This is a method of the PCB_Document object. ### Endpoint N/A (This is a client-side method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```typescript // Assuming 'file' is a File object representing the JSON file PCB_Document.importAutoLayoutJsonFile(file); ``` ### Response #### Success Response (200) - **boolean** - Indicates whether the import operation was successful. #### Response Example ```json { "success": true } ``` ### Remarks Can be used with 'Read File' functionality. ``` -------------------------------- ### 执行版本升级 Source: https://prodocs.lceda.cn/cn/private/installers/install-linux.html 运行升级脚本以更新代码版本。 ```bash bash pro-private-code-upgrade.sh ##提示升级完成即可,如遇不能解决未知错误,请联系维护人员处理。 ``` -------------------------------- ### POST IPCB_PrimitivePad.create() Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitivepad.create.html Creates a new pad primitive in the PCB canvas. Note: This API is currently in BETA and subject to change. ```APIDOC ## IPCB_PrimitivePad.create() ### Description Creates a new pad primitive object within the PCB canvas. This method is currently in BETA status. ### Method POST ### Endpoint IPCB_PrimitivePad.create() ### Response #### Success Response (200) - **IPCB_PrimitivePad** (Object) - The created pad primitive object. #### Response Example { "type": "IPCB_PrimitivePad", "id": "pad_001" } ``` -------------------------------- ### setState_StartY Method Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitiveline.setstate_starty.html Sets the starting Y-coordinate for the IPCB_PrimitiveLine object. ```APIDOC ## setState_StartY() ### Description Sets the starting Y-coordinate property for the IPCB_PrimitiveLine object. Note: This API is currently in BETA. ### Method Method call ### Parameters #### Parameters - **startY** (number) - Required - The starting Y-coordinate value. ### Response - **Returns** (IPCB_PrimitiveLine) - The updated line primitive object. ``` -------------------------------- ### 以管理员方式运行命令安装软件 Source: https://prodocs.lceda.cn/cn/faq/client/index.html 在Windows 10系统中,当安装文件无法正常运行时,可以尝试以管理员方式运行命令提示符(cmd),然后输入安装文件所在目录进行安装。 ```bash 需要运行的安装文件所在位置的目录自行安装就可以了 ``` -------------------------------- ### IPCB_PrimitiveLine.getState_StartY() Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.ipcb_primitiveline.getstate_starty.html Retrieves the Y-coordinate of the starting position for a primitive line. ```APIDOC ## IPCB_PrimitiveLine.getState_StartY() ### Description Gets the attribute status: starting position Y. ### Method N/A (This is a method call, not a REST endpoint) ### Endpoint N/A ### Parameters None ### Request Example ```typescript // No request body for this method ``` ### Response #### Success Response (200) - **Y-coordinate** (number) - The Y-coordinate of the starting position. #### Response Example ```json { "example": "number" } ``` ``` -------------------------------- ### GET LIB_Symbol.get() Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.lib_symbol.get.html Retrieves the properties of a symbol based on its UUID. ```APIDOC ## GET LIB_Symbol.get() ### Description Retrieves all attributes of a symbol. This API is currently in BETA. ### Method GET ### Parameters #### Path Parameters - **symbolUuid** (string) - Required - The UUID of the symbol. - **libraryUuid** (string) - Optional - The UUID of the library, obtainable via LIB_LibrariesList. ### Response #### Success Response (200) - **ILIB_SymbolItem** (object) - The symbol properties or undefined if not found. ``` -------------------------------- ### POST PCB_PrimitiveFill.create Source: https://prodocs.lceda.cn/cn/api/reference/pro-api.pcb_primitivefill.create.html Creates a new fill primitive on the PCB design. ```APIDOC ## POST PCB_PrimitiveFill.create() ### Description Creates a fill primitive on a specified layer using a complex polygon. Note: This API is currently in BETA. ### Method POST ### Parameters #### Request Body - **layer** (TPCB_LayersOfFill) - Required - The target layer for the fill. - **complexPolygon** (IPCB_Polygon) - Required - The complex polygon object defining the fill shape. - **net** (string) - Optional - The network name associated with the fill. - **fillMode** (EPCB_PrimitiveFillMode) - Optional - The mode used for filling. - **lineWidth** (number) - Optional - The width of the lines used in the fill. - **primitiveLock** (boolean) - Optional - Whether the primitive is locked. ### Response #### Success Response (200) - **IPCB_PrimitiveFill | undefined** - Returns the created fill primitive object or undefined if creation fails. ``` -------------------------------- ### 以管理员方式运行 cmd 安装软件 Source: https://prodocs.lceda.cn/cn/faq/client 当软件安装包无法正常运行时,可以通过管理员方式运行命令提示符(cmd),然后输入安装文件所在目录进行安装。 ```batch cd [安装文件所在目录] setup.exe ```