Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

ATP chaining failure


Recommended Posts

Hello,

I've been recently trying to use ATP. I created my operations, my levels, and my strategy. Everything works fine when I use it on flat geometry (with all the lines at z0), but when I use it with a non flat geometry, I get a "chaining failure on the level" (not sure of the exact message in English, I use it in French).

The option "Use geometry depths" is turned on, I think I tried changing every single option but I keep getting this chaining failure.

Does anyone have an idea to solve this ?

Link to comment
Share on other sites
14 minutes ago, QuentinMed said:

Can someone help me ? Am I posting on the wrong Forum ?

If you need more details on what I'm trying to do, I'll be happy to answer.

The vbscript-nethook development forum might have been a better forum.

@Mick George Might be able to help you if he sees this. 

 

It would be better to post this on mastercam.com forums not everyone from there visite this site.

Link to comment
Share on other sites

Hello, thank you for your answer.

I have already watched the youtube video you sent several times to understand the process of creation of a ATP program and it helped me, but it doesn't have the solution to the "chaining failure on the level" I'm getting.

I hope Mick George will see this as you said.

I didn't even know there were forums on mastercam.com, this site is the only one I found when searching for answers when I started Mastercam. I'll know it for the next time.

Link to comment
Share on other sites
On 1/19/2021 at 11:35 AM, QuentinMed said:

Hello, thank you for your answer.

I have already watched the youtube video you sent several times to understand the process of creation of a ATP program and it helped me, but it doesn't have the solution to the "chaining failure on the level" I'm getting.

I hope Mick George will see this as you said.

I didn't even know there were forums on mastercam.com, this site is the only one I found when searching for answers when I started Mastercam. I'll know it for the next time.

There are a number of other ways to automate your toolpath creation. Mastercams native vbscript can do what atp does to some extent, mastercam x7 shipped with the toolpath door example that showed how to automatixally chain.

C# and Vb.Net add-ins also known as nethooks are the modern method.

Chooks are the most powerful add-ins and are written in c++.

Link to comment
Share on other sites

I didn't have any examples of vbscript chaining so i wrote a new one,

To create a vbscript open a text editor such as Mastercam code expert and save a new file as ChainGeometry.vbs

Paste this code inside ->

'Copyright (c) 2021 byte

'Permission is hereby granted, free of charge, to any person obtaining a copy
'of this software and associated documentation files (the "Software"), to deal
'in the Software without restriction, including without limitation the rights
'to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
'copies of the Software, and to permit persons to whom the Software is
'furnished to do so, subject to the following conditions:

'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
'IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
'FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
'AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
'LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
'OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
'SOFTWARE.
'---------------------------------'

'#Region Geometry Variable Declaration
Dim Line1
Dim Line2
Dim Line3
Dim Line4

'---------------------------------'

'#Region Geometry Variable Initialization
Set Line1 = New McLn
Set Line2 = New McLn
Set Line3 = New McLn
Set Line4 = New McLn

'---------------------------------'

'#Region Geometry Variable Parameter settings
With Line1
.X1 = 0.
.Y1 = 0.
.Z1 = 0.

.X2 = 1.
.Y2 = 0.
.Z2 = 0.
End With
With Line2
.X1 = 1.
.Y1 = 0.
.Z1 = 0.

.X2 = 1.
.Y2 = 1.
.Z2 = 0.
End With
With Line3
.X1 = 1.
.Y1 = 1.
.Z1 = 0.

.X2 = 0.
.Y2 = 1.
.Z2 = 0.
End With
With Line4
.X1 = 0.
.Y1 = 1.
.Z1 = 0.

.X2 = 0.
.Y2 = 0.
.Z2 = 0.
End With

'---------------------------------'

'#Region Level Variable Parameter settings
Dim Level 
Level = 10

'---------------------------------'

'#Region Draw Lines
Sub CreateLines
If CreateLine(Line1,mcCOLOR_GREEN,Level) = mcENTITY_INVALID Then
ShowString "Failed to create line"
Exit Sub
End If
If CreateLine(Line2,mcCOLOR_GREEN,Level) = mcENTITY_INVALID Then
ShowString "Failed to create line"
Exit Sub
End If
If CreateLine(Line3,mcCOLOR_GREEN,Level) = mcENTITY_INVALID Then
ShowString "Failed to create line"
Exit Sub
End If
If CreateLine(Line4,mcCOLOR_GREEN,Level) = mcENTITY_INVALID Then
ShowString "Failed to create line"
Exit Sub
End If
End Sub

'---------------------------------'

'#Region Tool Variables
Dim ToolDiameter
Dim ToolRadius
Dim ToolNumber
Dim Tool
Dim Comp
Dim CornerType
Dim FeedRatePercent

'---------------------------------'

'#Region Set Tool Variables
ToolDiameter = 0.125
ToolRadius = 0.0
ToolNumber = 1
Tool = 1 '??
Comp = 1 'Cutter Compensation
CornerType = 0
FeedRatePercent = 100.0

'---------------------------------'

'#Region ErrorCodes
Dim opErrorCode

'---------------------------------'

'#Region Create Contour Operation
Sub CreateContour
If ChainAll(True,False,Level, "") Then
opErrorCode = MakeContour("Operation Created Via the Api",ToolDiameter,ToolRadius,ToolNumber,Tool,Comp,CornerType,FeedRatePercent)
If opErrorCode = mcOPERATION_INVALID Then
	ShowString "Failed to contour operation,"
