family-editing
БесплатноБез исполняемых скриптовНе проверенEditing Revit families. Covers opening a family from the project, family parameters, types and formulas, and loading the family back into the project. Use it…
от pyrevitlabs★ 2 094 звезды на GitHubОб этом скилле
Family editing
Read revit-scripting first. Check API names with lookup_revit_api. To create content inside a family (reference planes, dimensions, extrusions, nested families, visibility, materials), read family-geometry as well.
Where the family lives
Active document is a family (
get_context.document.is_familyis true):doc.FamilyManageris available directly. Change it inside transactions ondoc, as usual.Family used in a project: open a family document from the project, edit it, and load it back.
doc.EditFamilytakes aDB.Familyand returns an in-memory family document; make your edits where this snippet adds a type:family = doc.GetElement(family_id) fam_doc = doc.EditFamily(family) try: t = DB.Transaction(fam_doc, "Edit family") t.Start() try: fam_doc.FamilyManager.NewType("900 x 2100") t.Commit() finally: if t.HasStarted() and not t.HasEnded(): t.RollBack() from pyrevit.revit.db.create import FamilyLoaderOptionsHandler fam_doc.LoadFamily(doc, FamilyLoaderOptionsHandler()) finally: fam_doc.Close(False)
What the run guard covers here
The run guard, and the dry-run rollback, cover the project document only.
- In the family document: transactions are not rolled back by a dry run. They're discarded only because the family document is closed without saving.
- Failures in the family document are handled like the project's: warnings are removed and reported in
failures, and an error rolls back that transaction and fails the run withrevit_failure. Each entry names itsdocument. - The project change is
LoadFamily. It's part of the guarded run, so it's rolled back by a dry run and needs approval under policyask. - Close without saving: always call
fam_doc.Close(False), in afinally. - Reloading replaces the
Familyobject. AfterLoadFamilybrings an edited family back, theFamilyyou edited is no longer valid (IsValidObjectis false). Keep its name before editing, and look the family up again by name to read it afterwards. - No saving from a run: the guard blocks
SaveandSaveAsfor every document that was open, created or opened during the run, including a family fromEditFamilyorNewFamilyDocument; the call fails with "Saving failed" and the response lists it inblocked. Load the family into the project instead, and ask the user to save a family file in Revit when they want one (seerevit-files).
Family parameters
fm = fam_doc.FamilyManager
is_instance = False
param = fm.AddParameter("Frame Width", DB.GroupTypeId.Geometry, DB.SpecTypeId.Length, is_instance)
fm.SetFormula(param, "Width / 10")
Create a type with fm.NewType before SetFormula. To get the parameter and formula named when Revit rejects one, call pyrevit.revit.db.update.set_formula(fm, param, formula).
- Groups and specs are
ForgeTypeIds:DB.GroupTypeId.*andDB.SpecTypeId.*. Look them up withlookup_revit_api("GroupTypeId"). - Existing parameters:
fm.get_Parameter("Name"), orfm.Parameters. pyRevit has helpers:from pyrevit.revit.db import query, thenquery.get_family_parameter(name, fam_doc)andquery.get_family_parameters(fam_doc). - Shared parameters:
fm.AddParameter(external_definition, group, is_instance)takes a definition from the shared parameter file.
Types
- Existing types:
fm.Types, andfm.CurrentTypefor the one being edited. - New type:
fm.NewType("900 x 2100"). It becomes the current type. - Set a value for the current type:
fm.Set(param, value). Lengths are in feet. - Change several types: set
fm.CurrentType = family_typebefore eachSet.
Loading families from disk
- Easiest:
from pyrevit.revit.db.create import load_family, thenload_family(path, doc=doc). - Direct API:
doc.LoadFamily(path, FamilyLoaderOptionsHandler())returns a tuple(loaded, family). - Before placing a loaded type, activate it:
symbol.Activate(), thendoc.Regenerate().
Before you report done
- The family's types and parameter values, queried after loading, are the ones asked for.
- A geometry change was checked on a placed instance or in a view with
capture_view, or in the family itself with the preview infamily-geometry. - Every family document you opened is closed: it's no longer in
app.Documents. - The family file on disk is unchanged; any save is left to the user in Revit.
Установить family-editing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл family-editing?
Editing Revit families. Covers opening a family from the project, family parameters, types and formulas, and loading the family back into the project. Use it for "add a parameter to these families", "create door types", "fix family formulas" and similar tasks.
Как установить скилл family-editing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл family-editing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic