public static Element ToElement(this BCOM.Element bcomElement) { #if CONNECT return(Element.GetFromElementRefAndModelRef( (IntPtr)bcomElement.MdlElementRef(), (IntPtr)bcomElement.ModelReference.MdlModelRefP())); #elif V8i return(Element.ElementFactory( (IntPtr)bcomElement.MdlElementRef(), (IntPtr)bcomElement.ModelReference.MdlModelRefP() )); #endif }
private void init(BCOM.Element element, Sp3dTask_Old task) { elemRef = element.MdlElementRef(); modelRef = element.ModelReference.MdlModelRefP(); elemId = element.ID; Oid = task.pipe.Oid; if (task.pipe == null || task.component == null) { ErrorText = "Не удалось прочитать данные задания"; return; } Code = task.pipe.Name; BCOM.Point3d pt = new BCOM.Point3d(); pt.X = task.pipe.LocationX; pt.Y = task.pipe.LocationY; pt.Z = task.pipe.LocationZ; Location = pt; // разбор типоразмера: try { string[] parameters = task.pipe.Description.TrimStart('T').Split('-'); Diametr = int.Parse(parameters[1]); } catch (Exception) { ErrorText = string.Format("Не удалость разобрать типоразмер \"{0}\"", task.pipe.Description); } }
public static Element getElement(BCOM.Element bcomElement) { return(Element.GetFromElementRefAndModelRef((IntPtr)bcomElement.MdlElementRef(), (IntPtr)bcomElement.ModelReference.MdlModelRefP())); }