Example #1
0
 internal void MakeStepStyle(int msb, ExportStep export)
 {
     //#23=COLOUR_RGB('Colour',0.,0.501960784314,1.) ;
     //#24=FILL_AREA_STYLE_COLOUR(' ',#23) ;
     //#25=FILL_AREA_STYLE(' ',(#24)) ;
     //#26=SURFACE_STYLE_FILL_AREA(#25) ;
     //#27=SURFACE_SIDE_STYLE(' ',(#26)) ;
     //#28=SURFACE_STYLE_USAGE(.BOTH.,#27) ;
     //#29=PRESENTATION_STYLE_ASSIGNMENT((#28)) ;
     //#30=STYLED_ITEM(' ',(#29),#22) ;
     //#60 = DRAUGHTING_PRE_DEFINED_COLOUR('red');
     //#61 = CURVE_STYLE('',#62,POSITIVE_LENGTH_MEASURE(0.1),#60);
     //#62 = DRAUGHTING_PRE_DEFINED_CURVE_FONT('continuous');
     //#63 = MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION('',(#64),
     if (!export.StyledItems.TryGetValue(this, out int psa))
     {
         int clr = export.WriteDefinition("COLOUR_RGB('" + Name + "'," + export.ToString(color.R / 255.0) + ","
                                          + export.ToString(color.G / 255.0) + "," + export.ToString(color.B / 255.0) + ")");
         int cnt = export.WriteDefinition("DRAUGHTING_PRE_DEFINED_CURVE_FONT('continuous')");
         int cs  = export.WriteDefinition("CURVE_STYLE(' ',#" + cnt.ToString() + ",POSITIVE_LENGTH_MEASURE(0.1),#" + clr.ToString() + ")");
         int fac = export.WriteDefinition("FILL_AREA_STYLE_COLOUR(' ',#" + clr.ToString() + ")");
         int fas = export.WriteDefinition("FILL_AREA_STYLE(' ',(#" + fac.ToString() + "))");
         int ssf = export.WriteDefinition("SURFACE_STYLE_FILL_AREA(#" + fas.ToString() + ")");
         int sss = export.WriteDefinition("SURFACE_SIDE_STYLE(' ',(#" + ssf.ToString() + "))");
         int ssu = export.WriteDefinition("SURFACE_STYLE_USAGE(.BOTH.,#" + sss.ToString() + ")");
         psa = export.WriteDefinition("PRESENTATION_STYLE_ASSIGNMENT((#" + ssu.ToString() + "))");
         export.StyledItems[this] = psa;
     }
     export.WriteDefinition("STYLED_ITEM(' ',(#" + psa.ToString() + "),#" + msb.ToString() + ")");
 }
Example #2
0
        int IExportStep.Export(ExportStep export, bool topLevel)
        {
            // #63=LINE('',#60,#62) ;
            int p1  = (startPoint as IExportStep).Export(export, false); // unfortunately we don't know about vertices here, so we cannot use them
            int dir = ((EndPoint - StartPoint) as IExportStep).Export(export, false);
            int vec = export.WriteDefinition("VECTOR('',#" + dir.ToString() + ",1.)");
            int ln  = export.WriteDefinition("LINE('',#" + p1.ToString() + ",#" + vec.ToString() + ")");

            if (topLevel)
            {   // export as a geometric curve set of a single trimmed curve
                // #37 = GEOMETRIC_CURVE_SET('',(#38));
                // #38 = TRIMMED_CURVE('',#39,(#43,PARAMETER_VALUE(0.E+000)),(#44,PARAMETER_VALUE(62.52263230373)),.T.,.PARAMETER.);
                int      sp  = (startPoint as IExportStep).Export(export, false);
                int      ep  = (endPoint as IExportStep).Export(export, false);
                int      tc  = export.WriteDefinition("TRIMMED_CURVE('',#" + ln.ToString() + ",(#" + sp.ToString() + ",PARAMETER_VALUE(0.0)),(#" + ep.ToString() + ",PARAMETER_VALUE(" + export.ToString(Length) + ")),.T.,.CARTESIAN.)");
                int      gcs = export.WriteDefinition("GEOMETRIC_CURVE_SET('',(#" + tc.ToString() + "))"); // is a Representation_Item
                ColorDef cd  = ColorDef;
                if (cd == null)
                {
                    cd = new ColorDef("Black", Color.Black);
                }
                cd.MakeStepStyle(gcs, export);
                int product = export.WriteDefinition("PRODUCT( '','','',(#2))");
                int pdf     = export.WriteDefinition("PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE( ' ', 'NONE', #" + product.ToString() + ", .NOT_KNOWN. )");
                int pd      = export.WriteDefinition("PRODUCT_DEFINITION( 'NONE', 'NONE', #" + pdf.ToString() + ", #3 )");
                int pds     = export.WriteDefinition("PRODUCT_DEFINITION_SHAPE( 'NONE', 'NONE', #" + pd.ToString() + " )");
                int sr      = export.WriteDefinition("SHAPE_REPRESENTATION('', ( #" + gcs.ToString() + "), #4 )");
                export.WriteDefinition("SHAPE_DEFINITION_REPRESENTATION( #" + pds.ToString() + ", #" + sr.ToString() + ")");
                return(sr);
            }
            else
            {
                return(ln);
            }
        }
