Add workplane by selected face

Add workplane by selected face

NachoShaw
Advisor Advisor
434 Views
2 Replies
Message 1 of 3

Add workplane by selected face

NachoShaw
Advisor
Advisor

Hi

 

How can i add a workplane by selecting a face? I need to select a face then add a workplane to that face. I am working in a part file only

 

Thanks

 

 

Nacho

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
Accepted solutions (1)
435 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

Something like this?

 

Sub WorkPlaneOffset()

 

Dim oApp As Inventor.Application
Set oApp = ThisApplication

 

Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument

 

Dim oFace As Face
Set oFace = oApp.CommandManager.Pick(kPartFaceFilter, "Select Face")

 

Dim dblOffset As Double
dblOffset = 0

 

Dim oWorkPlane As WorkPlane
Set oWorkPlane = oDoc.ComponentDefinition.WorkPlanes.AddByPlaneAndOffset(oFace, dblOffset)

 

End Sub

0 Likes
Message 3 of 3

NachoShaw
Advisor
Advisor

Hi

 

Perfect mate thanks. My code attempt was almost identical albeit i had a PartDefinition that i think wasnt allowing it to work.

 

Thanks again

 

 

Nacho

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