
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create a workpoint at the intersecion of two Z axis of two hand picked frame generator members
here's my code so far
ComponentOccurrence co1 = (ComponentOccurrence)(invapp.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Pick first Part"));
ComponentOccurrence co2 = (ComponentOccurrence)(invapp.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Pick second Part"));
PartComponentDefinition cd1 = (PartComponentDefinition)co1.Definition;
PartComponentDefinition cd2 = (PartComponentDefinition)co2.Definition;
WorkAxis cd1Z = cd1.WorkAxes["Z Axis"]; ///vb and vba sample d1.WorkPlanes.item("3")
WorkAxis cd2Z = cd2.WorkAxes["Z Axis"];
AssemblyDocument thisDoc = (AssemblyDocument)invapp.ActiveDocument;
object tempAxis1 = null;
co1.CreateGeometryProxy(cd1.WorkAxes["Z Axis"], out tempAxis1);
//thisDoc.ComponentDefinition.AdjustProxyContext(tempAxis1);
WorkAxis x1 = tempAxis1 as WorkAxis;
object tempAxis2 = null;
co2.CreateGeometryProxy(cd2.WorkAxes["Z Axis"], out tempAxis2);
WorkAxis x2 = tempAxis2 as WorkAxis;
WorkPoint px = thisDoc.ComponentDefinition.WorkPoints.AddByTwoLines(x1.Line, x2.Line, true);
Solved! Go to Solution.