Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
As a preview, I want to copy the surface bodies of all the assembly components into the ClientGraphics and make the components invisible.
This works fine, but all surface bodies appear dark grey. It looks like the appearance setting is being ignored.
Here is the code:
foreach ((string Name, SurfaceBody SrfBody, Matrix Transformation) item in srfBodies)
{
SurfaceBody srfBdy = item.SrfBody;
if (srfBdy.AppearanceSourceType == AppearanceSourceTypeEnum.kPartAppearance)
{
PartComponentDefinition partDef = (PartComponentDefinition)srfBdy.Parent;
PartDocument partDoc = (PartDocument)partDef.Document;
srfBdy.Appearance = partDoc.ActiveAppearance;
}
GraphicsNode node = cg.AddNode(nodeID++);
SurfaceGraphics srfG = node.AddSurfaceGraphics(srfBdy);
node.Transformation = item.Transformation;
}
invApp.ActiveView.Update();
Input:
Result:
Before executing the line of code "srfBdy.Appearance = partDoc.ActiveAppearance;", the value of the AppearanceSourceTypeEnum is kPartAppearance. After changing the appearance, it turns into kOverrideAppearance.
Any suggestions?
Thanks & Regards
Christoph
Solved! Go to Solution.