private void InitMaterialLayersAandImages() { foreach (MaterialData material in Materials) { vdColor color = new vdColor { Red = material.Color.Red, Green = material.Color.Green, Blue = material.Color.Blue, AlphaBlending = (byte)(255.0 * (1 - material.Transparency / 100.0)) }; vdLayer layer = new vdLayer(vDraw.ActiveDocument, material.Name, color); vDraw.ActiveDocument.Layers.AddItem(layer); if (string.IsNullOrEmpty(material.GetValidMapFile())) { continue; } var fileName = Path.GetFileNameWithoutExtension(ExportSetting.SystemSetting.ExportFilePath); var folderName = Path.GetDirectoryName(ExportSetting.SystemSetting.ExportFilePath); var imageFilePath = folderName + "\\" + fileName + "_texture\\" + material.GetValidMapFile(); AddImage(imageFilePath); } }
public static eHEADS_COLOR ToHdColor(vdColor vdcolor) { //eHEADS_COLOR hdcolorSele = eHEADS_COLOR.ByBlock; //for (int i = (int)eHEADS_COLOR.ByBlock; i < (int)eHEADS_COLOR.ByLayer; i++) //{ // eHEADS_COLOR hdcolor = (eHEADS_COLOR)i; // if (hdcolor.ToString().ToLower() == vdcolor.ToString().ToLower()) // { // hdcolorSele = hdcolor; // break; // } //} return((eHEADS_COLOR)vdcolor.ColorIndex); }
public static ulong CommonPolyLine(vdDocument activeDocument, List <gPoint> polyLineLst, double penWidth, Color color) { VectorDraw.Professional.vdFigures.vdPolyline onepoly = new VectorDraw.Professional.vdFigures.vdPolyline(); onepoly.SetUnRegisterDocument(activeDocument); onepoly.setDocumentDefaults(); onepoly.PenWidth = penWidth; vdColor LineColor = new vdColor(color); onepoly.PenColor = LineColor; if (polyLineLst != null) { for (int i = 0; i < polyLineLst.Count; i++) { onepoly.VertexList.Add(new gPoint(polyLineLst[i].x, polyLineLst[i].y)); } activeDocument.ActiveLayOut.Entities.AddItem(onepoly); return(onepoly.Handle.Value); } else { return(0); } }