private void ConvertComponent(TSM.BaseComponent component) { //Update component from database component.Select(); component.GetPhase(out TSM.Phase phase); //Check if is connection TSM.Connection connetion = null; TSM.Detail detail = null; T3D.Vector upVector = null; if (component is TSM.Connection) { connetion = component as TSM.Connection; upVector = connetion.UpVector; } else if (component is TSM.Detail) { detail = component as TSM.Detail; upVector = detail.UpVector; } //Select component in model new TSM.UI.ModelObjectSelector().Select(new System.Collections.ArrayList() { component }); //Convert component var akit = new TS.MacroBuilder(); akit.Callback("acmdChangeJointTypeToCallback", "DETAIL", "main_frame"); akit.Run(); component.Select(); //After conversion some connections changes its direction so we need to repair that connections if (connetion != null) { connetion.Select(); connetion.AutoDirectionType = TS.AutoDirectionTypeEnum.AUTODIR_NA; connetion.UpVector = upVector; } //After conversion some details changes its direction so we need to repair that details if (detail != null) { detail.Select(); detail.AutoDirectionType = TS.AutoDirectionTypeEnum.AUTODIR_NA; detail.UpVector = upVector; } //After conversion components change its phase to current we need to repait it component.SetPhase(phase); component.Modify(); }
private static ArrayList GetComponentParts(TSM.BaseComponent baseComponent) { ArrayList Parts = new ArrayList(); IEnumerator myChildren = baseComponent.GetChildren(); while (myChildren.MoveNext()) { Parts.Add((myChildren.Current as TSM.ModelObject).Identifier); } return(Parts); }
private bool IsNotConceptual(TSM.BaseComponent component) { return(TSM.Operations.Operation.ObjectMatchesToFilter(component, "_isNotConceptual__")); }