Hi, I'm out of idea to create a search criteria to get only the part in an assembly with contain 3D solid. I created a vba code to get all the coordinates off COG in a assembly but no way found yet to exclude a part that always existing in the assembly with contains only 3D sketches, no 3D datas and I'm must always delete this part on assembly before running the macro if not, the macro stop when trying to get datas on this part. If one have an idea, would be very helpfull ๐
Solved! Go to Solution.
Solved by mrattray. Go to Solution.
I'm not really following your workflow, but if you just need to skip a certain part couldn't you just put some kind of unique flag on it and use an if then block to check for the flag? I'm thinking custom iProp.
The Assembly name and part will change everytime...the only thing constant will be the word "layout" in the display name of the part I have to delete to run properly the macro.
Is there a way to skip the part with this flag ? King of vba command that check if the display name contains the word "layout" int the part displayname and skip it in the loop ?
It's hard to say without knowing how your going about what your doing, but I'll try.
Is "layout" always in the same spot in the name? i.e. always at the end like "my layout" or the begining? If not, the only way I know of hand is to loop through the name of every part which might get slow if you have a ton of parts.
You might use something like:
For/Do/Whatever...
if right(varibaleHoldingPartName,6) <> "layout" then
whatever your doing
end if
next
-or-
For/Do/Whatever...
skip = false
for i = 6 to len(varibaleHoldingPartName)
if left(right(varibaleHoldingPartName,6),i) = "layout" then
skip = true
end if
next
if skip = false then
whatever your doing
end if
next
Then simply do a check on the displayname property like in my first example.
if left(displaynamevariable,11) <> "SEAT_LAYOUT" then
your code
end if
Can't find what you're looking for? Ask the community or share your knowledge.