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
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
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.
Syntax
HoleFeature.Faces() As Faces
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.
Dim tapInfo As HoleTapInfo = holeFeat.TapInfo
Can't find what you're looking for? Ask the community or share your knowledge.