Skip to Content
Bear documentation

family

Import from bear/revit/family.

Interfaces

RevitAffine

Defined in: bear/revit/family.ts:50

c + Σ t[name]·value(name), feet.

Properties

PropertyType
cnumber
t?Record<string, number>

RevitConnector

Defined in: bear/revit/family.ts:134

A connector's face: where it is, which way it faces, how big it is.

Properties

PropertyTypeDescription
descriptionstring-
domainstringRevit's domain and system, e.g. "DomainPiping" / "OtherPipe".
height?RevitAffine-
originRevitPoint-
radius?RevitAffine-
refstringThe ref this connector publishes.
systemstring-
width?RevitAffine-
xVec3-
zVec3Outward direction (Revit's basis z) and in-plane x.

RevitFamilyOptions

Defined in: bear/revit/family.ts:419

Properties

PropertyTypeDescription
hosted?RevitHostedHow a hosted family sits in its host.
turn?numberDegrees about z (a quarter turn's multiple) the family's frame turns about its origin, so a part's length runs along x the way Bear's do.

RevitFamilyRecord

Defined in: bear/revit/family.ts:150

Properties

PropertyTypeDescription
connectorsRevitConnector[]-
divisionstring-
formsRevitForm[]-
manufacturerstring-
materialMaterialDescriptorShades what no form's own material does: by-category forms, faces a cut opens.
materialsRecord<string, MaterialDescriptor>The family's Revit materials its forms are drawn in, by Revit id.
namestring-
url?string-
validation?objectThe value that holds Revit's own configuration check, and what it says when it passes.
validation.okstring-
validation.valuestring-

RevitForm

Defined in: bear/revit/family.ts:114

Properties

PropertyTypeDescription
cuts?RevitSolidDef[]Void forms cut from this one.
idnumberRevit element id, for tracing a form back to the family.
material?stringIts Revit material, by id in the record's materials; none shades it in the record's material.
namestring-
repeat?objectA linear array's first member, the array moved to its last: count members in all, evenly between this one and one span away (whose own forms are the last member's); the ones between are copies of this.
repeat.countstring-
repeat.spanRevitPoint-
solid| RevitSolidDef | RevitSolvedTable-
visible?string[]The Yes/No values that must all be on to show it (its own, its nested instance's).

RevitHosted

Defined in: bear/revit/family.ts:482

How a hosted family sits in its host: the host faces it reads and its planes on them, from the family's values (see bear/revit/hosted.ts).

Properties

PropertyType
facesReadonly<Record<string, readonly [(props) => unknown, string]>>
mates(values, host) => readonly (Omit<Mate, "on"> & object)[]

RevitSolvedTable

Defined in: bear/revit/family.ts:106

A form whose sketch Revit solves non-linearly (a line that turns): one solved definition per tuple of the options that turn it, each still affine in the family's values. reason says which lines turn.

Properties

PropertyTypeDescription
entriesRecord<string, RevitSolidDef>By tupleKey of the keys' values.
keysstring[]-
kind"table"-
reasonstring-

Type Aliases

RevitCurve

type RevitCurve = 
  | {
  a: RevitPoint;
  b: RevitPoint;
  type: "line";
}
  | {
  a: RevitPoint | null;
  b: RevitPoint | null;
  center: RevitPoint;
  normal: Vec3;
  radius: RevitAffine;
  type: "arc";
};

Defined in: bear/revit/family.ts:57


RevitPoint

type RevitPoint = [RevitAffine, RevitAffine, RevitAffine];

Defined in: bear/revit/family.ts:55


RevitSolidDef

type RevitSolidDef = 
  | {
  end: RevitAffine;
  kind: "extrusion";
  loops: RevitCurve[][];
  normal: Vec3;
  start: RevitAffine;
}
  | {
  at: RevitPoint;
  kind: "sweep";
  path: RevitCurve[];
  profile: RevitCurve[][];
}
  | {
  bottom: RevitCurve[];
  bottomOffset: RevitAffine;
  kind: "blend";
  normal: Vec3;
  top: RevitCurve[];
  topOffset: RevitAffine;
}
  | {
  axis: Vec3;
  end: number;
  kind: "revolution";
  loops: RevitCurve[][];
  origin: RevitPoint;
  start: number;
};

Defined in: bear/revit/family.ts:68

Union Members

Type Literal
{
  end: RevitAffine;
  kind: "extrusion";
  loops: RevitCurve[][];
  normal: Vec3;
  start: RevitAffine;
}

Type Literal
{
  at: RevitPoint;
  kind: "sweep";
  path: RevitCurve[];
  profile: RevitCurve[][];
}
NameTypeDescription
atRevitPointThe point on the path the profile is drawn at.
kind"sweep"-
pathRevitCurve[]-
profileRevitCurve[][]-

Type Literal
{
  bottom: RevitCurve[];
  bottomOffset: RevitAffine;
  kind: "blend";
  normal: Vec3;
  top: RevitCurve[];
  topOffset: RevitAffine;
}

Type Literal
{
  axis: Vec3;
  end: number;
  kind: "revolution";
  loops: RevitCurve[][];
  origin: RevitPoint;
  start: number;
}
NameTypeDescription
axisVec3-
endnumber-
kind"revolution"-
loopsRevitCurve[][]-
originRevitPoint-
startnumberRadians.

RevitValue

type RevitValue = number | string | boolean;

Defined in: bear/revit/family.ts:44

A computed parameter value: Yes/No as boolean, numbers in Revit internal units.

Functions

definitionAt()

function definitionAt(form, values): RevitSolidDef;

Defined in: bear/revit/family.ts:176

A form's definition: its own, or Revit's for these values.

Parameters

ParameterType
formRevitForm
valuesValues

Returns

RevitSolidDef


evaluateAffine()

function evaluateAffine(a, values): number;

Defined in: bear/revit/family.ts:197

Parameters

ParameterType
aRevitAffine
valuesValues

Returns

number


formSolid()

function formSolid(form, values): Manifold;

Defined in: bear/revit/family.ts:265

A form's solid, its voids cut out, with an array's copies between its first and last.

Parameters

ParameterType
formRevitForm
valuesValues

Returns

Manifold


revitFamily()

function revitFamily<P>(
   record, 
   evaluate, 
   columns?, 
   options?
): PartDef<P, never, string>;

Defined in: bear/revit/family.ts:317

The part for one family. evaluate returns the family's values by Revit name; its props are the part's. columns names the options that make one configuration a different product from another: the BOM consolidates parts by kind and columns, so without them a 480 V and a 600 V set would be one line.

Type Parameters

Type Parameter
P extends object

Parameters

ParameterType
recordRevitFamilyRecord
evaluate(props, host) => Values
columns?(props) => PartColumn[]
options?RevitFamilyOptions

Returns

PartDef<P, never, string>


solidAt()

function solidAt(def, values): BrepSolid;

Defined in: bear/revit/family.ts:227

A form's definition at these values, project units.

Parameters

ParameterType
defRevitSolidDef
valuesValues

Returns

BrepSolid


tupleKey()

function tupleKey(values): string;

Defined in: bear/revit/family.ts:171

The one spelling of a tuple of numbers (lengths in feet, Yes/No as 0/1), shared by the importer and the part: to a billionth of a foot, so two spellings of one formula agree.

Parameters

ParameterType
valuesreadonly number[]

Returns

string

On this page