Changing appearance of all surfaces with specific appearance

Changing appearance of all surfaces with specific appearance

Daan_M
Collaborator Collaborator
374 Views
2 Replies
Message 1 of 3

Changing appearance of all surfaces with specific appearance

Daan_M
Collaborator
Collaborator

Current situation

 

I've got an assembly file (.iam) that puts multiple part files (.ipt) thogether in a certain configuration.

These Parts consist of a single solid body and i defined their appearance in the partfile itself.

 

let's take a partfile of a flange for example, which has 3 appearances;

 

- Black appearance for the oil seal

- Steel appearance for flange surface

- Default appearance for the remaining surfaces

 

vraag2.PNG

 

The problem

 

The remainign surfaces are set to default appearance, but in reality this can be painted in a desired color.

 

In my final assembly, after configuration is done, I would like to change the color of all surfaces of all parts that have the 'default' appearance, and be able to change it to another appearance, for example 'red'.

 

When i overwrite the appearance in my assemblycode using

 

 

 

oACD.Occurrences.ItemByName(pFlens & ":1").Appearance = oAssetCustom

 

 

 

The entire flange is changed;

 

Daan_M_1-1697460172647.png

 

But the desired result is:

 

Daan_M_2-1697460230198.png

 

 

Strange behaviour

 

Something strange i encountered when adjusting appearances in partfiles themselfes is the following:

i manually selected surfaces and gave these surfaces a specific appearance, while all other surfaces are left at the default setting. When i select the entire body and change the appearance as a whole, only the default surfaces are changed. This behaviour is not consistent with the assembly code in which the entire body including all surfaces are changed, not just the default ones.

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

Andrii_Humeniuk
Advisor
Advisor

Hi @Daan_M . Try my free addin for Inventor which does a very good job of this.

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes
Message 3 of 3

bshbsh
Collaborator
Collaborator

There's nothing strange with that. In the assembly, you override how the entire occurrence appears in that assembly's active design view. This overrides appearances in the occurrence part itself. In the part when selecting faces, you override each individual face's appearance in that part's design view.

 

For Each SurfaceBody In ThisApplication.ActiveEditObject.ComponentDefinition.SurfaceBodies
    For Each Face In SurfaceBody.Faces
        If Face.Appearance.Displayname = "Default" Then ThisApplication.ActiveEditDocument.SelectSet.Select (Face)
    Next
Next
Call ThisApplication.CommandManager.ControlDefinitions.Item("AppFacePropertiesCmd").Execute
0 Likes