If I insert a part with my own work planes in an assembly, I can programatically get the first 3 standard workplanes and also the non standard workplanes.
BUT if I make the part a table based iPart, I cannot find the extra non standard workplanes in the WorkPlanes of the part component definition, just the first standard three (XY YZ XZ).
What have I missed, if anything?
(I've tried this in C++ COM and in VBA).
Solved! Go to Solution.
Solved by philippe.leefsma. Go to Solution.
Here is the test code...
Private Sub ListWorkplanesInInsertedPart() Dim oAsmDoc As AssemblyDocument oAsmDoc = _invApp.ActiveDocument Dim oAsmDef As AssemblyComponentDefinition oAsmDef = oAsmDoc.ComponentDefinition Dim oOccs As ComponentOccurrences oOccs = oAsmDef.Occurrences Dim oOcc As ComponentOccurrence oOcc = oOccs.ItemByName("Tube-with-workplanes-03:1") Dim oDef As PartComponentDefinition oDef = oOcc.Definition Debug.Print("There are " & oDef.WorkPlanes.Count & " workplanes in this part") Dim WP As WorkPlane Dim iPlane As Integer For iPlane = 1 To oDef.WorkPlanes.Count WP = oDef.WorkPlanes.Item(iPlane) Debug.Print("workPlane " & iPlane & " has name " & WP.Name) Next
...and attached are the files to use, a part and an assembly
WorkFeatures must be included in the iPart settings if you want to retrieve them after a member has been inserted, see picture below:
Regards,
Philippe.