jwace81 / 1x2 connector

Files

Pins

Symbol

PCB

Open in Flux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Footprint node and Model node ID
const footprintID = "a87887bd-76d0-4118-b6ba-d4c7ceee61c3";
const modelID = "5f939cd2-1ef2-4167-8090-5b79d4ee94b8";
const footprintNode = flux.getNodeById(footprintID) as PcbLayoutNode;
const modelNode = flux.getNodeById(modelID) as PcbLayoutNode;
// This will return array of all assets with file type .kicad_mod
const footprintAssetNotSorted = flux.assets.filter((asset) => asset.fileType === "kicad_mod").map((asset) => asset.name);
const footprintAssetId = footprintAssetNotSorted.sort();
// This will return array of all assets with file type .step
const modelAssetIdNotSorted = flux.assets.filter((asset) => asset.fileType === "step").map((asset) => asset.name);
const modelAssetId = modelAssetIdNotSorted.sort();
if (footprintNode || modelNode) {
    const assetFootprintRule = footprintNode.rules.find((rule) => rule.key === "asset");
    const assetModelRule = modelNode.rules.find((rule) => rule.key === "asset");
    flux.on("setup", () => {
        const property = flux.properties.find((prop) => prop.name === "Package");
        if (property) {
            changeFootprintAsset(property.value);
            changeModelAsset(property.value)
        }
    });
    flux.on("propertyChange", (event: PropertyChangeEvent) => {
        if (event.property_name === "Package") {
            changeFootprintAsset(event.value);
Design view of 1x2 connectorDesign view of 1x2 connector
Enter to Rename, Shift+Enter to Preview

Reviews