Get position referenceplane in familyinstance

Get position referenceplane in familyinstance

sonicer
Collaborator Collaborator
1,271 Views
6 Replies
Message 1 of 7

Get position referenceplane in familyinstance

sonicer
Collaborator
Collaborator

Is it possible get position of referenceplane in familyinstance that is not aligned with some mass/object.

Only alone stay reference in familyinstance.

 

My way:

The referenceintersector does't detect this reference.

need other way.

 

need direction and position of this referenceplane.

 

thx.

0 Likes
1,272 Views
6 Replies
Replies (6)
Message 2 of 7

FAIR59
Advisor
Advisor
0 Likes
Message 3 of 7

sonicer
Collaborator
Collaborator

thanks...but I think it only show direction....

 

0 Likes
Message 4 of 7

FAIR59
Advisor
Advisor

From the dimension in the code, you could also find a point on the plane.

 

Howevere there is an alternative:

You can create a sketchplane using the reference, and find origin and normal from the plane of the sketchplane.

Reference r = inst.GetReferences(FamilyInstanceReferenceType.Left).FirstOrDefault();
if (r==null) return;
XYZ origin = XYZ.Zero;
XYZ normal = XYZ.Zero;
bool found=false; using (Transaction t = new Transaction(doc,"create sketchplane")) { t.Start(); SketchPlane sk = SketchPlane.Create(doc,r); if (sk!=null) { Plane pl = sk.GetPlane(); origin = pl.Origin; normal = pl.Normal;
found = true; } t.RollBack(); }

 

Message 5 of 7

aignatovich
Advisor
Advisor

Awesome!

 

I think we should call @jeremytammik to publish this solution in his TBC blog.

0 Likes
Message 6 of 7

jeremytammik
Autodesk
Autodesk

Dear Alexander,

 

With great pleasure!

 

Thank you for the suggestion.

 

Cheers,

 

Jeremy

 



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

0 Likes