family-geometry
БесплатноБез исполняемых скриптовНе проверенCreating content inside Revit families. Covers reference planes, labelled dimensions, locked extrusions, formulas, shared parameters, visibility and graphics…
от pyrevitlabs★ 2 094 звезды на GitHubОб этом скилле
Family geometry
Read revit-scripting and family-editing first. Everything below runs in a family document: one the user has open, one from doc.EditFamily, or a new one from app.NewFamilyDocument(template_path). Pick template_path as the revit-files skill describes: template file names depend on the language of Revit, so check fam_doc.OwnerFamily.FamilyCategory after opening it.
from pyrevit.revit.db import create, query, update
The snippets were run in Revit 2024.1 on IronPython 2.7.12. The parametric box and the helpers were also run, with metric and imperial templates, in Revit 2024.1 (English) on IronPython 2.7.12 and CPython 3.12, and in Revit 2026 (English and German interface) on IronPython 3.4.2 and CPython 3.12. Nothing was run in Revit 2021 to 2023, 2025 or 2027.
Rules that decide whether a script works
Roll back before you close. If a script fails with a transaction open,
fam_doc.Close(False)infinallyraises "Close is not allowed when there is any open sub-transaction" and hides the real error. Keep the transaction in a variable and roll it back inexcept:fam_doc = app.NewFamilyDocument(template_path) t = DB.Transaction(fam_doc, "Build") try: t.Start() t.Commit() except Exception: if t.GetStatus() == DB.TransactionStatus.Started: t.RollBack() raise finally: fam_doc.Close(False)Transactions on the family document are needed for
Regenerate(),NewTypeand every edit. Settingfm.CurrentTypeoutside one fails.A family starts with no type.
fm.CurrentTypeisNoneandSetFormularaises "There is no valid family type" until you callfm.NewType("name").Plan views are
DB.ViewPlanwithViewType.FloorPlan; the Generic Model template gives its floor plan and its ceiling plan the same name, so filter byViewType, not by name. Elevations areViewType.Elevation; pick one byViewDirection: front(0, -1, 0), back(0, 1, 0), left(-1, 0, 0), right(1, 0, 0).Names are localized. The names of template planes, views and line patterns, the label that
AsValueString()gives an "Is Reference" setting, and the name of an unsaved family document (Familie24in German) follow the language of Revit. Find the built-in center planes withquery.get_reference_plane("center_left_right", doc=fam_doc)(also"center_front_back"). The API's exception messages stayed English in a German Revit.Units are feet in the family document, as everywhere in the API, whether the template is metric or imperial; the template only changes how Revit displays them. Convert the user's lengths first:
units.parse_length("600mm").Revit versions:
DB.GroupTypeIdandDB.SpecTypeId, used by everyAddParametercall below, exist from Revit 2022. Revit 2021 needsDB.BuiltInParameterGroup.PG_GEOMETRYandDB.ParameterType.LengthinAddParameterinstead (ParameterTypeis gone from 2023); testhasattr(DB, "GroupTypeId")to choose. That branch has not been run.
Parametric box: planes, dimensions, extrusion, locks
Build in this order, from an unhosted Generic Model template: it has no Width or Height parameter, so a template that already defines them makes AddParameter fail. The extrusion follows the parameters only when its faces are aligned to reference planes that dimensions drive.
fam_doc = app.NewFamilyDocument(template_path)
t = DB.Transaction(fam_doc, "Build box")
try:
fm = fam_doc.FamilyManager
plan = [v for v in DB.FilteredElementCollector(fam_doc).OfClass(DB.ViewPlan)
if not v.IsTemplate and v.ViewType == DB.ViewType.FloorPlan][0]
centre = query.get_reference_plane("center_left_right", doc=fam_doc)
t.Start()
width = fm.AddParameter("Width", DB.GroupTypeId.Geometry, DB.SpecTypeId.Length, False)
height = fm.AddParameter("Height", DB.GroupTypeId.Geometry, DB.SpecTypeId.Length, False)
fm.NewType("Default")
fm.Set(width, 2.0)
fm.Set(height, 3.0)
left = create.create_reference_plane("Left", (-1, -2), (-1, 2), plan, reference="left", doc=fam_doc)
right = create.create_reference_plane("Right", (1, -2), (1, 2), plan, reference="right", doc=fam_doc)
fam_doc.Regenerate()
create.create_labelled_dimension(plan, [left, right], (-1, -1.5), (1, -1.5), label=width, doc=fam_doc)
create.create_labelled_dimension(plan, [left, centre, right], (-1, -2.5), (1, -2.5),
equal_segments=True, doc=fam_doc)
level = DB.FilteredElementCollector(fam_doc).OfClass(DB.Level).FirstElement()
sketch_plane = DB.SketchPlane.Create(fam_doc, level.GetPlaneReference())
profile = DB.CurveArrArray()
profile.Append(create.create_curve_array([(-1, -0.5), (1, -0.5), (1, 0.5), (-1, 0.5)]))
extrusion = fam_doc.FamilyCreate.NewExtrusion(True, profile, sketch_plane, 3.0)
fam_doc.Regenerate()
create.align_faces_to_planes(extrusion, plan,
Установить family-geometry в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл family-geometry?
Creating content inside Revit families. Covers reference planes, labelled dimensions, locked extrusions, formulas, shared parameters, visibility and graphics, materials, and nested families. Use it for "build a parametric family", "add reference planes and dimensions", "lock the extrusion to the planes", "nest one family in another", "add a shared parameter to a family" and similar tasks. Read family-editing first for opening, saving and loading families.
Как установить скилл family-geometry?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл family-geometry запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic