Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

get face from datum plane create with line and angle

Valued Contributor
Valued Contributor
Hi, we have created a plane with angle and line by hand. Now we need to get the face, volumina and the angle of the face(face is highlight green in the picture). We select the plane by the following code. Dim ObjTag() As NXOpen.Tag = Nothing SketchPlaneTag = NXOpen.Tag.Null response = SelectMenue(ObjTag, mask, "select plane") Try SketchPlaneTag = ObjTag(0) Sketch1 = create_sketch(SketchPlaneTag) Sketch1.Activate(Sketch.ViewReorient.False) Dim aPlane As DatumPlane = Sketch1.AttachPlane Thanks for your help. Frank
2 REPLIES

Re: get face from datum plane create with line and angle

Valued Contributor
Valued Contributor

Hi Frank

 

I had a quick look and I think I found what you are asking. I haven't tried it but this should give you what you are looking for if I understood correctly.

I think you will have to give that Datum  Tag to a user function AskFeatureOfDatum from which you will get a Tag of a DatumPlaneFeature. You can use the datum feature for the builder: 


datumPlaneBuilder1 = workPart.Features.CreateDatumPlaneBuilder(datumfeature);

Plane plane1=datumPlaneBuilder1.GetGeometry()

plane1.GetGeomtry()  - this will give you NxObject[] where one is the face used to create that datum. 

 

Hope it works.

 

Re: get face from datum plane create with line and angle

Valued Contributor
Valued Contributor
Hi Jakov, thanks for your help. I got a solution as attached: Dim datumPlane1 As DatumPlane = NXObjectManager.Get(SketchPlaneTag) Dim datumPlaneBuilder1 As NXOpen.Features.DatumPlaneBuilder = Nothing datumPlaneBuilder1 = workPart.Features.CreateDatumPlaneBuilder(datumPlane1.Feature) Dim plane1 As NXOpen.Plane = Nothing plane1 = datumPlaneBuilder1.GetPlane() 'array for nxobjext, where list(0) is "FACE" Dim list() As NXObject = plane1.GetGeometry() Dim markId1 As NXOpen.Session.UndoMarkId = Nothing markId1 = S.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Edit Object Display") Dim displayModification1 As NXOpen.DisplayModification = Nothing displayModification1 = S.DisplayManager.NewDisplayModification() displayModification1.ApplyToAllFaces = True displayModification1.ApplyToOwningParts = False 'set color displayModification1.NewColor = 36 Dim objects4(0) As NXOpen.DisplayableObject objects4(0) = list(0) displayModification1.Apply(objects4) S.UpdateManager.DoUpdate(markId1) This solutions works fine for me. Best regards Frank