Workplane by 2 planes and quadrant points

Workplane by 2 planes and quadrant points

NachoShaw
Advisor Advisor
154 Views
1 Reply
Message 1 of 2

Workplane by 2 planes and quadrant points

NachoShaw
Advisor
Advisor

Hi

 

I'm working on a miter tool for our internal panels and I'm finding getting quadrant points kinda clumsy. Anyone else solved this weird requirement for a workplane from 2 planes? I set up a collection of points using face1.Evaluator.Rangebox.x and rangebox.y and it mostly works, but not all. The plane is created in a opposing direction to what I need.

 

As a summary

I'm selecting 2 adjacent faces and and need to create a plane bisecting the 2 faces.

 

Thanks

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


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

J-Camper
Advisor
Advisor

I think this is hard to diagnose without more information about the particular situation.  This will create 2 planes, one in each direction based on the point used:

Dim pDoc As PartDocument = ThisDoc.Document
pDoc.ComponentDefinition.WorkPlanes.AddByTwoPlanes(pDoc.ComponentDefinition.WorkPlanes.Item(1), pDoc.ComponentDefinition.WorkPlanes.Item(2), ThisApplication.TransientGeometry.CreatePoint(1, 1, 0))
pDoc.ComponentDefinition.WorkPlanes.AddByTwoPlanes(pDoc.ComponentDefinition.WorkPlanes.Item(1), pDoc.ComponentDefinition.WorkPlanes.Item(2), ThisApplication.TransientGeometry.CreatePoint(-1, 1, 0))


It would be easy to find the axis formed between the planes, and you can use that axis's root point as a base, but knowing which direction to move the point in is rather vague without more context.

If you are using faces, you could do something like this to get the bisection point:

Dim pDoc As PartDocument = ThisDoc.Document
Dim AllNamedEntities As NamedEntities = iLogicVb.Automation.GetNamedEntities(pDoc)
Dim PlanarFace1 As Face = AllNamedEntities.FindEntity("Face0")
Dim PlanarFace2 As Face = AllNamedEntities.FindEntity("Face1")
Dim rBox As Box = PlanarFace1.Evaluator.RangeBox
For Each v As Vertex In PlanarFace2.Vertices
	If rBox.Contains(v.Point) Then Continue For
	rBox.Extend(v.Point)
Next
Dim BisectPoint As Point = rBox.MinPoint.Copy
Dim Translation As Vector = rBox.MinPoint.VectorTo(rBox.MaxPoint)
Translation.ScaleBy(.5)
BisectPoint.TranslateBy(Translation)

pDoc.ComponentDefinition.WorkPlanes.AddByTwoPlanes(PlanarFace1, PlanarFace2, BisectPoint)

You can get the faces without  naming them, but see image below for which faces I selected by named faces. 
temp_png.png

0 Likes