Hallo Zusammen,
ich habe mich nun entschieden im Forum aktiv zu werden, da ich es einfach nicht hinbekomme.
Was möchte ich machen:
Ein Manufacturing Surface Machining Area anlegen und diesem Geometrie und eine Begrenzung zuweisen.
Diese dann einer Operation " AppendOperation("Mfg5AxisContourDriven", 1) " zuweisen.
Nur was in der V5Automation steht tut nicht :-(
Folgendes steht in der API:
Sub SetNCGeometry( CATBSTR iGeometryType, AnyObject iNCGeometry)
Sets a NCGeometry of a specified type to a Manufacturing Surface Machining Area.
Parameters:
iGeometryType
Legal values:
iGeometryType can be:
GuidingElements to set the limiting contour
Parts to set the part to machine
Checks to set a check element
iNCGeometry
The NCGeometry to be set.
Example: The following example sets the NCGeometry NCGeomPart to the manufacturing surface machining area CurrentSMA
Call CurrentSMA.SetNCGeometry("Parts",NCGeomPart)
Und so sieht mein Code aus:
Dim G_BOUNDARY 'Begrenzung
Dim G_SURFACE 'Fräsflächen
Dim toolop As ManufacturingOperation
Dim op As ManufacturingOperation
Dim opmill As ManufacturingOperation
Dim MySurfaceGuidedMilling As ManufacturingOperation
Dim myMfgView As ManufacturingView
Dim myMfgFeatures As ManufacturingFeatures
Dim myMMF As ManufacturingMachinableFeature
'Fenster eilesen
Dim proDoc As ProcessDocument
Dim partDoc As PartDocument
Dim MyProduct As Product
Dim Activity As Activity
Dim partop As ManufacturingSetup
'Dokument einlesen
Set proDoc = CATIA.ActiveDocument
'Prozess einlesen
Set Activity = proDoc.GetItem("Process")
'Aufspannung einlesen
Set partop = Activity.ChildrenActivities.Item("Part Operation.1")
Dim MyPart As Part
'Part einlesen
Set partDoc = CATIA.Documents.Item("SR_PART.CATPart")
Set MyPart = partDoc.Part
Set MyProduct = partDoc.Product
'einlesen Fräsflächen
Dim A_SURFACE As AnyObject
Set G_SURFACE = MyPart.HybridBodies.Item("SR").HybridBodies.Item("CAD").HybridBodies.Item("SURFACE").HybridShapes.Item("SURFACE_1")
Set A_SURFACE = MyPart.HybridBodies.Item("SR").HybridBodies.Item("CAD").HybridBodies.Item("SURFACE").HybridShapes.Item("SURFACE_1")
Set G_BOUNDARY = MyPart.HybridBodies.Item("SR").HybridBodies.Item("CAM").HybridBodies.Item("BOUNDARY").HybridShapes.Item("BOUNDARY_1")
Set myMfgView = partop.GetManufacturingView
Set myMfgFeatures = myMfgView.ManufacturingFeatures
Call myMfgFeatures.Add("M3xFeature")
Dim CurrentSMA As ManufacturingSurfaceMachiningArea
Set CurrentSMA = myMfgFeatures.Item(1)
'Das tut schon nicht!!! :-(
Call CurrentSMA.RemoveNCGeometry("Parts")
Call CurrentSMA.RemoveNCGeometry("GuidingElements")
Call CurrentSMA.RemoveNCGeometry("Checks")
'Das tut auch nicht!!! :-(
Call CurrentSMA.SetNCGeometry("Parts", A_SURFACE)
'Herstellungsprogramm einlesen
Dim herprog As ManufacturingProgram
Set herprog = partop.ChildrenActivities.Item("SR")
'WERKZEUG anlegen
Set toolop = herprog.AddToolChange("FR52", "MfgEndMillTool", "Standardkatalog", 52)
Set opmill = herprog.AppendOperation("M3xSpiralMilling", 1)
'opmill.SetTool = "FR52"
Set MySurfaceGuidedMilling = opmill '.ChildrenActivities.Item(opmill.Name)
Set myMMF = myMfgFeatures.Item(1)
Call MySurfaceGuidedMilling.SetFeature(myMMF)
Call MySurfaceGuidedMilling.SetGeometry("Parts", G_SURFACE, partop.GetProductInstance(), 0)
Call opmill.SetGeometry("Drives", G_BOUNDARY, partop.GetProductInstance(), 0)
End Sub
Hat jemand eine Idee, oder tut das einfach nicht.
Oder hat jemand schon mal das erfolgreich programmiert?
Viele Grüße,
Seb
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP