Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
Reply
Message 1 of 3
pong2474
222 Views, 2 Replies

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

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

 

Labels (6)
2 REPLIES 2
Message 2 of 3
gerrardhickson
in reply to: pong2474

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
in reply to: pong2474

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report