Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Need Journal example for setting the clearance plane of Point-To-Point

I would like to find an example using NXOpen with Visual Basic to set the Avoidance properties of a Point-To-Point (drill) operation. Very little information is recorded when I attempt to record a Journal doing this. Any examples would be greatly appreciated.

9 REPLIES

Re: Need Journal example for setting the clearance plane of Point-To-Point

PTP is "legacy" code and Siemens has stated they will NOT support this in common API :-(

 

You have 2 choices:

- Use GRIP/NC to do the work and use PTP operations

- Use NX10 and the new holemaking operation type (which **should** be completely supported by journaling) (note holemaking is there in NX8 or 9, maybe earlier, but, if I understand correctly, had limited functionality.  Being as I'm on NX7.5 I haven't had a chance to play yet)

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Need Journal example for setting the clearance plane of Point-To-Point

I had a small attempt at automating hole making at NX8.5.

I'm no much of a CAM programmer anyway, but even trying to get it to work interactively was confusing to say the least. Programmatically was worse.

This was purely for drilling pruposes and in the end we used some code a colleague wrote that created a User Defined Operation instead.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Need Journal example for setting the clearance plane of Point-To-Point

There is no journaling for legacy point-to-point operations. GRIP is probably your best choice.

 

That being said, I would not invest in automating these, as they are legacy.

For NX9 and later, use the new drilling operations in the hole_making template.

In fact, if you specify the clearance plane in the MCS group, every operation will inherit it OOTB.

Mark Rief
Retired Siemens

Re: Need Journal example for setting the clearance plane of Point-To-Point

Thank you for the replies.

 

It is good to know that Point-to-Point operations will be phased out. I have NX8 and NX9, so I am starting to look at Hole Making operations. I am having the same issue with Hole Making that I had with Point-to-Point, which appears to be any drilling operation of subtype 450.

 

If I create a HoleMakingBuilder, I see no method or function within the builder to get or set the clearance plane. That is the same issue I had with Point-To-Point.

 

With the PlanarOperationBuilder or the SurfaceContourBuilder, I can access the NonCuttingBuilder function. Within that I can access the ClearanceBuilder, or in the case of theSurfaceContourBuilder it is the TransferCommonClearanceBuilder.

 

To be honest I am rather confused as to why different types of milling operations have separate types of NonCuttingBuilders. I am trying to create a program in NXOpen to copy the Non-Cutting parameters from one operation to a selection of other operations. If each operation has a clearance plane, then it shouldn't be so difficult to share them. I know that clearance planes can be inherited from the MCS, but each MCS can only hold one clearance option.

 

There either has to be a way to set the avoidance options programmatically on a drilling operation, or it is impossible due to the lack of the code's (NXOpen) ability to do so. I am hoping to find that it is possible and someone can give a snippet of code demonstrating it.

 

Re: Need Journal example for setting the clearance plane of Point-To-Point

I just recorded a journal to create a drilling operation, change the clearance from inherited to plane, and define a plane. I play it back, and it works fine, so it looks like the functionality is there - I would examine a recorded journal for guidance.

 

Mark Rief
Retired Siemens

Re: Need Journal example for setting the clearance plane of Point-To-Point

Mark - what version did you use?

 

rvogel - you might need to try in NX10.

Also, (this needs to be confirmed by Siemens) I would think PTP is not being "phased out", but rather all development/enhancement is/has been being stopped, and all new stuff will go into holemaking.  I would hope legacy PTP operations in existing parts would still work "as is" for a very long time...

 

 

 

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Solution
Solution
Accepted by topic author rvogel
‎08-26-2015 04:32 AM

Re: Need Journal example for setting the clearance plane of Point-To-Point

I recorded in 9.0.3 MP6. I think these are the relevant lines:

 

holeDrillingBuilder1.NonCuttingBuilder.TransferClearance.ClearanceType = CAM.NcmClearanceBuilder.ClearanceTypes.Plane

plane1.SetMethod(PlaneTypes.MethodType.Distance)

Dim geom1(0) As NXObject
Dim extractFace1 As Features.ExtractFace = CType(workPart.Features.FindObject("LINKED_FACE(3)"), Features.ExtractFace)

Dim face1 As Face = CType(extractFace1.FindObject("FACE 1 {(221.9376866176109,356.4752015919777,200) LINKED_FACE(3)}"), Face)

geom1(0) = face1
plane1.SetGeometry(geom1)

plane1.SetFlip(False)

plane1.SetReverseSide(False)

Dim expression3 As Expression
expression3 = plane1.Expression

expression3.RightHandSide = "10"

plane1.SetAlternate(PlaneTypes.AlternateType.One)

plane1.Evaluate()

Dim geom2(-1) As NXObject
plane1.SetGeometry(geom2)

plane1.SetMethod(PlaneTypes.MethodType.FixedZ)

Dim geom3(-1) As NXObject
plane1.SetGeometry(geom3)

Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)
plane1.Origin = origin1

Dim matrix1 As Matrix3x3
matrix1.Xx = 1.0
matrix1.Xy = 0.0
matrix1.Xz = 0.0
matrix1.Yx = 0.0
matrix1.Yy = 1.0
matrix1.Yz = 0.0
matrix1.Zx = 0.0
matrix1.Zy = 0.0
matrix1.Zz = 1.0
plane1.Matrix = matrix1

plane1.SetAlternate(PlaneTypes.AlternateType.One)

plane1.Evaluate()

plane1.SetMethod(PlaneTypes.MethodType.FixedZ)

holeDrillingBuilder1.NonCuttingBuilder.TransferClearance.PlaneXform = plane1

plane1.SetMethod(PlaneTypes.MethodType.FixedZ)

Dim geom4(-1) As NXObject
plane1.SetGeometry(geom4)

Dim origin2 As Point3d = New Point3d(0.0, 0.0, 123.456)
plane1.Origin = origin2

Dim matrix2 As Matrix3x3
matrix2.Xx = 1.0
matrix2.Xy = 0.0
matrix2.Xz = 0.0
matrix2.Yx = 0.0
matrix2.Yy = 1.0
matrix2.Yz = 0.0
matrix2.Zx = 0.0
matrix2.Zy = 0.0
matrix2.Zz = 1.0
plane1.Matrix = matrix2

plane1.SetAlternate(PlaneTypes.AlternateType.One)

plane1.Evaluate()

holeDrillingBuilder1.NonCuttingBuilder.TransferClearance.PlaneXform = plane1

Dim markId4 As Session.UndoMarkId
markId4 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Non Cutting Moves")

theSession.DeleteUndoMark(markId4, Nothing)

Dim markId5 As Session.UndoMarkId
markId5 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Non Cutting Moves")

theSession.DeleteUndoMark(markId5, Nothing)

theSession.SetUndoMarkName(markId3, "Non Cutting Moves")

 

Mark Rief
Retired Siemens

Re: Need Journal example for setting the clearance plane of Point-To-Point

Thank you! This helps. I have been recording Journals on various operations with little or no success on this. The type of operation you have here is a different one than I was interested in, but this helps. I might need to look into this type of operation for drilling so the NXOpen code will function with it as well as other mill operations. Thanks again.

Re: Need Journal example for setting the clearance plane of Point-To-Point

You're welcome!

To reitterate - this will never work on the legacy operations you see when you set the template type to drilling. You need to use the drilling operations you see when you set the template type to hole_making.

Mark Rief
Retired Siemens