cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Tool Path on modified Body

Pioneer
Pioneer

Hello there,

 

our NX Open Application is as follows:

- loading an existing *.prt (incl. BaseBody) - the BaseBody has an existing tool path on a single surface

- create new body (partBody)

- Boolean operation which leads to a reduced version of BaseBody and its surface (using booleanBuilder)

- (re-)generate the tool path on the reduced surface

- create CLSF

- save in new *.prt

 

we don't get any errors but the CLSF is actually wrong, so we do have to reopen the new part and click create operation manually to receive the proper tool path.

 

I assume that the result of booleanbuilder is not used by the generate Tool Path method:

 

private void GenerateToolPath()
{
NXOpen.CAM.CAMObject[] objects1 = new NXOpen.CAM.CAMObject[1]; 
objects1[0] = NxCamOperation; //NXCamOperation if of type NXOpen.CAM.Operation
NXOpen.CAM.CAMSetup setup = NxPart.GetWorkPart().CAMSetup;     
setup.GenerateToolPath(objects1);                            //Generate Tool Path
NxPart.ShowStatus(NxOperationName + "  GenerateToolPath  finished");
}

Do i have to handle the result of boolean builder and assign it in the NnCamOperation?

The Code for the boolean operation is:

 

 

        public void IntersecteBody(Body BaseBody, Body partBody)
        {
            NXOpen.Features.BooleanBuilder booleanBuilder = workPart.Features.CreateBooleanBuilderUsingCollector(null);
            NXOpen.GeometricUtilities.BooleanRegionSelect booleanRegionSelect = booleanBuilder.BooleanRegionSelect;
            booleanBuilder.Operation = NXOpen.Features.Feature.BooleanType.Intersect;
            // set the first target
            booleanBuilder.Targets.Add(BaseBody);

            TaggedObject[] targets1 = new TaggedObject[1];
            targets1[0] = BaseBody;
            booleanRegionSelect.AssignTargets(targets1);

            ScCollector scCollector = workPart.ScCollectors.CreateCollector();
            //set the Cube 
            Body[] Intersectebodies = new Body[1];
            Intersectebodies[0] = partBody;
            //set up intersction rule
            BodyDumbRule bodyDumbRule1 = workPart.ScRuleFactory.CreateRuleBodyDumb(Intersectebodies);
            SelectionIntentRule[] selectionIntentRule = new SelectionIntentRule[1];
            selectionIntentRule[0] = bodyDumbRule1;
            scCollector.ReplaceRules(selectionIntentRule, false);
            //commit
            booleanBuilder.ToolBodyCollector = scCollector;
            booleanBuilder.Commit();
            booleanBuilder.Destroy();
        }

 

Please ask if you have any more questions. Unfortunately i cannot post all the code here.

I hope you can give me any thoughts about the problem.

 

Thanks in advance.

 

Felix

 

 

7 REPLIES

Re: Generate Tool Path on modified Body

What is the operation type, and what geometry does it reference? 

Have you tried setting the preference to force regenerate? 

Mark Rief
Retired Siemens

Re: Generate Tool Path on modified Body

Pioneer
Pioneer

Operation type is variable contour.

 

How can i set the preference you mention?

Re: Generate Tool Path on modified Body

Esteemed Contributor
Esteemed Contributor

The customer default mentioned doesn't help in this case, since it is only useful if you use smart tool path generation.

There is no setting to automatically regenerate the tool path when the geometry changes.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Generate Tool Path on modified Body

Esteemed Contributor
Esteemed Contributor

For your problem:

  1. is the entire body selected as geometry?
  2. do you update the model after you create the intersection?
  3. have you specified a milling area?

If you have selected the body as the milling geometry and the milling area is able to automatically update, you just have to issue a model update after the design change and before the tool path generation.

You could also try the following sequence:

  1. change the design
  2. save as new part
  3. regenerate the tool path

Saving the part file should make sure that the model gets updated.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Generate Tool Path on modified Body

Pioneer
Pioneer

All I specify is the part geometry and the drive geometry.

Projection vector is Tool axis and tools axis is relative to drive (if this matters)

The entire

 

There is no update fo the model after the intersection in my code.

is it necessary to update

theSession.Parts.Work

maybe?

 

Is there a common way to update the workpart?

Re: Generate Tool Path on modified Body

Esteemed Contributor
Esteemed Contributor

There should be a remark telling you how to update at the description of the modeling function in the NXOpen API reference.

In general the UpdateManager namespace is used to update the model, and updating is mandatory to get any changes applied.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Generate Tool Path on modified Body

Pioneer
Pioneer

Thanks four your help.

Save, re-opening and generating tool path helped.

The tool path is correct now.