Skip to main content
1-Visitor
April 24, 2017
Solved

HOW TO REMOVE THE REVISION BALLOON'S FROM CREO DRAWING TEMPLATE USING - VBAPI

  • April 24, 2017
  • 2 replies
  • 7794 views

Hi Everyone,

  I have a drawing's in creo, which has been revised more than 50 times so my requirement is to remove the unwanted the revision balloon symbol according to customer need.

For Eg : Drawing is having 20 revision balloon's from that user want to specifically remove 5th revision balloon before releasing it for production.

is it possible with VBAPI.

If you need a better picture on the above please let me know, i will attach a drawing for this.

With Regards

Aghil.M 

Best answer by PARTHIBAN_K

Hello Aghil Vijayan

For loop concept is correct.

You cannot List out IpfcDetailSymbolDefItem from IpfcDetailItemOwner

                Dim symbol As IpfcDetailSymbolDefItem = owner.ListDetailItems(symbolname, i)


2 replies

16-Pearl
April 25, 2017

Hi Agil

I think you need to get the list of symbols & from the SymbolInstruction you've to check the text value then filter the symbol related to the specific revision and then erase that symbol item

You may need to use

IpfcDetailSymbolDefItem.ListDetailItems()

IpfcDetailSymbolDefItem.GetInstructions()

IpfcDetailSymbolInstInstructions.TextValues

IpfcDetailSymbolInstItem.Remove()

And It's my assumption only I don't have any experience with the symbol.

1-Visitor
April 25, 2017

Hi Parthiban,

Thanks for the reply i will check this and will get back to you.

With Regards

Aghil.M

1-Visitor
May 4, 2017

Hi Parthiban Kannan

Hello Brother. I have written the code to remove the Symbol from drawing as per your guideline. now i getting an error in the highlighted line in PINK color.

i tried different possibilities but i am not able to select the active drawing sheet. Please show me a way to pass through this.

What i want to do is:

1. From the current active drawing sheet in my creo i want to remove all the symbols which user gonna enter.

2.This is the error i am getting.

With Regards

Aghil.M

16-Pearl
May 4, 2017

Hello Aghil Vijayan

Dim sheet As IpfcSheetOwner = Nothing

You've assigned nothing to sheet number but called the Sheet Number

num = sheet.CurrentSheetNumber

It doesn't make any logic, that's why it throws an error. You've to assign the model to sheet owner.

I prefer to use for loop with Drawing.NumberOfSheets to check revision symbol in all the sheets

1-Visitor
May 4, 2017

Hi Parthiban Kannan

As you said i have assigned sheet owner to the drawing. after assigning  how to get the sheet number or how to make program understand that active sheet is my sheet number.

1. See my updated code :

Public Class pfcIdentifySymbol

    Public Sub findsymbol(ByRef session As IpfcSession, _

                                  ByVal symbolname As String)

        Dim model As IpfcModel

        Dim drawing As IpfcModel2D

        Dim symInstructions As IpfcDetailSymbolInstInstructions

        Dim symItem As IpfcDetailSymbolInstItem

        Dim num As Integer

        Try

            model = session.CurrentModel

            drawing = CType(model, IpfcModel2D)

            Dim sheet As IpfcSheetOwner = CType(drawing, IpfcSheetOwner)

            num = sheet.NumberOfSheets

            Dim owner As IpfcDetailItemOwner = CType(drawing, IpfcDetailItemOwner)

            Dim symbol As IpfcDetailSymbolDefItem = owner.ListDetailItems(symbolname, num)    'Here after the "," i should specify the sheetnumber as object how to do that

            MessageBox.Show(symbol.GetInstructions.FullPath)

            symInstructions = symbol.GetInstructions()

            symInstructions.TextValues = symbolname

            symItem = drawing.SelectDetailItem(symInstructions)

            symItem.Remove()

2. Error Details

As you mentioned in your reply how to create the loop can you give me an idea for that.

With Regards

Aghil,M