Cancel
Showing results for 
Search instead for 
Did you mean: 

Why does it keep being marked as spam? - occurrence.count

Pioneer
Pioneer

Hello.
Developers of edge api,

I want to quickly make each part of the active assembly document into a drawing.

Here is a comment (in the active assembly document...).

I tried to make it, but it doesn't work.
for i=1 to occurrence.count 

Can you teach me what's the problem?

 

1123.png

If there is a problem, capture it and upload it.

I am not good at English.
So, I feel embarrassed when I get spam.

6 REPLIES 6

Re: Why does it keep being marked as spam? - occurrence.count

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

@Hclee1,

 

I think you should open and close the quick sheet DFT document for each occurrence inside your for next loop.

Kind regards,
Wolfgang Kunert - www.wksyspro.de

Re: Why does it keep being marked as spam? - occurrence.count

Pioneer
Pioneer

Thankyou @wku 

 

The problem was solved by closing each time a document was saved.

There is a problem with occurrence.count.
It is thought that a unique Count of parts should be used instead of all parts in an assembly.

Can I use something other than an Occurrence.count?

Re: Why does it keep being marked as spam? - occurrence.count

Pioneer
Pioneer

Thank you very much. @wku 

sedoc.close()
The solution was fixed by inserting .
But...it's also a problem in the quantity of duplicated parts.

ocurrence.count <--Total Count
???? <--- Count of unique parts


Can you help me with something?

Highlighted

Re: Why does it keep being marked as spam? - occurrence.count

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

@Hclee1,

 

as I can see from your code you're interested on the top level occurrences only. So far so good. If already on this top level a 3D component (asm, par, psm) is referenced multiple times (= multiple occurrences) you have to introduce outside of the loop a string list keeping all occurrence file names having been already processed to avoid duplicate processing.

 

...
' List keeping the OccurrenceFileNames already processed Dim processedOccurrenceFileNames = New List<Of String>
... For i As Long To occurrences.Count occurrence = occurrences.Item(i) If Not processedOccurrenceFileNames.Contains(occurrence.OccurrenceFileName) Then ' Process the occurrence as before ...
' Finally add the occurrence filename to the list processedOccurrenceFileNames.Add(occurrence.OccurrenceFileName) End If Next i
... ...
Kind regards,
Wolfgang Kunert - www.wksyspro.de

Re: Why does it keep being marked as spam? - occurrence.count

Pioneer
Pioneer

HI @wku 

That's truly amazing.

The code that you gave me, it's the code that I'm trying to do.
I was able to do exactly that.

You're my savior.
Thank you very much....^^

Re: Why does it keep being marked as spam? - occurrence.count

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

@Hclee1 

 

Great! Thank you.

 

A note to your initial subject of your posting: When pasting code into the code window you should avoid any characters being a potential problem to be used in a HTML formatted text. Your source code contains Chinese characters... Best is 7-Bit ASCII (haha).

 

Kind regards,
Wolfgang Kunert - www.wksyspro.de