Welcome to the COE Discussion Forum! 

 

To participate in the discussion forum, you must be logged in to the website.  If you forget your login information, please contact COE Headquarters at coe@coe.org or (800) 263-2255.

If you are new to the COE Discussion Forum and would like to participate, please register.

 

COE DISCUSSION FORUM
Subject: Check for UNIQUE bundleSegment Name.

You are not authorized to post a reply.   
Author Messages
PKARKARE

20 Feb 2008 12:32 PM

I'm trying make a check for Electrical BundleSegment Names to be unique in a product(assembly) using the code below. This one will take a lot of time, since it goes thru' every part in the product as opposed to only for BundleSegments. Can some suggest anything better than this -...

part; bn:BundleSegment

let BSList(list)

let BS1(BundleSegment)

let BS2(BundleSegment)

let i = 1

let j = 1

let BSListSz = 0

let Passed(List)

let Pass(Boolean)

Pass=true

BSList = p.Owner->Query("BundleSegment",""

BSListSz = BSList->Size()

for i while i<=BSListSz

BS1 = BSList-> GetItem(i)

    for j while j<=BSListSz

    { BS2 = BSList-> GetItem(j)

        if (i <> j)

       {  if (BS1.Name == BS2.Name)

           { ThisCheck.AddTupleFailed(p.Owner,BS2)

              Pass=false

           }

        }

      }

}

if(Pass==true) ThisCheck.AddTupleSucceeded(Passed)

Thanks -

PKARKARE

01 Apr 2008 03:25 PM
Got a better idea ... I'll share if anyone is interested. ;o)
ITSMYJOB


08 Apr 2008 01:14 PM
well if you have better and ready to share, i am listening.

Eric N

INDOCTI DISCANT ET AMENT MEMINISSE PERITI
You are not authorized to post a reply.
Forums > COE Forums > KBE > Check for UNIQUE bundleSegment Name.



ActiveForums 3.6

    

401 North Michigan Avenue, Chicago, IL 60611-4267 | (312) 321-5153 | (800) COE-CALL (U.S.)