
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to read the Renderstyle used for a Face.
I have an Assembly file containing 3 copies of a cube part. While the original cube part file has no color information, but i have assigned a (different) color/RenderStyle to each of the 3 cube parts in the assembly.
Problem: i cannot get the correct renderstyle information for the faces. This is how i iterate over the document:
StyleSourceEnum source;
foreach (ComponentOccurence occ in AssemblyDocument doc) {
if (occ.GetDefinitionDocumentType == kPartDocument) {
PartDocument part = (PartDocument) occ.GetDefinition().GetDocument()
RenderStyle partStyle = part.GetActiveRenderStyle(source)
foreach (Feature feature in part.GetComponentDefinition().GetFeatures()) {
RenderStyle featureStyle = feature.GetRenderStyle(source)
RenderStyle bodyStyle = feature.GetSurfaceBody().GetRenderStyle(source)
foreach (Face face in feature.GetSurfaceBody().GetFaces()) {
RenderStyle faceStyle = face.GetRenderStyle(source)
}
}
}
}
face.GetRenderStyle returns Null, source = kFeatureRenderStyle
feature.GetRenderStyle returns Null, source= kBodyRenderStyle
surfaceBody.GetRenderStyle returns Null, source= kPartRenderStyle
part.GetActiveRenderStyle returns Default material
where is the custom color i assigned to the cubes? The cubes are definitely colored in the 3D view of Inventor.
I coud provide the assembly and part files if needed.
Using Inventor 2011, 64 Bit, programming in C++
Solved! Go to Solution.