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: 

How to delete a surfacebody with apprentice

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
385 Views, 2 Replies

How to delete a surfacebody with apprentice

Hi!

 

Environment:

Inventor 2013 professional, VS 2010, C#

 

I am trying to filter an imported part (single ipt) with several hundreds of surface bodies in it. (This file comes from a PDMS export towards step and the imported with the task scheduler.) There are about 300 little cubes (1cmx1cmx1cm) which I can easily identify by evaluating the edges – I want to delete those. I hoped for a small solution with the apprentice server, but now I am stuck with the final step:

 

            ApprenticeServerDocument oDoc = asc.Open(oldPartName);
            oDoc.ComponentDefinition.SurfaceBodies[0].Delete();

 

 

I though the SurfaceBody.Delete Method should make me happy – but I get the error “parameter is incorrect” (see screeny attached).

 

What am I doing wrong or do you have a workaround in mind?

 

Thanks for your support!

 

Kai

2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

 

I thought I was one step further by trying to delete the Feature of the solid body,

but I get the same error for the following line

 

oDoc.ComponentDefinition.SurfaceBodies[0].CreatedByFeature.Delete(false, false, false);

 

Message 3 of 3
philippe.leefsma
in reply to: Anonymous

Hi Kay,

 

Two important remarks to keep in mind:

 

1/ All indices for collections in the Inventor API start from 1

 

2/ Apprentice doesn't support modifying the Inventor files, it can only modify iProperties

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk Design & Make Report