Is there a way to specify different colors for different hole sizes?

Is there a way to specify different colors for different hole sizes?

pong2474
Explorer Explorer
411 Views
2 Replies
Message 1 of 3

Is there a way to specify different colors for different hole sizes?

pong2474
Explorer
Explorer
Is there a way to specify different colors for different hole sizes?
(Design Automatic Change)

This will lower the defective rate of products.

For Example
M5x0.8 Tap = Green / Ø5.3 ~ Ø6 Hole = Green
M4x0.7 Tap = Blue / Ø4.3 ~ Ø5 Hole = Blue

I want to change it by editing i-logic or excel files (clearance or thread).

Please help me. Thanks

pong2474_0-1694736727537.png

 

0 Likes
412 Views
2 Replies
Replies (2)
Message 2 of 3

gerrardhickson
Collaborator
Collaborator

Hi @pong2474 , Yes, this is fairly easy. Have you tried writing any code of your own?

The way I would approach this is to make a collection of (full round) cylindrical faces  - either by user selection or searching the model for any cylindrical face. Then determine if they were created by a hole, extrude cut or sheet metal cut feature. Then determine the hole dimensions (diameter, tap, counterbore, countersink etc), and then apply the colour to the surface or feature as required.

Regards

Message 3 of 3

A.Acheson
Mentor
Mentor

Hi @pong2474 

 

Yes relatively easy task but the information is buried a little in the API help. I did up a quick sample just for my own benefit but for now I will just put in a few sample links to object that @gerrardhickson had mentioned. This will give you time do do a little research and work on a sample code. Just dropping in a working code isn't a great way to learn as you will benefit more from learning from first principles and making mistakes and navigating helpfiles and there samples..

 

First step is to create a list of the workflow then scan the object list in the API looking for the object, remember to use the same name as it is called within Inventor. Drop in the object beside each list member. Remember to declare each object so you can navigate it's methods and properties. 

 

HoleFeature.Faces

Syntax

HoleFeature.Faces() As Faces

 

Face.Appearance

Syntax

Face.Appearance() As Asset

 

Appearance Asset to Occurrence

Although this is for an occurrence you just need to give the asset to the face appearance instead of occurrence. Written in VBA but can be converted to ilogic. 

 

HoleFeature.TapInfo

Dim tapInfo As HoleTapInfo = holeFeat.TapInfo

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes