Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sNCProgram.Toolpaths.Count returns zero #34

Open
arturboszczyk opened this issue Feb 17, 2021 · 3 comments
Open

sNCProgram.Toolpaths.Count returns zero #34

arturboszczyk opened this issue Feb 17, 2021 · 3 comments

Comments

@arturboszczyk
Copy link

Hi Luke,

Hope you can help me with this. I've run below code and not sure why the toolpaths count I'm getting is 0. There are definitely toolpaths inside the NC program. Please note this is old 2017 dated project, which I want to modify and re-post. I have just checked there is no issue with a project created in 2021 version of PowerMill. I even created new NC program, added toolpaths to this freshly created NC program - same issue - Toolpath count=0

Please approach me and I can send you the whole affected project, for you to investigate this.

I've updated project to 1.1.53 in NuGet but still the same issue.

**_powerMILL = New PMAutomation(Autodesk.ProductInterface.InstanceReuse.UseExistingInstance)
Dim pSession As PMProject = powerMILL.ActiveProject

    For Each sNCProgram As PMNCProgram In pSession.NCPrograms
        If sNCProgram.IsActive Then
            MsgBox("Toolpaths count =" & sNCProgram.Toolpaths.Count)
        End If
    Next_**

image
image

Hope you can help me with this.

Cheers
Arthur

@arturboszczyk
Copy link
Author

Hi

I know why the code fails but I'm not sure why running:
EDIT NCPROGRAM '3711-2201A_leading_v1' LIST
adds empty line between the OPTION FILE line and first name of toolpath. See images below. If you know why, please let me know.

image
image
image

Cheers

@lukeedw
Copy link
Contributor

lukeedw commented Feb 20, 2021

That is indeed odd. I would assume it is related to a setting difference between the two. I would suggest you create a new NC program and start adding toolpaths to it and changing settings. Slowly making it the same as your 3711 NC Program. Each time you make a change, run the "EDIT LIST" command and see at what point the blank line appears. It could be something to do with the workplanes or coolant options... things like that...

@Al-Ke
Copy link
Contributor

Al-Ke commented Mar 28, 2024

We may consider using
print par $extract(filter(components(entity('ncprogram','" + Name + "')),"RootType == 'nctoolpath'"),'name')
instead of
EDIT NCPROGRAM '" + Name + "' LIST

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants