Create/Update a plane and "FlipNormal" (Part file)

Create/Update a plane and "FlipNormal" (Part file)

llorden4
Collaborator Collaborator
569 Views
2 Replies
Message 1 of 3

Create/Update a plane and "FlipNormal" (Part file)

llorden4
Collaborator
Collaborator

I am having trouble flipping a plane, I believe I've done this before simply by adding "oWorkPlane.FlipNormal = True" to the code but I'm getting an "Expression is a value and therefore cannot be the target of an assignment" error.  Doing a bit of digging and not finding much to help me figure this out, best I've found is here.

 

Here's a snippet of what I've been experimenting with, I've REM'med out attempts I've made that have failed:

'DXF plane manager
PlaneFound = False
For Each oWorkPlane In oCompDef.WorkPlanes
	If oWorkPlane.Name = "DXF Plane" Then PlaneFound = True
Next
oFace = iLogicVb.Automation.GetNamedEntities(ThisDoc.Document).TryGetEntity("Flat " & CStr(StartFlat))
If PlaneFound Then																				'If plane exists, then ensure placement
	oCompDef.WorkPlanes.Item("DXF Plane").SetByPlaneAndOffset(oFace, 0)
	'oCompDef.WorkPlanes.Item("DXF Plane").FlipNormal.SetByPlaneAndOffset(oFace, 0)	'fails
	oCompDef.WorkPlanes.Item("DXF Plane").Grounded = True
	oCompDef.WorkPlanes.Item("DXF Plane").AutoResize = False
	oCompDef.WorkPlanes.Item("DXF Plane").Visible = False
	'Call WorkPlane.FlipNormal("DXF Plane", "X") 				'fails
	'oCompDef.WorkPlanes.Item("DXF Plane").FlipNormal()			'fails
	'oCompDef.WorkPlanes.Item("DXF Plane").FlipNormal = True	        'fails
Else																							'Else create the plane
	oWorkPlane = oCompDef.WorkPlanes.AddByPlaneAndOffset(oFace, 0, False)
	 oWorkPlane.Name = "DXF Plane"
	 oWorkPlane.Visible = False
	 oWorkPlane.AutoResize = False
	 oWorkPlane.Grounded = True
End If  

The plane is created atop a desired "face", anyone know the correct syntax to reach my desire of flipping this plane?

Autodesk Inventor Certified Professional
0 Likes
Accepted solutions (1)
570 Views
2 Replies
Replies (2)
Message 2 of 3

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

Do not set Workplane.Grounded to true and

oCompDef.WorkPlanes.Item("DXF Plane").FlipNormal()

will work.


R. Krieg
RKW Solutions
www.rkw-solutions.com
Message 3 of 3

llorden4
Collaborator
Collaborator

I could have sworn I tried that, but alas, there lies the solution.  Thank you!

Autodesk Inventor Certified Professional
0 Likes