public virtual void StartPlacement(IGTPlacementTechniqueHelper PTHelper, IGTKeyObject KeyObject, IGTKeyObjects KeyObjectCollection) { try { m_PTHelper = PTHelper; IGTKeyObject m_KeyObject = KeyObject; IGTKeyObjects m_KeyObjectCollection = KeyObjectCollection; if (bSilent) { // Disable construction aids and status bar prompts for silent placement techinque. m_PTHelper.ConstructionAidsEnabled = GTConstructionAidsEnabledConstants.gtptConstructionAidsNone; m_PTHelper.ConstructionAidDynamicsEnabled = false; m_PTHelper.StatusBarPromptsEnabled = false; m_PTHelper.StartPlacement(m_KeyObject, m_KeyObjectCollection); // End Placement m_PTHelper.EndPlacement(); } else { m_PTHelper.StatusBarPromptsEnabled = true; m_PTHelper.StartPlacement(m_KeyObject, m_KeyObjectCollection); } } catch (Exception ex) { MessageBox.Show("Error in Isolation Scenario PlacementTechnic Interface \n" + ex.Message, "G /Technology", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public virtual void StartPlacement(Intergraph.GTechnology.API.IGTPlacementTechniqueHelper PTHelper, Intergraph.GTechnology.API.IGTKeyObject KeyObject, Intergraph.GTechnology.API.IGTKeyObjects KeyObjectCollection) { try { m_PTHelper = PTHelper; IGTKeyObject m_KeyObject = KeyObject; IGTKeyObjects m_KeyObjectCollection = KeyObjectCollection; if (bSilent) { m_PTHelper.StatusBarPromptsEnabled = false; m_PTHelper.StartPlacement(m_KeyObject, m_KeyObjectCollection); // End Placement m_PTHelper.EndPlacement(); } else { m_PTHelper.StatusBarPromptsEnabled = true; m_PTHelper.StartPlacement(m_KeyObject, m_KeyObjectCollection); } } catch (Exception ex) { MessageBox.Show("Error in Isolation Scenario PlacementTechnic Interface \n" + ex.Message, "G /Technology", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public override void StartPlacement(IGTPlacementTechniqueHelper PTHelper, Intergraph.GTechnology.API.IGTKeyObject KeyObject, Intergraph.GTechnology.API.IGTKeyObjects KeyObjectCollection) { try { m_PTHelper = PTHelper; IGTKeyObject m_KeyObject = KeyObject; IGTKeyObjects m_KeyObjectCollection = KeyObjectCollection; if (bSilent) { m_PTHelper.StatusBarPromptsEnabled = false; m_PTHelper.StartPlacement(m_KeyObject, m_KeyObjectCollection); } else { //Get the Argument value linearFNOs = new List <int>(Array.ConvertAll(m_GComp.Arguments.GetArgument(0).ToString().Split(','), int.Parse)); m_PTHelper.StatusBarPromptsEnabled = true; m_PTHelper.StartPlacement(m_KeyObject, m_KeyObjectCollection); } } catch (Exception ex) { MessageBox.Show("Error in Isolation Scenario PlacementTechnic Interface - StartPlacement \n" + ex.Message, "G /Technology", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// Method is called when pad/vault mounted switch gear placement is started /// </summary> /// <param name="PTHelper"></param> /// <param name="KeyObject"></param> /// <param name="KeyObjectCollection"></param> public void StartPlacement(IGTPlacementTechniqueHelper PTHelper, IGTKeyObject KeyObject, IGTKeyObjects KeyObjectCollection) { try { m_PTHelper = PTHelper; m_KeyObject = KeyObject; m_KeyObjectCollection = KeyObjectCollection; m_PTHelper.ConstructionAidsEnabled = Intergraph.GTechnology.API.GTConstructionAidsEnabledConstants.gtptConstructionAidsNone; m_PTHelper.ConstructionAidDynamicsEnabled = false; m_PTHelper.StatusBarPromptsEnabled = false; m_PTHelper.StartPlacement(m_KeyObject, m_KeyObjectCollection); m_GTApplication = GTClassFactory.Create <IGTApplication>().Application; m_Arguments = m_ActiveGraphicComponent.Arguments; m_ActiveMapWindow = m_GTApplication.ActiveMapWindow; string ownerFeatureName = m_ActiveMapWindow.DetailID == 0 ? "Pad" : "Vault"; m_GTApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Click to select an existing " + ownerFeatureName + " feature to Own the Primary switch gear which is to be placed adjacent to it."); } catch (Exception ex) { MessageBox.Show(ex.Message, Caption); } }
/// <summary> /// StartPlacement /// </summary> /// <param name="PTHelper"></param> /// <param name="KeyObject"></param> /// <param name="KeyObjectCollection"></param> /// <returns></returns> public override void StartPlacement(IGTPlacementTechniqueHelper PTHelper, IGTKeyObject KeyObject, IGTKeyObjects KeyObjectCollection) { try { m_PTHelper = PTHelper; IGTKeyObject m_KeyObject = KeyObject; IGTPoint m_gtOrigin; IGTGraphicComponent relativeComponent = GTClassFactory.Create <IGTGraphicComponent>(); m_KeyObjectCollection = KeyObjectCollection; //get current Key object currentKeyObject = GetcurrentKeyObject(KeyObject.FNO); if (bSilent) { m_gtApplication.BeginWaitCursor(); // Disable construction aids and status bar prompts for silent placement techinque. m_PTHelper.ConstructionAidsEnabled = GTConstructionAidsEnabledConstants.gtptConstructionAidsNone; m_PTHelper.ConstructionAidDynamicsEnabled = false; m_PTHelper.StatusBarPromptsEnabled = true; m_gtApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, currentKeyObject + " Point placement is in Progress......"); IGTComponents gtComponents = KeyObject.Components; m_PTHelper.StartPlacement(KeyObject, KeyObjectCollection); //Read arguments ReadArgument(); //Find the relative component defined in the placement technique arguments. if ((Convert.ToString(m_GComp.Arguments.GetArgument(0)) != "") && (m_GComps.Count > 0) && (m_GComp != null)) { relativeComponent = AccessRelativeComponent.RetrieveRelativeComponent(Convert.ToString(m_GComp.Arguments.GetArgument(0)), m_GComps, m_GComp); //get the origin m_gtOrigin = GetOrigin(m_KeyObject, gtComponents, relativeComponent, xOffset, pointLocation); if ((m_gtOrigin != null) && (relativeComponent != null)) { //Set Attribute values SetAttributeValues(gtComponents, m_KeyObject, relativeComponent); //Create new point geometry aligned to the linear feature IGTOrientedPointGeometry newPointGeometry = (IGTOrientedPointGeometry)PTHelper.CreateGeometry(); //newPointGeometry.Orientation = VectorByAngle(ang); newPointGeometry.Origin = m_gtOrigin; m_PTHelper.SetGeometry(newPointGeometry); m_PTHelper.EndPlacement(); } else { AbortPlacement(); } } else { if (pointLocation == "R") { MessageBox.Show("Error: Unable to place " + currentKeyObject + " Points", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Error); } AbortPlacement(); } } } catch (Exception ex) { MessageBox.Show("Error: Unable to place " + currentKeyObject + " Points \n" + ex.Message, "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Error); AbortPlacement(); } finally { m_KeyObjectCollection = null; m_GComps = null; m_GComp = null; if (pointLocation == "R") { m_gtApplication.EndWaitCursor(); m_gtApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Feature Placement Completed"); m_gtApplication.ActiveMapWindow.MousePointer = GTMousePointerConstants.gtmwmpNWArrow; m_PTHelper.ConstructionAidsEnabled = GTConstructionAidsEnabledConstants.gtptConstructionAidsNone; m_PTHelper.ConstructionAidDynamicsEnabled = false; } Exitcommand(); } }