Code to GET custom property "SM_ORDER_=01" of the part and open the web browser to MRP
Code to GET custom property "SM_ORDER_=01" of the part and open the web browser to MRP
private void lifter_select_panel(int Tekla_ID_Select, string mouse_side)
{
Tekla.Structures.Model.Model TSM = new Tekla.Structures.Model.Model();
Tekla.Structures.Identifier TeklaID = new Tekla.Structures.Identifier(Tekla_ID_Select);
Tekla.Structures.Model.ModelObject mo = TSM.SelectModelObject(TeklaID);
if (mouse_side == "Right")
{
string order_n = "";
mo.GetUserProperty("SM_Order_01", ref order_n);
string jarvis_url = @"http://192.168.1.58/intranet/w_pedidos/index.php?txped=" + order_n;
System.Diagnostics.Process.Start(jarvis_url);
}
else
{
Tekla.Structures.Model.Part PickPart = mo as Tekla.Structures.Model.Part;
Tekla.Structures.Geometry3d.AABB PartBoundingBox = new Tekla.Structures.Geometry3d.AABB();
if (PickPart != null)
{
Tekla.Structures.Model.Solid PartSolid = PickPart.GetSolid();
PartBoundingBox.MaxPoint = PartSolid.MaximumPoint;
PartBoundingBox.MinPoint = PartSolid.MinimumPoint;
}
Tekla.Structures.Model.UI.ModelViewEnumerator ViewEnum = Tekla.Structures.Model.UI.ViewHandler.GetVisibleViews();
while (ViewEnum.MoveNext())
{
Tekla.Structures.Model.UI.View ViewSel = ViewEnum.Current;
Tekla.Structures.Model.UI.ViewHandler.ZoomToBoundingBox(ViewSel, PartBoundingBox);
}
Tekla.Structures.Model.UI.ModelObjectSelector MS = new Tekla.Structures.Model.UI.ModelObjectSelector();
System.Collections.ArrayList Objects_MS = new System.Collections.ArrayList();
Objects_MS.Add(mo);
MS.Select(Objects_MS);
// TSM.CommitChanges();
}
}
string order_n = "";
mo.GetUserProperty("SM_Order_01", ref order_n);
string jarvis_url = @"http://192.168.1.58/intranet/w_pedidos/index.php?txped=" + order_n;
private void lifter_select_panel(int Tekla_ID_Select, string mouse_side)
{
Tekla.Structures.Model.Model TSM = new Tekla.Structures.Model.Model();
Tekla.Structures.Identifier TeklaID = new Tekla.Structures.Identifier(Tekla_ID_Select);
Tekla.Structures.Model.ModelObject mo = TSM.SelectModelObject(TeklaID);
if (mouse_side == "Right")
{
string order_n = "";
mo.GetUserProperty("SM_Order_01", ref order_n);
string jarvis_url = @"http://192.168.1.58/intranet/w_pedidos/index.php?txped=" + order_n;
System.Diagnostics.Process.Start(jarvis_url);
}
else
{
Tekla.Structures.Model.Part PickPart = mo as Tekla.Structures.Model.Part;
Tekla.Structures.Geometry3d.AABB PartBoundingBox = new Tekla.Structures.Geometry3d.AABB();
if (PickPart != null)
{
Tekla.Structures.Model.Solid PartSolid = PickPart.GetSolid();
PartBoundingBox.MaxPoint = PartSolid.MaximumPoint;
PartBoundingBox.MinPoint = PartSolid.MinimumPoint;
}
Tekla.Structures.Model.UI.ModelViewEnumerator ViewEnum = Tekla.Structures.Model.UI.ViewHandler.GetVisibleViews();
while (ViewEnum.MoveNext())
{
Tekla.Structures.Model.UI.View ViewSel = ViewEnum.Current;
Tekla.Structures.Model.UI.ViewHandler.ZoomToBoundingBox(ViewSel, PartBoundingBox);
}
Tekla.Structures.Model.UI.ModelObjectSelector MS = new Tekla.Structures.Model.UI.ModelObjectSelector();
System.Collections.ArrayList Objects_MS = new System.Collections.ArrayList();
Objects_MS.Add(mo);
MS.Select(Objects_MS);
// TSM.CommitChanges();
}
}
string order_n = "";
mo.GetUserProperty("SM_Order_01", ref order_n);
string jarvis_url = @"http://192.168.1.58/intranet/w_pedidos/index.php?txped=" + order_n;
Comentários
Enviar um comentário