Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

VB.Net Delete certain extrusions

Anonymous

VB.Net Delete certain extrusions

Anonymous
Not applicable

Hello there

 

I am adding extrusions to part documents via vb.net. The modified parts are then used to build an assembly.

The problem is, that for the next assembly the parts should be "clean" again.

 

My question now is what's the best way to delete only the extrusions created during the modification (there are extrusions in the clean version which should not be deleted).

 

I thought of assigning each extrusion a name, and later check for the names to delete them. However this would result in a lot of code lines.

 

Is there a way to, I don't know, set a property or something and then simply check all Extrusions (with an For Each Loop) and delete those with that property?

0 Likes
Reply
475 Views
7 Replies
Replies (7)

bradeneuropeArthur
Mentor
Mentor
are you using vault?

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes

Anonymous
Not applicable

Sadly Vault is not an Option.

 

To save the assemblies I use PackandGo through the API.

Basically I adjust the parts, packandgo the assembly (with it's components) to a different directory, and then restore the parts for the next assembly. Not the best way, but it should work I guess.

0 Likes

bradeneuropeArthur
Mentor
Mentor
do I understand correctly:

you have a part that has as basis
you modify the part
you create assemblies etc
you need to have the basis of the part again

Then this option is maybe possible:

Save the file as a temporare file and restore it by coding.
otherwise you could try to read and write the bytes back to the part.

if you need help please let me know.

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes

Anonymous
Not applicable

Yes it should work exactly like that.

 

Please be aware that I need to save the Assemblies with the modified components (as backup). I'm not sure if this is possible if I work with temporare files?

 

As for writing the bytes back. This sounds like an cool but difficult method. I have no experience with that.

0 Likes

bradeneuropeArthur
Mentor
Mentor
It is not difficult.

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes

bradeneuropeArthur
Mentor
Mentor
About the bytes I mean. I am not at my desk right now.
I will show you how if you want.

Please let me know.

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes

Anonymous
Not applicable

I want to let you know I solved my problem. I copied and pasted my Module, and swapped the functions which create the extrusions with a function that deletes the extrusions. Not fancy at all but at least it works like it should.

 

Nevertheless, if you are willing to I would be glad if you could explain how writing bytes back works. I'm sure I could make use of this in future projects.

Thank you.

0 Likes