cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

IS IT POSSIBLE TO AUTOMATE THE SELECTION PROCESS

SOLVED

Re: IS IT POSSIBLE TO AUTOMATE THE SELECTION PROCESS

No, problem, glad I could help you. Feel free to contact me in the future

Re: IS IT POSSIBLE TO AUTOMATE THE SELECTION PROCESS

Sure Bro.

I have a small query. I have completed now one project using VB-API. and i going to submit the "exe" file to the customer. so when i give the file should i ask my customer to add the environmental variables. run the VBAPI_REGISTER.bat file and all.

because i run this from one of my collegues PC and i got a error message as follow's.

Re: IS IT POSSIBLE TO AUTOMATE THE SELECTION PROCESS

I saw this question but I cant help you with this. I am not familiar to VB, only with J-link. I can help you with Creo API. sry

Re: IS IT POSSIBLE TO AUTOMATE THE SELECTION PROCESS

Hi skvarka juraj

How are you?

A small update on the same. I tried this deleting symbol instance code in a very old creo drawing, which is having almost 100 symbols and 200 + instances used in that drawing. That time the code is not able to find out the instances, loop is running but in between its stopping. so what i tried is instead of looping through all the symbol instances if we specify a particular symbol it will be easy for code to find out the instance.

Here is what i tried.

            Dim symInstructions As IpfcDetailSymbolInstInstructions

            Dim symItem As IpfcDetailSymbolInstItem

            Dim symbol As IpfcDetailSymbolDefItem    

            Dim owner As IpfcDetailItemOwner = CType(drawing, IpfcDetailItemOwner)

            Dim items As IpfcDetailItems = owner.ListDetailItems(EpfcDetailType.EpfcDETAIL_SYM_INSTANCE, k)

            Dim items1 As IpfcDetailItems = owner.ListDetailItems(EpfcDetailType.EpfcDETAIL_SYM_DEFINITION, k)

           For m = 0 To items1.Count - 1

                symbol = items1.Item(m)

              

                    If symbol.ToString = symbolname Then

                              For i = 0 To items.Count - 1

                                  symItem = items.Item(i)

                                  symInstructions = symItem.GetInstructions(False)

                                  varTexts = symInstructions.TextValues()

                                  varText = varTexts.Item(0)

                                  ins = varText.Value()

                                  If ins.Contains(instancename) Then

                                  symItem.Remove()

                                  End If

                              Next

              

                     End If

            Next

The highligted in Blue color are the newly added lines. "symbolname" is a string which will represent the symbol, Here the first loop is running, but its not going to the inner loop.
I hope you understood what i am trying.

How can i restrict the loop so that it will check on a particular symbol instances.

With Regards

Aghil,M

Re: IS IT POSSIBLE TO AUTOMATE THE SELECTION PROCESS

If you need to delete only instances of specific symbol you can chceck if the instance is instance of specific symbol (you can compare symbol name defined as parameter) and then chceck its text value.  owner.ListDetailItems collects all instances of all symbols.

Re: IS IT POSSIBLE TO AUTOMATE THE SELECTION PROCESS

Hi skvarka juraj

Thanks for the reply. as you mentioned i need to delete instance of a specific symbol. but it should be based on the symbol name what i give.

For eg: if i have 2 symbol in my creo drawing template. i will specify the name of the symbol first so in our for loop how to sort it, is where i am stuck now

"Dim symbol As IpfcDetailSymbolDefItem = owner.RetrieveSymbolDefinition(symbolname, Nothing, Nothing, False)"

I tried using the above method also. but after retrieving the symbol now how to compare it in the for loop so that only those instance which is part of the symbol should be passed through it.

Please give me some hint how best i can do this.

With Regards

Aghil.M

Re: IS IT POSSIBLE TO AUTOMATE THE SELECTION PROCESS

Previous comment should solve your problem

Re: IS IT POSSIBLE TO AUTOMATE THE SELECTION PROCESS

Hi skvarka juraj

I tried like this.

          Dim owner As IpfcDetailItemOwner = CType(drawing, IpfcDetailItemOwner)

        

            symbol = owner.RetrieveSymbolDefinition(symbolname, Nothing, Nothing, False)

            Dim items As IpfcDetailItems = symbol.ListDetailItems(EpfcDetailType.EpfcDETAIL_SYM_INSTANCE)     " This returns nothing"

Can you brief how to compare the instance is of a specified symbol parameter.

Sorry for the trouble.

With Regards

Aghil.M