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.
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
Similar Threads:
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.
Postprocessors, VBA macros, .NET programming.
www.ccsoftcz.com
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.
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
Postprocessors, VBA macros, .NET programming.
www.ccsoftcz.com
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
Ahh ok. Sorry . I did not checked code perfectly.
Let me open it in Visual Studio.
Postprocessors, VBA macros, .NET programming.
www.ccsoftcz.com
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
Postprocessors, VBA macros, .NET programming.
www.ccsoftcz.com
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.
Yes newest are 64 bit. Im using 19 and without problem. Can you share your VS project?
Postprocessors, VBA macros, .NET programming.
www.ccsoftcz.com
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?
Try check this .
https://stackoverflow.com/questions/...d-that-it-is-a
Postprocessors, VBA macros, .NET programming.
www.ccsoftcz.com
Well, actually I am trying that. Will see ..
Thanks for time.
Well. Nothing yet.
I tried it on another pc and same problem.
Different is that I can add reference but while running code error message appears.
I founded one trick, if AlphaCam is already running if I run my code everything is ok.
Yes that what i wrote "without any exception". I will have time end of this week so i will send you absolutely correct code. If you wrting code you have to also take a lot of other things into account. also take a lot of other things into accountalso take a lot of other things into account
Postprocessors, VBA macros, .NET programming.
www.ccsoftcz.com
I can use it only when Alphacam is already started before, but now I must after each optimisation close AlphaCam, start again, and then run code again, which is very slow, need about 20 sec per one optimisation.
Is there any way to clear nesting list so I do not need to close Alphacam, just start next optimisation? I want to load next one, but I cannot clear previous? Something like Clear Memmory manualy?
When I start new app, everything should be cleared but why not?
Thanks