Align FamilyInstances on Named Reference Planes

Align FamilyInstances on Named Reference Planes

Anonymous
Not applicable
412 Views
1 Reply
Message 1 of 2

Align FamilyInstances on Named Reference Planes

Anonymous
Not applicable

I’ve created two FamilyInstance objects set parametric values and now I want to align them using two named reference planes. I found code which allows you to align given a view, FamilyInstance, direction, and endpoint’s X.

 

https://forums.autodesk.com/t5/revit-api-forum/newalignment-to-align-family-instance-reference-plane...

 

However I need to be able to target reference planes by name to assure I’m aligning on the correct planes. Using direction and end points selected in another process has proven not to be reliable.

0 Likes
413 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk

Dear Michael,

 

Thank you for your query.

 

Have you looked at the Family API samples?

 

I think they demonstrate exactly what you are asking for:

 

 

Lab 1 - Create Rectangular Column

 

  • Check the family context.
  • Create a simple solid using extrusion.
  • Set alignments.
  • Add types.

 

Classes and methods:

 

  • doc.IsFamilyDocument()
  • doc.OwnerFamily.FamilyCategory.Name
  • doc.FamilyCreate.NewExtrusion()
  • doc.FamilyCreate.NewAlignment()
  • familyMgr = doc.FamilyManager
  • familyMgr.NewType()
  • familyMgr.Parameter(); familyMgr.Set()

The most up-to-date versions are available on GitHub:

 

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes