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?
If there is a problem, capture it and upload it.
I am not good at English.
So, I feel embarrassed when I get spam.
Solved! Go to Solution.
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?
Thank you very much. @wku
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?
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
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).