Skp exporter (SDK_Win_x86_16-1-2419) Edges on wrong layer

due to an 32bit environment we are using the relatively old SketchUp Pro 2016 API for our grafix exporter to skp.

There arises a problem, where edges of faces are not on the same layer as the face itself.
The exported edges are all on layer_0 and so, when a sketchup user hides the layer, where the faces are on, the edges remain visible.

the code looks something like this.


    SUPoint3D vertices[3] = { 
        { fp1w[0],fp1w[1],fp1w[2]},
        { fp2w[0],fp2w[1],fp2w[2]},
        { fp3w[0],fp3w[1],fp3w[2]}  };  

..
        SUFaceRef su_face = SU_INVALID;  
            SUResult res =SU_ERROR_NONE;

            SUGeometryInputRef local_geom_input = SU_INVALID;

..
        for (size_t i = 0; i < 3; ++i) 
            {
                SUPoint3D pt(vertices[i]);
                SU_CALL(SUGeometryInputAddVertex(local_geom_input, &pt));
..

                SketchupExportHelper.m_VerticeCounter++;
            }
            size_t face_vertex_count =0; // ;
            size_t num_face_vertices = 3;
            SULoopInputRef loop = SU_INVALID;
            SU_CALL(SULoopInputCreate(&loop));

            for (size_t i = 0; i < num_face_vertices; ++i) 
            {

                SU_CALL(SULoopInputAddVertexIndex(loop, SketchupExportHelper.m_GlobalVerticeCounter + i));

                if (SketchupExportHelper.m_EdgesHide)
                {
                    SU_CALL(SULoopInputEdgeSetHidden(loop,i,true));
                }

            }

..
        size_t face_index = 0;

            SU_CALL(SUGeometryInputAddFace(local_geom_input, &loop, &face_index));

....
            //// Set the layer
            if (SketchupExportHelper.GetCurrentLayer().length()>0) 
            {

                SULayerRef layer = SketchupExportHelper.FindLayer(SketchupExportHelper.GetCurrentLayer());

                SU_CALL(SUGeometryInputFaceSetLayer(local_geom_input, face_index, layer));


            }

....

Does anybody have an idea, whether its possible to deal with this problemproblem ?

I’m not really familiar with the SDK

If you create a face using the Ruby API, it automatically creates the edges that bound the face.
If you assign a layer to the face, it only applies to the face, the edges must be assigned separately to the layer.

Using my very limited knowledge of SDK, I do not see any edge assigned to layer in the code above… (unfortunately, I can’t tell you what is the “equivalent” Face #edges method in SDK ).
So I just assume that you need to assig layer to bounding edges too.

BTW. The good practice to assign layer (tag) only to groups / components and leave faces and edges assigned to layer0 (untagged).

In the SketchUp world of models, generally all geometric primitives should be on Layer0 (“Untagged”).

Only group and component instances, and other complex objects like: dimensions, text callouts, guidepoints, guidelines, section planes, and image objects, … should be assigned to use other layers (aka tags).

The exception would be if the model was to be exported to CAD dwg, etc., where conversion such as edgeline is to be done during export.