Example #3
0
        int IExportStep.Export(ExportStep export, bool topLevel)
        {
            /*
             #248 = ADVANCED_BREP_SHAPE_REPRESENTATION( 'Assem1', ( #717, #718, #719, #720, #721, #722, #723, #724, #725, #726, #727 ), #26 );
             #727 = AXIS2_PLACEMENT_3D( '', #1437, #1438, #1439 );
             #717 = MAPPED_ITEM( '', #1417, #1418 );
             #1417 = REPRESENTATION_MAP( #727, #251 );
             #1418 = AXIS2_PLACEMENT_3D( '', #2213, #2214, #2215 );
             #251 = ADVANCED_BREP_SHAPE_REPRESENTATION( 'A0501_SASIL_plus_00_50_185_3_polig', ( #730 ), #26 );
             */
            List <int> representationItems = new List <int>();
            int        mainAxis            = export.WriteAxis2Placement3d(GeoPoint.Origin, GeoVector.ZAxis, GeoVector.XAxis);

            for (int i = 0; i < containedObjects.Count; i++)
            {
                if (containedObjects[i] is IExportStep)
                {
                    int toMap      = (containedObjects[i] as IExportStep).Export(export, true); // true is correct here, because it is part of a map
                    int axis       = export.WriteAxis2Placement3d(GeoPoint.Origin, GeoVector.ZAxis, GeoVector.XAxis);
                    int repMap     = export.WriteDefinition("REPRESENTATION_MAP(#" + mainAxis.ToString() + ",#" + toMap.ToString() + ")");
                    int mappedItem = export.WriteDefinition("MAPPED_ITEM( '', #" + repMap.ToString() + ",#" + axis.ToString() + ")");
                    representationItems.Add(mappedItem);
                }
            }
            representationItems.Add(mainAxis);
            int sr      = export.WriteDefinition("SHAPE_REPRESENTATION('" + Name + "',(" + export.ToString(representationItems.ToArray(), true) + "),#4)");
            int product = export.WriteDefinition("PRODUCT( '" + Name + "','" + Name + "','',(#2))");
            int pdf     = export.WriteDefinition("PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE( ' ', 'NONE', #" + product.ToString() + ", .NOT_KNOWN. )");
            int pd      = export.WriteDefinition("PRODUCT_DEFINITION( 'NONE', 'NONE', #" + pdf.ToString() + ", #3 )");
            int pds     = export.WriteDefinition("PRODUCT_DEFINITION_SHAPE( 'NONE', 'NONE', #" + pd.ToString() + " )");

            export.WriteDefinition("SHAPE_DEFINITION_REPRESENTATION( #" + pds.ToString() + ", #" + sr.ToString() + ")");

            return(sr);
        }
Example #4
0
        int IExportStep.Export(ExportStep export, bool topLevel)
        {
            int n = (baseSurface as IExportStep).Export(export, false);

            return(export.WriteDefinition("OFFSET_SURFACE('',#" + n.ToString() + "," + export.ToString(offset) + ",.F.)"));
        }