ChangeToReferenceLine() does not create normal reference lines

ChangeToReferenceLine() does not create normal reference lines

crapai
Advocate Advocate
280 Views
2 Replies
Message 1 of 3

ChangeToReferenceLine() does not create normal reference lines

crapai
Advocate
Advocate

I'm trying to create reference lines to use as a way to move elements inside a family. When I try the grips out in a project it moves the entire family instead of simply the element inside of the family.

 

The setup has pinned reference planes, also created with a script and parameters that control the offset. When I create the reference lines with the method below (from the linked post) it doesn't appear to create normal reference lines and I'm wondering if that may be causing some of my issues.

 

p = Plane.CreateByNormalAndOrigin(XYZ.BasisZ, XYZ(0, 0, 0))
sp = SketchPlane.Create(doc, p)

# Ref Line Symbol Vertical Center
llvc = Line.CreateBound(XYZ(0, 0, 0), XYZ(0, -0.583333, 0))
lineLabelVerticalCenter = doc.FamilyCreate.NewModelCurve(llvc, sp)
lineLabelVerticalCenter.ChangeToReferenceLine()

 

https://forums.autodesk.com/t5/revit-api-forum/how-to-create-a-reference-line-in-revit-api/td-p/9945... 

 

When I click on the reference line and compare it's properties it looks more like a model line. Notice that it doesn't have a work plane and it has the "Visibility" parameter which normal reference lines do not have.

crapai_0-1742583353626.png

This is a manually created reference line:

crapai_1-1742583438953.png

I've added two families to the post. Inside a project the script created family will move when the grips are dragged while the manually created one will stay in place and only the reference lines will move.

 

0 Likes
281 Views
2 Replies
Replies (2)
Message 2 of 3

crapai
Advocate
Advocate

Any idea of what is going on here or to make actual reference lines?

0 Likes
Message 3 of 3

ctm_mka
Collaborator
Collaborator

my only thought is to try getting the sketch plane of ref level versus creating one from scratch, unless theres an api method for associating to a level. i wouldnt worry about the visibility check mark, it still says its a ref line, and as long as it behaves that way, is not a problem.

0 Likes