Miter two parts from an assembly

Miter two parts from an assembly

Rickgolf72
Contributor Contributor
350 Views
0 Replies
Message 1 of 1

Miter two parts from an assembly

Rickgolf72
Contributor
Contributor

Hi guys,

This is the first time posting to a forum, but I am having trouble even getting started with this.  I am trying to create a command that will miter two parts in a sub assembly from the top level assembly.

I am thinking that you can pick the 2 faces of the parts and create a bisecting work Plane, use that to trim the parts.

But I'm having trouble even starting to write this code. 

 

This should be the simplest part just getting creating a work plane, but I can't even get this to work, never mind getting it to work from an assembly.

 

Could someone tell me what I'm doing wrong with this code, to start with?

 

Dim oDoc As PartDocument
oDoc = ThisDoc.Document

Dim oDef As PartComponentDefinition

oDef = oDoc.ComponentDefinition


Dim Face1 As Object
Face1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select Face 1")

Dim Face2 As Object
Face2 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select Face 2")

Dim Point As Object
'Point = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPointEntities, "Select A Point")
Point = oDef.WorkPoints("Center Point")



Dim oWPlane As WorkPlane


oWPlane = oDef.WorkPlanes.AddByTwoPlanes(Face1, Face2,Point)

 Thank you for any help you can give me.

0 Likes
351 Views
0 Replies
Replies (0)