720.11 Mechanical Execution of Work
Circuits operating at less than 50 volts shall be installed in a neat and workmanlike manner. Cables shall be supported by the building structure in such a manner that the cable will not be damaged by normal building use. 690.31 Wiring Methods
(A) Wiring Systems
All raceway and cable wiring methods included in this Code, other wiring systems and fittings specifically listed for use in PV arrays, and wiring as part of a listed system shall be permitted. Where wiring devices with integral enclosures are used, sufficient length of cable shall be provided to facilitate replacement.
Where PV source and output circuits operating at voltages greater than 30 volts are installed in readily accessible locations, circuit conductors shall be guarded or installed in Type MC cable or in raceway. The ampacity of 105°C (221°F) and 125°C (257°F) conductors shall be permitted to be determined by Table 690.31(A)(b). For ambient temperatures greater than 30°C (86°F), the ampacities of these conductors shall be corrected in accordance with Table 690.31(A)(a).0 400.10 Uses Permitted
(A) Uses
Flexible cords and flexible cables shall be used only for the following:
(1) Pendants.
(2) Wiring of luminaires.
(3) Connection of portable luminaires, portable and mobile signs, or appliances.
(4) Elevator cables.
(5) Wiring of cranes and hoists.
(6) Connection of utilization equipment to facilitate frequent interchange.
(7) Prevention of the transmission of noise or vibration.
(8) Appliances where the fastening means and mechanical connections are specifically designed to permit ready removal for maintenance and repair, and the appliance is intended or identified for flexible cord connection.
(9) Connection of moving parts.
(10) Where specifically permitted elsewhere in this Code.
(11) Between an existing receptacle outlet and an inlet, where the inlet provides power to an additional single receptacle outlet. The wiring interconnecting the inlet to the single receptacle outlet shall be a Chapter 3 wiring method. The inlet, receptacle outlet, and Chapter 3 wiring method, including the flexible cord and fittings, shall be a listed assembly specific for this application.
400.12 Uses Not Permitted
Unless specifically permitted in 400.10, flexible cables, flexible cord sets, and power supply cords shall not be used for the following:
(1) As a substitute for the fixed wiring of a structure
(2) Where run through holes in walls, structural ceilings, suspended ceilings, dropped ceilings, or floors
(3) Where run through doorways, windows, or similar openings
(4) Where attached to building surfaces
Exception to (4): Flexible cord and flexible cable shall be permitted to be attached to building surfaces in accordance with 368.56(B).
(5) Where concealed by walls, floors, or ceilings or located above suspended or dropped ceilings
Exception to (5): Flexible cord and flexible cable shall be permitted if contained within an enclosure for use in Other Spaces Used for Environmental Air as permitted by 300.22(C)(3).
(7) Where subject to physical damage
400.17 Protection From Damage
Flexible cords and flexible cables shall be protected by bushings or fittings where passing through holes in covers, outlet boxes, or similar enclosures.
You absolutely cannot and should not run bare wires through a window. This manages to violate basically all of Chapter 3 of the NEC: 300.3 Conductors
(A) Single Conductors
Single conductors specified in Table 310.104(A) shall only be installed where part of a recognized wiring method of Chapter 3.
300.4 Protection Against Physical Damage
Where subject to physical damage, conductors, raceways, and cables shall be protected.
300.6 Protection Against Corrosion and Deterioration
Raceways, cable trays, cablebus, auxiliary gutters, cable armor, boxes, cable sheathing, cabinets, elbows, couplings, fittings, supports, and support hardware shall be of materials suitable for the environment in which they are to be installed.
300.11 Securing and Supporting
(A) Secured in Place
Raceways, cable assemblies, boxes, cabinets, and fittings shall be securely fastened in place.
300.12 Mechanical Continuity — Raceways and Cables
Raceways, cable armors, and cable sheaths shall be continuous between cabinets, boxes, fittings, or other enclosures or outlets.
310.10 Uses Permitted
(C) Wet Locations
Insulated conductors and cables used in wet locations shall comply with one of the following:
Be moisture-impervious metal-sheathed
Be types MTW, RHW, RHW-2, TW, THW, THW-2, THHW, THWN, THWN-2, XHHW, XHHW-2, or ZW
Be of a type listed for use in wet locations
(D) Locations Exposed to Direct Sunlight
Insulated conductors or cables used where exposed to direct rays of the sun shall comply with (D)(1) or (D)(2):
Conductors and cables shall be listed, or listed and marked, as being sunlight resistant
Conductors and cables shall be covered with insulating material, such as tape or sleeving, that is listed, or listed and marked, as being sunlight resistant
Both the solar panels and the inverter are listed products and are required to be installed in accordance with their listings. In particular, this means they must be permanently fastened to the structure in the manner of the manufacturer's instructions. 110.3 Examination, Identification, Installation, Use, and Listing (Product Certification) of Equipment
(B) Installation and Use
Listed or labeled equipment shall be installed and used in accordance with any instructions included in the listing or labeling.
The solar panels must be fastened to the structure in a way that resists wind and weather loads. There are entire sections of the NEC and various IBC codes devoted to this. 110.8 Wiring Methods
Only wiring methods recognized as suitable are included in this Code. The recognized methods of wiring shall be permitted to be installed in any type of building or occupancy, except as otherwise provided in this Code.
110.12 Mechanical Execution of Work
Electrical equipment shall be installed in a neat and workmanlike manner.
110.13 Mounting and Cooling of Equipment
(A) Mounting
Electrical equipment shall be firmly secured to the surface on which it is mounted. Wooden plugs driven into holes in masonry, concrete, plaster, or similar materials shall not be used.
110.26 Spaces About Electrical Equipment
Access and working space shall be provided and maintained about all electrical equipment to permit ready and safe operation and maintenance of such equipment.
(A) Working Space
Working space for equipment operating at 1000 volts, nominal, or less to ground and likely to require examination, adjustment, servicing, or maintenance while energized shall comply with the dimensions of 110.26(A)(1), (A)(2), (A)(3), and (A)(4) or as required or permitted elsewhere in this Code.
(B) Clear Spaces
Working space required by this section shall not be used for storage. When normally enclosed live parts are exposed for inspection or servicing, the working space, if in a passageway or general open space, shall be suitably guarded.
(E) Dedicated Equipment Space
All switchboards, switchgear, panelboards, and motor control centers shall be located in dedicated spaces and protected from damage.
(1) Indoor
Indoor installations shall comply with 110.26(E)(1)(a) through (E)(1)(d).
(a) Dedicated Electrical Space. The space equal to the width and depth of the equipment and extending from the floor to a height of 1.8 m (6 ft) above the equipment or to the structural ceiling, whichever is lower, shall be dedicated to the electrical installation. No piping, ducts, leak protection apparatus, or other equipment foreign to the electrical installation shall be located in this zone.
(2) Outdoor
Outdoor installations shall comply with 110.26(E)(2)(a) through (c).
(a) Installation Requirements. Outdoor electrical equipment shall be the following:
(1) Installed in identified enclosures
110.27 Guarding of Live Parts
(A) Live Parts Guarded Against Accidental Contact
Except as elsewhere required or permitted by this Code, live parts of electrical equipment operating at 50 to 1000 volts, nominal shall be guarded against accidental contact by approved enclosures or by any of the following means:
(1) By location in a room, vault, or similar enclosure that is accessible only to qualified persons.
(3) By location on a balcony, gallery, or platform elevated and arranged so as to exclude unqualified persons.
(4) By elevation above the floor or other working surface as follows:
A minimum of 2.5 m (8 ft) for 50 volts to 300 volts between ungrounded conductors
(B) Prevent Physical Damage
In locations where electrical equipment is likely to be exposed to physical damage, enclosures or guards shall be so arranged and of such strength as to prevent such damage.
Rivets, on the other hand, are commonly heated and forged so that both ends have a head, and then as they cool the clamping load increases. This was very common a hundred years ago, but my understanding is that bolted joints provide a more predictable clamping load and that is why they are so dominant today.