Alignment between 2 reference planes or between the family and a reference plane

Alignment between 2 reference planes or between the family and a reference plane

Anonymous
Not applicable
1,195 Views
4 Replies
Message 1 of 5

Alignment between 2 reference planes or between the family and a reference plane

Anonymous
Not applicable

I am trying to align two reference planes ,

 

First reference plane is the work plane for the family , I need to align this to another reference plane , so if I move any of these planes the family needs to move along with it, I tried the below piece of code, but got the following error :

 

doc.FamilyCreate.NewAlignment(view,Plane1.Reference, Plane2.Reference);

 

Exception : One of the conditions for the inputs was not satisfied. Consult the documentation for requirements for each argument.

 

Could you please help me in this.

 

Plane1 : IsReference : Front

 

Plane2 : IsReference : Weak Reference

0 Likes
1,196 Views
4 Replies
Replies (4)
Message 2 of 5

mikako_harada
Community Manager
Community Manager

Hi autodesksdsd, 

 

One thing you may want to check is if those two references are already in the aligned position when you apply an alignment.

 

This is different from UI.  In UI, when you apply an alignment, Revit calculates the location. But in API, this is not the case.  

Here is what the documentation (.chm file) says.Note the last sentence: 

 

>>>>

ItemFactoryBase::NewAlignment Method

 

Remarks

 

These two references must be one of the following combinations:

  • 2 planar faces
  • planar face and reference plane
  • 2 lines
  • line and point
  • line and reference plane
  • 2 arcs
  • 2 cylindrical faces

These references must be already geometrically aligned (this function will not force them to become aligned).

<<<< 

 


Mikako Harada
Developer Technical Services
0 Likes
Message 3 of 5

Anonymous
Not applicable

Hi Mikako, 

 

Thanks for replying, in Revit UI when i choose alignment it allows me to select two planes and i align them and lock, next step i try to move the plane , the family moves along with it, mainly my problem is i want to align 3 planes to a same family.

 

Do you have a solution to this.

 

Thanks in advance.

 

Regards,

Supriya P

0 Likes
Message 4 of 5

mikako_harada
Community Manager
Community Manager

Hi Supriya, 

 

I'm not sure if I fully understand your question.  But typically, you create a reference and aligh visible objects to it, such as a face of solid. The same idea using UI, too.  

 

 


Mikako Harada
Developer Technical Services
0 Likes
Message 5 of 5

Anonymous
Not applicable

Hi Mikako,

 

Is it possible  to add two reference planes to a single family ? when i move either of them i need family also to move along with it .

 

or is it possible to change the work plane of the family ?

 

Regards,

Supriya P

 

 

0 Likes