Alignment reference plane.

Alignment reference plane.

Anonymous
Not applicable
1,488 Views
9 Replies
Message 1 of 10

Alignment reference plane.

Anonymous
Not applicable

Hello,

I have an alignment problem. I want to align two reference planes in a family document. But I get this error:

 

"one of the conditions for the inputs was not satisfied. Consult the documentation for requirements for each argument."
 
doc : family document with several reference plane.
 
 
Extrait du code :
 
View pViewPlan = findElement(typeof(ViewPlan), "Niveau de réf.", doc) as View;
ReferencePlane refLeftdocFamily = findElement(typeof(ReferencePlane), "Gauche", doc) as ReferencePlane;
ReferencePlane refRightdocFamily= findElement(typeof(ReferencePlane), "Droite", doc) as ReferencePlane;
 
transaction = new Transaction(doc);
transaction.Start("Alignment");
doc.FamilyCreate.NewAlignment(pViewPlan, refLeftdocFamily.Reference, refRightdocFamily.Reference); "Here this line causes the error described above"
transaction.Commit();
 
Merci d'avance.
 
Bonne journée.
0 Likes
1,489 Views
9 Replies
Replies (9)
Message 2 of 10

Joe.Ye
Alumni
Alumni
Cannot see the cause of this problem with these info.
Are the two reference plane parallel?



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 3 of 10

Anonymous
Not applicable

Yes,  I have two reference plane parallel

 

But I read in the revit api 2013, no alignment of two reference plane

 

These two references must be one of the following combinations:

  • 2 planar faces
  • 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).

 

 

0 Likes
Message 4 of 10

Joe.Ye
Alumni
Alumni

Hi Bonne journée,

You got. This API doesn't support two reference plane.

You can just move one reference and make it aligning with the other.


Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 5 of 10

Anonymous
Not applicable
Can you explain the methods to do ?

thank you
0 Likes
Message 6 of 10

Joe.Ye
Alumni
Alumni
Hi Bonne,

You can use ElementTransformUtils.MoveElement() to move one reference plane.

public static void MoveElement(
Document document,
ElementId elementToMove,
XYZ translation
)


Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 7 of 10

Anonymous
Not applicable

The problem is that I can not align a reference plane in a nested in another family that has reference plane family.

 

explanation:

 

family A

family B

 

Family B is nested in the family A, these families have reference planes. I want to bring a family plan B on a family plan A. The method can not move market if the plans are on the same document.

0 Likes
Message 8 of 10

Joe.Ye
Alumni
Alumni
Sorry, I am not quite clear of the description.
Why you cannot align a reference plan in a nested with another family?
What's the problem in this situation?
Thanks for your more info.


Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 9 of 10

Anonymous
Not applicable

adn referencePlance.PNG

 

I have 2 families, F01, F02. I load F02 in  F01. And I inserted the point XYZ (0,0,0).

I edited the F02 family located in the F01 family to get his reference plane "Axe Gauche".

I want to align the reference plane "Axe Gauche" (F02) with the plane of reference "Axe Centre" (F01).

Is this possible?

0 Likes
Message 10 of 10

Luis_Salazar
Participant
Participant
Can you please create an example of a simple alignment? I am struggling with that. The movie to see how create an alignment is not clear.
0 Likes