How to add a parallel plane?

Creator
Creator

Hi all!

     I want to add a parallel plan in currnet partdocument.This is my code:

*****************************************************************************

Dim objRPlanes As SolidEdgePart.RefPlanes = PartDoc.RefPlanes

Dim objFace As SolidedgeGeometry.Face = PartDoc.CoordinateSystems.Item(1).Plane(SolidEdgePart.CoordinateSystemFeatureConstants.seCoordSysYZPlane)
Dim R_P As SolidEdgePart.RefPlane = objRPlanes.AddParallelByDistance(ParentPlane:=objFace, Distance:=0.02, NormalSide:=0)

R_P.Visible = True      'At the position, I can see "R_P".

PartDoc.Save()           'At this position, "R_P" missed.

*****************************************************************************

Prior to this, the "objRPlanes.Count" is 3(XY,YZ,ZX). After this, the "objRPlanes.Count" is 4.

After I closed the "PartDoc" and re-opened, the added refplane is missing. The "objRPlanes.Count" is still 3(XY,YZ,ZX).

Why?

Thanks!

1 REPLY

By default, SE creates a local plane, so to make sure tha...

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

By default, SE creates a local plane, so to make sure that the plane exists globally, add the "Local:=False" parameter to the AddParallelByDistance call.

Otherwise, unused local planes are cleared during save.