×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Find MCS used for CAM Operation in NX Open

Find MCS used for CAM Operation in NX Open

Find MCS used for CAM Operation in NX Open

(OP)
Can anyone shed any light on how to get the name of the MCS used in an operation in NX Open (vb.net)??

I tried

theUFsession.Param.AskTagValue(myoperation.tag, 59, tvalue)

which fills a tag value of what I thought whas the MCS. I then just thought I would need to extract the name using

theUFsession.Obj.Askname(tvalue,strMCSname)

but this gives an error.

Any clues anyone? Many Thanks.

RE: Find MCS used for CAM Operation in NX Open

The tag you get is for the CSYS object.
I think what you are looking for is the geometry group in the Operation Navigator that has that CSYS selected for the MCS - correct?

I don't have an example, but I think you need to climb up the geometry parent tree from the operation, and find all the orient groups in the heirarchy. Then, look in each one to see if the CSYS you are looking for is selected as MCS.

Mark Rief
NX CAM Customer Success
Siemens PLM Software

RE: Find MCS used for CAM Operation in NX Open

(OP)
Thanks for the reply Mark, I was hoping there was a direct way of getting hold of it.

I knife and forked something together that does the job, albeit a bit clunky if you ask me! Here is some code for anybody needing it...You could probably use a While Loop rather than some IF statements to work your way up the geometry tree.

Dim sOpName as string = "NAME_OF_YOUR_OPERATION"
Dim operation As CAM.Operation
operation = CType(workPart.CAMSetup.CAMOperationCollection.FindObject(sOpName), CAM.Operation)

'search up the geometry tree to find the mcs
Dim strMCSname As String = ""
Dim MCStag As New Tag

Dim grp1 As CAM.NCGroup = operation.GetParent(CAM.CAMSetup.View.Geometry)
Dim camObject1 As CAM.CAMObject = NXOpen.Utilities.NXObjectManager.Get(grp1.Tag)
If TypeOf camObject1 Is CAM.OrientGeometry Then
strMCSname = grp1.Name
MCStag = grp1.Tag
Else
Dim grp2 As CAM.NCGroup = grp1.GetParent()
Dim camObject2 As CAM.CAMObject = NXOpen.Utilities.NXObjectManager.Get(grp2.Tag)
If TypeOf camObject2 Is CAM.OrientGeometry Then
strMCSname = grp2.Name
MCStag = grp2.Tag
Else
Dim grp3 As CAM.NCGroup = grp2.GetParent()
Dim camObject3 As CAM.CAMObject = NXOpen.Utilities.NXObjectManager.Get(grp3.Tag)
If TypeOf camObject3 Is CAM.OrientGeometry Then
strMCSname = grp3.Name
MCStag = grp3.Tag
Else
MsgBox("CANT FIND MCS FOR OP:" & sOpName)
End If
End If
End If

MsgBox("MCS=" & strMCSname & " tag=" & MCStag.ToString)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources