Delete CATIA publication

Delete CATIA publication

In this post above all we want to make solution for delete CATIA publication with no element.

img_287809

Problem

First of all we found this problem on https://www.eng-tips.com/viewthread.cfm?qid=443335 . So we decided to write code for it. 

Hello every one. It happend many times that I received Catproducts where somebody had deleted published element but didn’t remove linked publication.

Hence Catia shows it as broken publication. Due to I get problem with some checks. So I want to find and remove automatically broken publication from my Catparts. I can find them with macro but I don’t know how to write in macro following things:

– open from Tools -> Publications window.
– select publications with status “no element” and remove it.

So can anybody help me?
Thanks in advance!

Solution

So you can read more about selection   and publication .

Certainly if you have any issues feel free to contact me.

4 thoughts on “Delete CATIA publication

  • August 28, 2018 at 8:05 am
    Permalink

    Thank you for great macro!!!
    I have removed lines 36 and 38, otherwise it doesn’t remove any element(I think because already selected publications have just ordinary name not “” like condition in if ) .
    Without these lines works perfectly!
    Thanks a lot!

    Reply
    • August 28, 2018 at 8:44 am
      Permalink

      Hmm i tested in my environment all was good, are you sure it will not delete all publications? That If statement allow to delete only with broken link? I use CATIA V5-6 2016. It can also be to the version of CATIA.

      Reply
  • February 19, 2021 at 3:29 pm
    Permalink

    Hi,
    I have also removed second If statement, and macro now delete publications with “no element”, but also delete publicated parameters. I would like avoid that, is it possible instead PubRef.DisplayName = “”, examine Publication Status “OK” or “No element” ?

    Reply
    • February 20, 2021 at 5:42 am
      Permalink

      Hello, I think this is the way to do it. How is possible that you parameters have display name “”? Or other word no name?

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *