Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Non standard workplanes in inserted iParts?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
oransen
371 Views, 3 Replies

Non standard workplanes in inserted iParts?

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).

Tags (1)
3 REPLIES 3
Message 2 of 4
oransen
in reply to: oransen

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

Message 3 of 4
philippe.leefsma
in reply to: oransen

WorkFeatures must be included in the iPart settings if you want to retrieve them after a member has been inserted, see picture below:

 

img.png

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 4 of 4
oransen
in reply to: philippe.leefsma

Magic, perfect, works fine now. Thanks

 

Smiley Happy

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report