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

Delete body

tomislav.peran
Advocate

Delete body

tomislav.peran
Advocate
Advocate

Hello,

 

This is probably a bit exotic question but is it possible to delete a body inside a part environment with iLogic code?

 

I generate this body from another assembly, then I delete it after I finish extracting parameters from Region properties. That means that every time I repeat the process the name of the body changes (Base1 then Base 2, then Base 3...etc).

 

tomislavperan_0-1663586138135.png

 

If somebody knows how to delete this body please let me know.

 

Tom

 

0 Likes
Reply
Accepted solutions (1)
691 Views
4 Replies
Replies (4)

marcin_otręba
Advisor
Advisor
Accepted solution

you can use this for start, it assumes that last feature will be EOP so it will delete one before:

of course you can extend code and check if that feature what you wanted comparing name of feature and assembly name it should be traceable, but if the processs is always the same so you immport assembly to part it should work.

 

    Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument
    Dim oTopBrowserNode As BrowserNode= oPartDoc.BrowserPanes.ActivePane.TopNode
    Dim onode As BrowserNode = oTopBrowserNode.BrowserNodes.Item(oTopBrowserNode.BrowserNodes.Count - 1)
 onode.NativeObject.Delete

 

tomislav.peran
Advocate
Advocate

Hi Marcin,

 

This works well for me indeed. 

 

I do have a question. What EOP means? 

0 Likes

marcin_otręba
Advisor
Advisor

hi, this mean end of part:) maybe this will hel to explain:

 

https://www.youtube.com/watch?v=JlzUTzM47ns

 

tomislav.peran
Advocate
Advocate

Hi Marcin,

 

Ahaa, yes, I understand.

 

Thank you very much for the help :slightly_smiling_face:

 

Tom

0 Likes