AlphaCam nesting multiple lists
Hello,
I have a lot of nesting lists prepared for some projects.
Now I want to combine some of them together but there is no that option.
I can only use parts to create new list but that it to much work to do.
Anyone have a some macro or something for merging two or more nesting list?
Thanks
Re: AlphaCam nesting multiple lists
It is possible write it. In Vba directly in Alphacam or as some external application in .NET.
If you interested about it let me know. I have many experience with this programming.
Re: AlphaCam nesting multiple lists
Yes, after some research I created my own little software for merging lists.
Actually, it is very easy. In the nest list file (if you open with notepad) you can see all structure of files and lists, after that is easy to create now or to merge, delete some items etc.
Re: AlphaCam nesting multiple lists
Hello,
I dont want to open new question because it is linked with this.
I am creating nesting optimisation from Vb Net with following code and I can get qty of pieces from loaded nesting list.
After some time I have error, please check code.
This worked before, but I cannot solve this error for a couple of days. I tried reinstall all, but nothing.
What I see that when I open Alphacam manualy and then run this code, it will work sometime.
I tried this with AlphaCam version 2017 and 2019 and same error.
Thanks
Dim alp As New AlphaCAMRouter.App
alp.Visible = True
Dim Drw As AlphaCAMRouter.Drawing
Dim Sheet As AlphaCAMRouter.Path
Dim Nest As NestData
Drw = alp.ActiveDrawing
Nest = Drw.CreateNestData("c:\1.anl") ------ HERE IS ERROR: Exception thrown 'System.Runtime.InteropServices.COMException' in AplhaCamNesting.exe, Additional Information: Error HRESULT E_FAIL has been returned from a Call To a COM component.
Sheet = Drw.CreateRectangle(0, 0, 2800, 2070)
Nest.AddSheet(Sheet, Drw.Materials(1).Name, 0.25, 2)
Nest.DoNest()
Dim qty As Decimal = 0
Dim col As AlphaCAMRouter.AcamColor = AcamColor.acamCYAN
For a As Integer = 1 To Drw.ToolPaths.Count
qty = qty + Drw.ToolPaths.Item(a).GetArea(AcamColor.acamBROWN)
Next
Re: AlphaCam nesting multiple lists
Quote:
Originally Posted by
fikri
Hello,
I dont want to open new question because it is linked with this.
I am creating nesting optimisation from Vb Net with following code and I can get qty of pieces from loaded nesting list.
After some time I have error, please check code.
This worked before, but I cannot solve this error for a couple of days. I tried reinstall all, but nothing.
What I see that when I open Alphacam manualy and then run this code, it will work sometime.
I tried this with AlphaCam version 2017 and 2019 and same error.
Thanks
Dim alp As New AlphaCAMRouter.App
alp.Visible = True
Dim Drw As AlphaCAMRouter.Drawing
Dim Sheet As AlphaCAMRouter.Path
Dim Nest As NestData
Drw = alp.ActiveDrawing
Nest = Drw.CreateNestData("c:\1.anl") ------ HERE IS ERROR: Exception thrown 'System.Runtime.InteropServices.COMException' in AplhaCamNesting.exe, Additional Information: Error HRESULT E_FAIL has been returned from a Call To a COM component.
Sheet = Drw.CreateRectangle(0, 0, 2800, 2070)
Nest.AddSheet(Sheet, Drw.Materials(1).Name, 0.25, 2)
Nest.DoNest()
Dim qty As Decimal = 0
Dim col As AlphaCAMRouter.AcamColor = AcamColor.acamCYAN
For a As Integer = 1 To Drw.ToolPaths.Count
qty = qty + Drw.ToolPaths.Item(a).GetArea(AcamColor.acamBROWN)
Next
Hi,
try something like this.
Not tested, write from a "hand´"
Also do not forgot on a reference Alphacam nesting Type library
Code:
Dim drw As Drawing
Set drw = App.ActiveDrawing
Dim Sheet As Path
Dim Nest As NestData
Nest = drw.CreateNestData("C:\Alphacam\LICOMDIR\NestLists\1.anl")
Set Sheet = drw.CreateRectangle(0, 0, 2800, 2070)
Nest.AddSheet Sheet, "MDF", 0.25, 2
Nest.DoNest
Dim qty As Double
qty = 0
Dim col As AcamColor
col = AcamColor.acamCYAN
Dim a As Integer
For a = 1 To drw.ToolPaths.Count
qty = qty + drw.ToolPaths.Item(a).GetArea(AcamColor.acamBROWN)
Next
Re: AlphaCam nesting multiple lists
Yes, this code is working directly from AlphaCam VBA, but I need it to run from VB NET, because I have another code I must use for saving data, other calculation.. to much work to convert all to VBA.
Thanks
Re: AlphaCam nesting multiple lists
Ahh ok. Sorry :) . I did not checked code perfectly.
Let me open it in Visual Studio.
Re: AlphaCam nesting multiple lists
Quote:
Originally Posted by
fikri
Yes, this code is working directly from AlphaCam VBA, but I need it to run from VB NET, because I have another code I must use for saving data, other calculation.. to much work to convert all to VBA.
Thanks
There you have your project. You have to add reference to a AcamNest.
Then is result code like this (without any others exception ...... )
Dim alp As New AlphaCAMMill.App
alp.Visible = True
Dim Drw As AlphaCAMMill.Drawing
Dim Sheet As AlphaCAMMill.Path
Dim Nest As ACAMNESTLib.INestData
Drw = alp.ActiveDrawing
Nest = Drw.CreateNestData("C:\Alphacam\LICOMDIR\NestLists \1.anl")
Sheet = Drw.CreateRectangle(0, 0, 2800, 2070)
Nest.AddSheet(Sheet, Drw.Materials(1).Name, 0.25, 2)
Nest.DoNest()
Dim qty As Decimal = 0
Dim col As AlphaCAMMill.AcamColor = AlphaCAMMill.AcamColor.acamCYAN
For a As Integer = 1 To Drw.ToolPaths.Count
qty = qty + Drw.ToolPaths.Item(a).GetArea(AlphaCAMMill.AcamCol or.acamBROWN)
Next
https://www.dropbox.com/sh/8vj8rx8p5...VWrgjjTSa?dl=0
Re: AlphaCam nesting multiple lists
Thanks for code.
However, I cannot add library from 2017, 2018 or 2019 version.
There is message: Please make sure that file is accesible and that is valid assembly or com component.
I tried library from ...add-ins/nesting/AcamRadnest.dll
I can do it just for 2016 version, which is 32 bit, but newer Router or Mill is 64 bit version?
With your project is same error. Same error is when I tried Mill or Router.
1 Attachment(s)
Re: AlphaCam nesting multiple lists
https://www.cnczone.com/forums/attac...d=421044&stc=1
Yes newest are 64 bit. Im using 19 and without problem. Can you share your VS project?
1 Attachment(s)
Re: AlphaCam nesting multiple lists
Hello,
I think that this is problem because of system or something else.
I don't know why is reason that I cannot tick reference 64 bit but I can do it with 32 bit?
Re: AlphaCam nesting multiple lists
Quote:
Originally Posted by
fikri
Hello,
I think that this is problem because of system or something else.
I don't know why is reason that I cannot tick reference 64 bit but I can do it with 32 bit?
Which Windows you have 32 or 64 bit?