Silly98 commited on
Commit
c8e7a71
·
verified ·
1 Parent(s): abaad27

Update sample.txt

Browse files
Files changed (1) hide show
  1. sample.txt +41 -20
sample.txt CHANGED
@@ -1,24 +1,45 @@
1
- The client’s core challenge is that their current drawing process is heavily manual. Equipment attributes are manually typed across GAs, One-lines, Relaying Diagrams, and DC Schematics. They want to transition to a smart, connected workflow.
 
2
 
3
- Based on the customer's priorities, they want to start with simple integrations first. Please review the requirements broken down into our proposed four-phase roadmap:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- Phase 1: Foundational Component Linking
6
- • Smart Interconnectivity: The fundamental "step one" is making 2D symbols smart. A component (e.g., Breaker 52-L1) on a General Arrangement (GA) drawing must be digitally linked to that exact same symbol on the One-line and Relaying diagrams.
7
- • AutoCAD Source: The solution must seamlessly integrate with their base AutoCAD files, which serve as their primary source of truth.
 
 
 
 
 
8
 
9
- Phase 2: Attribute Propagation & Logic Checking
10
- • Data Flow: If an engineer enters standard equipment parameters on the One-line (e.g., from a vendor print), that data must automatically propagate to the corresponding DC Schematics.
11
- • Automated Flags: The system should perform basic cross-drawing checks (e.g., verifying that if relay 50-L1 is meant to trip breaker 52-L1, the connection is correctly reflected in the schematics) and flag discrepancies for human review.
12
-
13
- Phase 3: AI-Driven Generative Design & Compliance
14
- • Generative AI: Utilizing AI trained on historical data and protection philosophies to infer and generate project-specific elements (like close/trip coils).
15
- • Audit Trail: Crucial requirement. The system must generate a clear "decision tree" showing how the software arrived at its conclusions. Their legal team requires this to prove responsible charge for the signing engineer.
16
-
17
- Phase 4: Ancillary Data Extraction (Future Tools)
18
- • Automated Cable Lists: Once the core integration is stable, the system should scan the schematics using OCR/Vision AI to extract cable loops, color codes, and connections, automatically populating this data into an Excel spreadsheet.
19
-
20
- Requested Sample Files As requested during our internal discussions, I have attached the sample files so you can visualize the required data flow. Please find the following attached:
21
- • AutoCAD files
22
- • PDF Files
23
- • Equipment BOM (303.01)
24
 
 
 
 
 
1
+ import ezdxf
2
+ from collections import Counter
3
 
4
+ def count_components_with_details(file_path):
5
+ try:
6
+ doc = ezdxf.readfile(file_path)
7
+ inventory = []
8
+
9
+ for layout in doc.layouts:
10
+ for insert in layout.query('INSERT'):
11
+ name = insert.dxf.name
12
+
13
+ # Filter out system/meta blocks
14
+ if name.startswith('*') or name == 'WD_M' or 'TB' in name.upper() or 'TTLB' in name.upper():
15
+ continue
16
+
17
+ # 1. GET THE PICK POINT (Insertion Point)
18
+ # Returns a Vector object (x, y, z)
19
+ ip = insert.dxf.insert
20
+ pick_point = f"({ip.x:.2f}, {ip.y:.2f})"
21
+
22
+ # 2. Extract attributes
23
+ raw_attribs = {att.dxf.tag: att.dxf.text for att in insert.attribs if att.dxf.text.strip()}
24
+ attr_str = " | ".join([f"{k}: {v}" for k, v in raw_attribs.items()])
25
+ if not attr_str:
26
+ attr_str = "(No Attributes)"
27
+
28
+ # We store the pick point along with name and attributes
29
+ inventory.append((name, pick_point, attr_str))
30
 
31
+ print(f"=== DETAILED INVENTORY FOR: {file_path} ===")
32
+ print(f"TOTAL COMPONENTS: {len(inventory)}")
33
+ print("-" * 120)
34
+ print(f"{'Block Name':<20} | {'Pick Point (X,Y)':<18} | {'Attribute Details'}")
35
+ print("-" * 120)
36
+
37
+ for name, p_point, attrs in inventory:
38
+ print(f"{name:<20} | {p_point:<18} | {attrs}")
39
 
40
+ except Exception as e:
41
+ print(f"Error: {e}")
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
+ # Usage
44
+ file_path = r"C:\Users\navinshrivatsan\Desktop\dxf_one_line_drawings\NRE-EC-101.0.dxf"
45
+ count_components_with_details(file_path)