End If
Call FreeChains   
End If
End Sub

'---------------------------------'

'#Region Program call all functions here
Sub Program
'#Region Set Planes 
'call some predefined  functions to set the plane to top
call SetCPlaneNumber(mcVIEW_TOP)
call SetTPlaneNumber(mcVIEW_TOP)

'#Region Geometry Creation
call CreateLines
'#Region Geometry Creation
call CreateContour
End Sub

'---------------------------------'

'#Region Call Program
call Program

->Save the file

->Create a mill machine group

->from Home Select -> Command Finder

->Search "vbscript" -> double click on the command.

->From the vbscript Popup window -> Select the folder icon

->The open file dialog will appear -> Select the file "GeometryChaining.vbs" that you created 

-> press open -> the filename will be visible in the window 

-> Select Run

Result -> a newly created rectangle will appear along with a new created contour operation that is chained with the rectangle.

Link to comment
Share on other sites
On 1/14/2021 at 9:21 AM, QuentinMed said:

Hello,

I've been recently trying to use ATP. I created my operations, my levels, and my strategy. Everything works fine when I use it on flat geometry (with all the lines at z0), but when I use it with a non flat geometry, I get a "chaining failure on the level" (not sure of the exact message in English, I use it in French).

The option "Use geometry depths" is turned on, I think I tried changing every single option but I keep getting this chaining failure.

Does anyone have an idea to solve this ?

This error message can indicated that you are telling ATP to select geometry that is at -Z  but there are no geometries at -Z.  Can you attach a Zip2Go file to this thread with the relevant files and I'll take a look.

Link to comment
Share on other sites

Waow thanks a lot Thee Byte for taking the time to do all this. I'll give this a try if I can't solve my ATP problem.

Hello Mick, here is a Zip2Go file of a mcam file that returns me the chaining failure. I added my levels, strategy and operations files. With this mcam file, if I use ATP when I put all the geometry at Z0, it works fine, but when I move the geometry on different -Z (as it is in the file), I get the chaining failure.

BAF DEPLIE STEP.ZIP

Link to comment
Share on other sites
16 hours ago, QuentinMed said:

Waow thanks a lot Thee Byte for taking the time to do all this. I'll give this a try if I can't solve my ATP problem.

The old vbscript still works for a small project, but there are more modern methods like nethooks or chook that give you more control.

 

The advantage to ATP of course is that it is an officially supported software component, so you don't have to upgrade your code every time there is a new version..

Link to comment
Share on other sites
  • 2 weeks later...
On 1/25/2021 at 3:33 AM, QuentinMed said:

Waow thanks a lot Thee Byte for taking the time to do all this. I'll give this a try if I can't solve my ATP problem.

Hello Mick, here is a Zip2Go file of a mcam file that returns me the chaining failure. I added my levels, strategy and operations files. With this mcam file, if I use ATP when I put all the geometry at Z0, it works fine, but when I move the geometry on different -Z (as it is in the file), I get the chaining failure.

BAF DEPLIE STEP.ZIP

When using ATP and the use geometry depths feature the file needs to be a 3D file, that means that each geometry at depth needs to have the same geometry at Z0. The part file has some geometry at -Z only. Try copying and translating the geometry and it should work as expected.

Link to comment
Share on other sites
1 hour ago, Mick George said:

When using ATP and the use geometry depths feature the file needs to be a 3D file, that means that each geometry at depth needs to have the same geometry at Z0. The part file has some geometry at -Z only. Try copying and translating the geometry and it should work as expected.

Thank you very much Mick for your answer, it works with the duplicated geometry at Z0 ! I should have thought about it.

There is still one created toolpath with an error : I have on a level a chain at z = -2.9, and another chain at z=-3.2. As they are in the same level I use the same operation on both chains, but the toolpath created is at z=-2.9 for both chains.

When creating the toolpath manually and setting the depth to 0mm relative (which is what I set in my ATP operation as well), I get the good depths for both chains. So I guess this is not possible with ATP ? It changes automatically the 0mm relative to the first depth it gets ?

Link to comment
Share on other sites
On 2/4/2021 at 11:29 AM, QuentinMed said:

Thank you very much Mick for your answer, it works with the duplicated geometry at Z0 ! I should have thought about it.

There is still one created toolpath with an error : I have on a level a chain at z = -2.9, and another chain at z=-3.2. As they are in the same level I use the same operation on both chains, but the toolpath created is at z=-2.9 for both chains.

When creating the toolpath manually and setting the depth to 0mm relative (which is what I set in my ATP operation as well), I get the good depths for both chains. So I guess this is not possible with ATP ? It changes automatically the 0mm relative to the first depth it gets ?

ATP assumes all geometry on a given level to be at the same Z so it selects all the geometry and uses the first item in the list to set the depth.  There is a feature request to change this behavior and allow multiple depths of the "same" geometry on a level but unfortunately, for now, you will need to put specific geometry/depth combinations on unique levels.

 

 

Link to comment
Share on other sites
4 minutes ago, Mick George said:

ATP assumes all geometry on a given level to be at the same Z so it selects all the geometry and uses the first item in the list to set the depth.  There is a feature request to change this behavior and allow multiple depths of the "same" geometry on a level but unfortunately, for now, you will need to put specific geometry/depth combinations on unique levels.

Ok, I understand. Thank you Mick for your time.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...