Batch-write the turbine positions from the coordinate point DWG into a new copy of the base map. Each turbine position must consist of three independent objects:
fjWind turbine schematic block;- the 25×25 small box below the wind turbine;
HD数字#formatted number, for exampleHD2#。
Input Requirements
PointDwg: containsPOINTentities and corresponding numeric text turbine position coordinate file. The text should coincide with the point or be within the matching tolerance, and the number must be unique.BaseDwg: the base map to be overlaid. The base map must use the same coordinate system and the same units as the coordinate point file.OutputDwg: a new output path, which must not be the same as either input file and must not be an existing file.
Do not automatically guess or perform coordinate transformation. If the coordinate systems, central meridians, or units of the two DWGs are inconsistent, stop first and explain that the user needs to confirm the transformation parameters.
Execution Method
Requires AutoCAD to be installed and open on Windows. Run:
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/apply_wind_turbine_layout.ps1 `
-PointDwg "C:/path/机位坐标.dwg" `
-BaseDwg "C:/path/新底图.dwg" `
-OutputDwg "C:/path/新底图_IB风机布置.dwg"
Optional parameters:
-LabelPrefix "HD": number prefix, defaultHD。-LabelSuffix "#": number suffix, default#。-MatchTolerance 0.5: the maximum matching distance between the point and the numeric text, default 0.5 drawing units.-AllowTextOnly: only when the source file completely has noPOINT, allow directly using the numeric text insertion point; not allowed by default.
On success, the script outputs JSON, and status must be validated. Before delivering to the user, check the object quantity and input file hash verification results in it.
Built-in Standard Style
assets/ib-fj-template.dwg: preservefjthe block's real wind turbine geometry and dependencies.assets/ib-label-template.dwg: preserveHZtext style, color, and MText format.assets/ib-style.json: record the wind turbine layer, number offset, and box geometry parameters.
The default style originates from 初步布置图1013.dwg:
fjplaced onIB风机布置layer, insertion point strictly equal to the turbine position coordinate;- the box is placed on
mainlayer, size 25×25, preserving the standard center offset, color, and lineweight; - the number is placed on
mainlayer, following the template MText format, with the number content replaced byHD数字#。
Quality Gate
Only when all of the following conditions are met can it be reported as complete:
- the generated
fj, box, and number quantities are all equal to the number of valid turbine positions; - each
fjinsertion point is consistent with the source turbine position coordinate; - each box size is 25×25, and the style parameters are consistent with the built-in configuration;
- each source number corresponds to exactly one
HD数字#number; - the SHA-256 hashes of both input DWGs remain unchanged before and after the run;
- the output DWG has been successfully saved as a new file.
Any verification failure should be clearly reported as an error; do not treat an unverified file as a completed result. Failure cleanup may only delete the output copy just created by this run, and must not delete or modify the input files.