Заметки электроника
Простое - надёжнее!
Меню
  • Главная
  • Погода
  • Заметки
  • Календарь
  • Фотогалерея
  • Песни
  • Чтиво
  • Программы
  • Скачать
  • Связь и ссылки
  • Чехия
  • Lavka

Живёшь в Чехии?

Replace components in schematic JavaScript

  • Печать
  • E-mail
Информация о материале
Автор: Super User
Родительская категория: Заметки
Категория: Электроника / cхемотехника
Создано: 18 апреля 2023
Обновлено: 18 апреля 2023
Просмотров: 999
Звезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активна
If you want to replace components in your schematic with components from another library, you will need to add that library to your Altium Designer project first. Once the library is added, you can modify the script to use components from the new library by specifying the full path and name of the new component. Here's an example of how to modify the script to replace components with components from a different library: javascript
// get the component to replace
var componentToReplace = "R1";

// get the new component from a different library
var newComponentPath = "MyLibrary\\NewComponents.LibPkg"; // the path to the new library package
var newComponentName = "R3"; // the name of the new component in the library

// loop through all components in the schematic
for (var i = 0; i < currentSheet.GetSchObjectCount(); i++) {
    var obj = currentSheet.GetSchObject(i);
    if (obj.GetSelectStatus() == eSelected) {
        if (obj.GetState() == SCH_COMP) {
            var component = obj;
            if (component.GetLibReference().GetLibItemName() == componentToReplace) {
                // get the current location of the component
                var x = component.GetState_X();
                var y = component.GetState_Y();
                // get the current rotation of the component
                var rotation = component.GetState_Rotation();
                // remove the current component
                currentSheet.RemoveSchObject(component);
                // add the new component from the new library at the same location and rotation
                var newLib = currentDoc.FindLibrary(newComponentPath);
                var newComponentTemplate = newLib.FindSchComponentTemplate(newComponentName);
                var newComponent = currentSheet.CreateSchComponent(x, y, rotation, newComponentTemplate);
                currentSheet.AddSchObject(newComponent);
            }
        }
    }
}

C++ programming in Visual Studio Code:: setup

  • Печать
  • E-mail
Информация о материале
Автор: Super User
Родительская категория: Заметки
Категория: Компьютерная повседневность
Создано: 18 апреля 2023
Обновлено: 18 апреля 2023
Просмотров: 923
Звезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активна
1. Install gcc:: https://www.devdungeon.com/content/install-gcc-compiler-windows-msys2-cc
2. Istall VS code and tools: https://www.freecodecamp.org/news/how-to-write-and-run-c-cpp-code-on-visual-studio-code/

Тригонометрия на круге : наглядно

  • Печать
  • E-mail
Информация о материале
Автор: Super User
Родительская категория: Заметки
Категория: Интересное
Создано: 14 апреля 2023
Обновлено: 16 апреля 2023
Просмотров: 928
Звезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активна

How to make Footprint Comparison Report in Altium Designer 23

  • Печать
  • E-mail
Информация о материале
Автор: Super User
Родительская категория: Заметки
Категория: Электроника / cхемотехника
Создано: 14 апреля 2023
Обновлено: 14 апреля 2023
Просмотров: 994
Звезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активна
Open PCB document,
then
Tools >>> Update from PCB libraries

https://resources.altium.com/p/footprint-comparison-report-features-adscvid-2

Конвертор с 0..3V на ±5V

  • Печать
  • E-mail
Информация о материале
Автор: Super User
Родительская категория: Заметки
Категория: Электроника / cхемотехника
Создано: 12 апреля 2023
Обновлено: 12 апреля 2023
Просмотров: 839
Звезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активна


  1. Конвертор с 0..5 на ±5V
  2. Test read C# without locking
  3. Altium Schematics #04: Using signal harness in hierarchical design
  4. I2C SMBA

Страница 41 из 197

  • 36
  • 37
  • 38
  • 39
  • ...
  • 41
  • 42
  • 43
  • 44
  • ...

Back to Top

© 2026 Заметки электроника

Top.Mail.Ru