// Update is called once per frame public void Set(DXFStructure dxf, LWPOLYLINE item, float ScaleX = 1, float ScaleY = 1) { var goLayer = GoView.Content.GetLayer(item.C8); for (int i = 0; i < item.P2D.Count - 1; i++) { // lr.SetPosition(i, new Vector3((float)item.P2D[i].X * ScaleX, (float)item.P2D[i].Y * ScaleY, 0)); GameObject go = Instantiate(goLine) as GameObject; go.transform.parent = gameObject.transform; var l = go.GetComponent<GoLine>(); l.Set(dxf, item.P2D[i], item.P2D[i + 1], goLayer, ScaleX, ScaleY); } if (item.C70 == 1 && item.P2D.Count > 2) { GameObject go = Instantiate(goLine) as GameObject; go.transform.parent = gameObject.transform; var l = go.GetComponent<GoLine>(); l.Set(dxf, item.P2D[item.P2D.Count - 1], item.P2D[0], goLayer, ScaleX, ScaleY); } }
protected override Property ReadSonClass(Property prop) { if (prop.Code == 0 && prop.Value != "ENDBLK") { switch (prop.Value) { //case "C3DFACE": //case "C3DSOLID": //case "ACAD_PROXY_ENTITY": case "ARC": var arc = new ARC(DXFData, prop); ARCList.Add(arc); return(arc.ReadProperties()); //case "ATTDEF": //case "ATTRIB": //case "BODY": case "CIRCLE": var circle = new CIRCLE(DXFData, prop); CIRCLEList.Add(circle); return(circle.ReadProperties()); //case "DIMENSION": case "ELLIPSE": var ellipes = new ELLIPSE(DXFData, prop); ELLIPSEList.Add(ellipes); return(ellipes.ReadProperties()); //case "HATCH": //case "HELIX": //case "IMAGE": case "INSERT": var insert = new INSERT(DXFData, prop); INSERTList.Add(insert); return(insert.ReadProperties()); //case "LEADER": //case "LIGHT": case "LINE": var line = new LINE(DXFData, prop); LINEList.Add(line); return(line.ReadProperties()); case "LWPOLYLINE": var lwpolyline = new LWPOLYLINE(DXFData, prop); LWPOLYLINEList.Add(lwpolyline); return(lwpolyline.ReadProperties()); //case "MESH": //case "MLINE": //case "MLEADERSTYLE": //case "MLEADER": //case "MTEXT": //case "OLEFRAME": //case "OLE2FRAME": //case "POINT": //case "POLYLINE": //case "RAY": //case "REGION": //case "SECTION": //case "SEQEND": //case "SHAPE": //case "SOLID": //case "SPLINE": //case "SUN": //case "SURFACE": //case "TABLE": case "TEXT": var text = new TEXT(DXFData, prop); TEXTList.Add(text); return(text.ReadProperties()); //case "TOLERANCE": //case "TRACE": //case "UNDERLAY": //case "VERTEX": //case "VIEWPORT": //case "WIPEOUT": //case "XLINE": default: return(CreateSonClass(new ENTITIE(DXFData, prop))); } } else { return(base.ReadSonClass(prop)); } }
protected override Property ReadSonClass(Property prop) { if (prop.Code == 0 && prop.Value != "ENDSEC") { switch (prop.Value) { //case "C3DFACE": //case "C3DSOLID": //case "ACAD_PROXY_ENTITY": case "ARC": var arc = new ARC(DXFData, prop); ARCList.Add(arc); return arc.ReadProperties(); //case "ATTDEF": //case "ATTRIB": //case "BODY": case "CIRCLE": var circle = new CIRCLE(DXFData, prop); CIRCLEList.Add(circle); return circle.ReadProperties(); //case "DIMENSION": case "ELLIPSE": var ellipes = new ELLIPSE(DXFData, prop); ELLIPSEList.Add(ellipes); return ellipes.ReadProperties(); //case "HATCH": //case "HELIX": //case "IMAGE": case "INSERT": var insert = new INSERT(DXFData, prop); INSERTList.Add(insert); return insert.ReadProperties(); //case "LEADER": //case "LIGHT": case "LINE": var line = new LINE(DXFData, prop); LINEList.Add(line); return line.ReadProperties(); case "LWPOLYLINE": var lwpolyline = new LWPOLYLINE(DXFData, prop); LWPOLYLINEList.Add(lwpolyline); return lwpolyline.ReadProperties(); //case "MESH": //case "MLINE": //case "MLEADERSTYLE": //case "MLEADER": //case "MTEXT": //case "OLEFRAME": //case "OLE2FRAME": //case "POINT": //case "POLYLINE": //case "RAY": //case "REGION": //case "SECTION": //case "SEQEND": //case "SHAPE": //case "SOLID": //case "SPLINE": //case "SUN": //case "SURFACE": //case "TABLE": case "TEXT": var text = new TEXT(DXFData, prop); TEXTList.Add(text); return text.ReadProperties(); //case "TOLERANCE": //case "TRACE": //case "UNDERLAY": //case "VERTEX": //case "VIEWPORT": //case "WIPEOUT": //case "XLINE": default: return CreateSonClass(new ENTITIE(DXFData, prop)); } } else { return base.ReadSonClass(prop); } }