I don't know how can i start...
thanks a lot!
Posted By WICHARD on 15 Dec 2010 03:42 AM
I use GPOST here and use the shell command to execute a .bat file to post-process the .aptsource. The VBA looks similar to CATV but we always use the same "fixture" so I didn't have to deal with that. So basically the macro prompts you for, among other things, the operation(s) you want to post, left or right part or both, which machine, and whether you want to download the machine code to the server. It also invokes Vericut and loads an STL file if you wish.
The only thing I didn't like was that I couldn't figure out how to go to all the tabs in the "Generate NC Output Interactively" window and set all the buttons and check boxes to my own default. In other words I had to make sure the users had the settings the same and I had to do it manually for each user. I don't remember now why that was important because I worked on it quite a few years ago but it always bugged me that I couldn't get that figured out. Anyhow, once everyone had the buttons and check boxes the same the output and the macro turned out great.
Hi there!
i saw this cool thread and suddenly used it for my use,here is what i did. it takes pokets and holes both as prismaticMachiningArea-feautes and uses them in pocketing operations. then it computes the tolpath of every operation. then it makes Apt-nc code.
my question now: is it possible,to get in addition to the apt code the collisions-text file?
load a setup in prismatic area,start global feauture-recognition,then run makro.note that there are some things in the part to get safetyplane and origin.
Sub catmain()
Dim MfgDoc1 As Document
Set MfgDoc1 = CATIA.ActiveDocument
'----------Process-Definition---------------------------------------------
Dim ActivityRef As AnyObject
Set ActivityRef = MfgDoc1.GetItem("Process")
'-------------Setup1-Def,hier auch die ganzen erzeuger-methoden
rein,"setPart.."-----------
Dim Setup1 As ManufacturingSetup
Dim childs As Activities
Dim child As Activity
If (ActivityRef.IsSubTypeOf("PhysicalActivity")) Then
Dim quantity
Set childs = ActivityRef.ChildrenActivities
quantity = childs.Count
If quantity <= 0 Then
Exit Sub
End If
Dim NumberOfSetup
NumberOfSetup = 0
Dim I
For I = 1 To quantity
Set child =
childs.Item(I)
If
(child.IsSubTypeOf("ManufacturingSetup")) Then
Set Setup1 = child
NumberOfSetup = NumberOfSetup + 1
Exit For
End If
Next
End If
If NumberOfSetup <= 0 Then
Exit Sub
End If
'----------------------Produkt Def als kontext für
Setup-Einrichtung,sehr wichtiger schritt für alles BearbOPS,also
PROD
'ist das gesamte Setup mit fitures,und NC das bearbeitbare set aus
rohteil und fertigteil---------------
Dim Prod As Product
Set Prod = Setup1.Product
Dim NC As Product
For I = 1 To Prod.Products.Count
If Prod.Products.Item(I).PartNumber =
"NC_Geometry" Then
Set NC =
Prod.Products.Item(I)
Exit For
End If
Next
'------------------DesignPart und wichtige elemente
herholen-----------------------------
Dim pa As PartDocument
Set pa = NC.ReferenceProduct.Parent
Dim part As part
Set part = pa.part
Dim bod As Bodies
Set bod = part.Bodies
Dim des As AnyObject
Set des = bod.GetItem("Final")
Dim sto As AnyObject
Set sto = bod.GetItem("Stock")
Dim ebene As AnyObject
Set ebene = des.HybridShapes.GetItem("Oben")
Dim ursprung As AnyObject
Set ursprung = des.HybridShapes.GetItem("Point.1")
'---------------------Setup
einrichten--------------------------------
Call Setup1.MachiningAxisSystem.SetOriginPoint(ursprung, NC)
Call Setup1.MachiningAxisSystem.SetOriginXDirection(1, 0, 0)
Call Setup1.CreateMachine("Mfg3AxisMachine")
Call Setup1.Machine.set_DefaultValues
Call Setup1.SetDesignPart(des, NC)
Call Setup1.SetStock(sto, NC)
Call Setup1.SetSafetyPlane(ebene, NC)
'Dim view As ManufacturingView
'Set view = Setup1.GetManufacturingView
'----------------Programm Def----------------------
Dim dasProgramm As ChildrenActivities
Set dasProgramm = Setup1.ChildrenActivities
Dim Prog As ManufacturingProgram
Set Prog = dasProgramm.GetItem("Manufacturing Program.1")
Dim manu 'As ManufacturingOperation
Dim featu As ManufacturingFeatures
Set featu = view.ManufacturingFeatures
Dim PMA As ManufacturingFeature
Dim ob As AnyObject
For Each PMA In featu
If TypeName(PMA) =
("ManufacturingPrismaticMachiningArea") Then
Set ob = PMA
Set manu = Prog.AppendOperation("Pocketing", 1)
Call manu.SetFeature(ob)
If manu.IsGeometricallyAccessibleOnSetup(Setup1) Then
Call manu.SetTool("End Mill D10 Rc0")
Call manu.AddMotionToAPlane("Approach", 1, ebene, NC)
Dim oEndPoint(3)
Call manu.GetTrajectoryEndPointCoord(oEndPoint)
End If
End If
Next
Dim aptgen As ManufacturingAPTGenerator
Set aptgen = Prog
Dim MGD As ManufacturingGeneratorData
Set MGD = Nothing
Call aptgen.InitFileGenerator("APT", "C:\NC-Code\hier.aptsource",
MGD)
Call aptgen.RunFileGenerator(MGD)
Call MGD.ResetAllModalValues
'Dim sel1 As Selection
'Set sel1 = CATIA.ActiveDocument.Selection
'sel1.Clear
'sel1.Search "NC Manufacturing.Manufacturing
Program.Name=Manufacturing Program.1"
'CATIA.StartCommand ("Start Video Simulation using Tool Path")
'Pause = 3
'sel1.Clear
End Sub
Based on some of the earlier posts in this thread, I was able to figure out how to ouput an aptsource file for an entire program. I also added some additional logic into the macro so it would automatically launch the aptsource file in Notepad after it generates the file. I would now like to be able to output a single MO or multiple MO's into one aptsource file. Does anyone know if its possible?
Dear Deepak Manuel
I'm very lucky to see your suggestions on using "FT05" utility with a batch file to realize "generate NC output interactively". It‘s very useful!
thanks a lot!
yours sincerely
Surgin
2020/08/27
Hello everyone!
Thanks a lot!, Mr. Deepak Manuel explaining how to use the FT05 utility with a batch file.
I generate the NC code with the batch mode.but it's very very slowly compare with the interactively Mode.
who can explain this problem?thanks a lot!
@echo on
echo %1 %2 %3 %4 %5 %6 %7 %8
MfgBatch %1 %2 %3 %4 %5 %6 %7 %8