FreeCAD Logo FreeCAD 1.0
  • Английский Африкаанс Арабский Белорусский Каталанский Чешский Немецкий Греческий Испанский Испанский Баскский Финский Филиппинский Французский Галисийский Хорватский Венгерский Индонезийский Итальянский Японский Кабильский Корейский Литовский Нидерландский Норвежская букмол Польский Португальский Португальский Румынский Русский Словацкий Словенский Сербский Шведский Турецкий Украинский Валенсианский Вьетнамский Китайский Китайский
  • Возможности
  • Скачать
  • Блог
  • Документация
    Индекс документации Приступая к работе Пользовательская документация Руководство по FreeCAD Документация верстаков Документация по кодированию на Python Документация по коду C++ Уроки Часто задаваемые вопросы Политика конфиденциальности О программе FreeCAD
  • Внести вклад
    Как помочь Sponsor Сообщить об ошибке Сделать запрос Задачи и финансирование Руководство по участию в разработке Руководство для разработчиков Переводы
  • Сообщество
    Кодекс поведения Форум The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Календарь
  • ♥ Donate

Donate

$
Информация о SEPA
Пожалуйста, настройте банковский перевод SEPA:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Банковское агентство: BNP Paribas Fortis
Адрес: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

Команда "Удалить"
Команда "Расположение..."
Меню "Правка"

Отправить в консоль Python

Расположение в меню
Правка → Отправить в консоль Python
Верстаки
Все
Быстрые клавиши
Ctrl+Shift+P
Представлено в версии
0.19
См. также
Нет

Описание

The Std SendToPythonConsole command creates variables in the Python Console referencing a selected object and its selected subshapes, along with some other useful references. The variables and the code involved can be used in the development of Python code.

В зависимости от выбранного объекта и входящих в его состав выбранных форм, создаются следующие переменные:

Название переменной Пояснение
doc Документ в котором содержится вбранный объект
lnk Выбранный объект ссылки (создается только в том случае, если выбранный объект является ссылкой)
obj В зависимости от выбранного объекта:

Сам выбранный объект (если выбранный объект не является ссылкой)
Связанный объект (если выбранный объект является ссылкой)

shp Зависит от типа obj:

Shape свойство obj (для объектов унаследованных от Part::Feature класса)
Mesh свойство obj (для Mesh объектов)
Points свойство obj (для Points объектов)

sub Первая выбранная вложенная фигура (создается только в том случае, если выбрана хотя бы одна вложенная фигура)
subs Список, содержащий все вложенные фигуры (создается только в том случае, если выбраны две или более вложенных фигур)
>>> ### Begin command Std_SendToPythonConsole
>>> try:
>>>     del(doc,lnk,obj,shp,sub,subs)
>>> except Exception:
>>>     pass
>>> 
>>> doc = App.getDocument("Unnamed")
>>> lnk = doc.getObject("Link")
>>> obj = lnk.getLinkedObject()
>>> shp = obj.Shape
>>> sub = obj.getSubObject("Edge10")
>>> subs = [obj.getSubObject("Edge10"),obj.getSubObject("Face3"),obj.getSubObject("Vertex5"),]
>>> ### End command Std_SendToPythonConsole

Example output: an edge, a face, and a vertex of a Link to a Part Box were selected

Применение

  1. Select a single object or one or more subshapes belonging to a single object.
  2. There are several ways to invoke the command:
    • Select the Edit → Send to Python Console option from the menu.
    • Select the Send to Python Console option from the Tree View context menu or 3D View context menu.
    • Use the keyboard shortcut: Ctrl+Shift+P.
  3. If required the Python Console opens.
  4. The Python Console receives the keyboard focus.

Примечания

  • Все ранее созданные переменные удаляются (перезаписываются новыми значениями) при каждом запуске команды.
  • If the selected object is a Link (App::Link) and the Linked object is derived from the Part::Feature class, the shp variable will be the shape of the Linked object. If the Link has been transformed or scaled and you want to access the scaled/transformed shape, you can do so with this code:
lnk_shp = Part.getShape(lnk)


Команда "Удалить"
Команда "Расположение..."
Меню "Правка"

Эта страница получена от https://wiki.freecad.org/Std_SendToPythonConsole

Свяжитесь с нами!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

©Команда FreeCAD. Авторы изображений (сверху вниз): ppemawm, r-frank, epileftric, regis, regis, rider_mortagnais, bejant.

Этот проект поддерживается: , KiCad Services Corp. и другие спонсоры

GitHubУлучшить эту страницу на GitHub