Determining the allowed rotation axis for a given FamilyInstance (?)

Determining the allowed rotation axis for a given FamilyInstance (?)

pbobz
Contributor Contributor
307 Views
1 Reply
Message 1 of 2

Determining the allowed rotation axis for a given FamilyInstance (?)

pbobz
Contributor
Contributor

 

Hi,

 

Anyone with a clue on how to get the element's axis of rotation ?

 

Depending on how the family has been made, I can rotate it around one axis only. But how, programmatically, determine this axis ?

 

Didn't find anything in the FamilyInstance ... looking for ReferencePlane, Host informations with not much success. May be there's a View dépendance information somewhere ?

 

Any help appreciated.

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

Anonymous
Not applicable

Not too long ago I posted the code that "aims" a FamilyInstance in 3d space. I forget the subject line. The posted code is not the official "answer" to the original post. The code is the result of learning the answer to a question related to the ultimate task. It was posted after the official "answer".

 

In order to do this "aiming" the FamilyInstance is required to be rotated on two different axes. The code shows how this is accomplished. Incidentally, the final plan for this code is to add one more rotation to the "aim" that rotates the FamilyInstance along the aiming line from the FamilyInstance to its target. The code works only on non-hosted FamilyInstances. One thing discovered during development is that most non-hosted family types can be rotated only in the workplane in which they are placed. I found Sprinklers to be the only family type that could rotate in any axis, so the special aiming family I use is built as a Sprinkler. I did not try temporarily changing the workplane in code to see if that would work. When trying to figure out why free families would not rotate I assumed that if I could not rotate them in any view other than the plan view then they would not be rotatable. Those same families by the way were rotatable if I was able to switch them to be Sprinkler in the family Editor.  

 

The code for picking a 3d point (not in the posting) uses a temporary workplane technique. You can easily find it online. If the workplane change is needed for your application then perhaps you can mine that technique from that code.

 

I hope this helps you in some way.