Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to create a dimension between a reference line and plane and I'm getting and error saying input are not satisfied. It looks like from the API that I am meeting everything. What am I doing wrong?
Here is the error on line 36 below:
Exception: One of the conditions for the inputs was not satisfied. Consult the documentation for requirements for each argument.
t = Transaction(doc, "pyRevit - Create Reference Plane")
famMan = doc.FamilyManager
t.Start()
# Parameters
# Label __ Left Right
famMan.AddParameter("Label __ Left Right", GroupTypeId.Constraints, SpecTypeId.Length, True)
# Label __ Off Wall
famMan.AddParameter("Label __ Off Wall", GroupTypeId.Constraints, SpecTypeId.Length, True)
# Label_Dim_LeftCorrection
famMan.AddParameter("Label_Dim_LeftCorrection", ForgeTypeId(), SpecTypeId.Length, True)
# Label_Dim_OffsetFromWallCorrection
famMan.AddParameter("Label_Dim_OffsetFromWallCorrection", ForgeTypeId(), SpecTypeId.Length, True)
p = Plane.CreateByNormalAndOrigin(XYZ.BasisZ, XYZ(0, 0, 0))
sp = SketchPlane.Create(doc, p)
# Ref Plane Label Anchor
refSymbolAnchorLeft = doc.FamilyCreate.NewReferencePlane(XYZ(-3,-1,0),XYZ(-3,1,0), XYZ(0,0,1), cView)
refSymbolAnchorLeft.Name = "Symbol Anchor"
refSymbolAnchorLeft.Pinned = True
refSymbolAnchorLeft.LookupParameter("Is Reference").Set(12)
# Ref Line Label Vertical Center
lsvc = Line.CreateBound(XYZ(2, -2, 0), XYZ(2, -4, 0))
lineSymbolVerticalCenter = doc.FamilyCreate.NewModelCurve(lsvc, sp)
lineSymbolVerticalCenter.ChangeToReferenceLine()
# Create Dimension
ra = ReferenceArray()
ra.Append(refSymbolAnchorLeft.GetReference())
ra.Append(lineSymbolVerticalCenter.GeometryCurve.Reference)
dimline = Line.CreateBound(XYZ(-3, -1, 0), XYZ(2, -4, 0))
dim = doc.FamilyCreate.NewLinearDimension(cView, dimline, ra)
t.Commit()
Solved! Go to Solution.