public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(GlobalId != null ? GlobalId.ToStepValue() : "$"); parameters.Add(OwnerHistory != null ? OwnerHistory.ToStepValue() : "$"); parameters.Add(Name != null ? Name.ToStepValue() : "$"); parameters.Add(Description != null ? Description.ToStepValue() : "$"); parameters.Add(ObjectType != null ? ObjectType.ToStepValue() : "$"); parameters.Add(ObjectPlacement != null ? ObjectPlacement.ToStepValue() : "$"); parameters.Add(Representation != null ? Representation.ToStepValue() : "$"); parameters.Add(Tag != null ? Tag.ToStepValue() : "$"); parameters.Add(NominalDiameter != null ? NominalDiameter.ToStepValue() : "$"); parameters.Add(NominalLength != null ? NominalLength.ToStepValue() : "$"); parameters.Add(PredefinedType.ToStepValue()); return(string.Join(", ", parameters.ToArray())); }
public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(GlobalId != null ? GlobalId.ToStepValue() : "$"); parameters.Add(OwnerHistory != null ? OwnerHistory.ToStepValue() : "$"); parameters.Add(Name != null ? Name.ToStepValue() : "$"); parameters.Add(Description != null ? Description.ToStepValue() : "$"); parameters.Add(ApplicableOccurrence != null ? ApplicableOccurrence.ToStepValue() : "$"); parameters.Add(HasPropertySets != null ? HasPropertySets.ToStepValue() : "$"); parameters.Add(RepresentationMaps != null ? RepresentationMaps.ToStepValue() : "$"); parameters.Add(Tag != null ? Tag.ToStepValue() : "$"); parameters.Add(ElementType != null ? ElementType.ToStepValue() : "$"); parameters.Add(PredefinedType.ToStepValue()); parameters.Add(NominalDiameter != null ? NominalDiameter.ToStepValue() : "$"); parameters.Add(NominalLength != null ? NominalLength.ToStepValue() : "$"); return(string.Join(", ", parameters.ToArray())); }
public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(GlobalId != null ? GlobalId.ToStepValue() : "$"); parameters.Add(OwnerHistory != null ? OwnerHistory.ToStepValue() : "$"); parameters.Add(Name != null ? Name.ToStepValue() : "$"); parameters.Add(Description != null ? Description.ToStepValue() : "$"); parameters.Add(ObjectType != null ? ObjectType.ToStepValue() : "$"); parameters.Add(ObjectPlacement != null ? ObjectPlacement.ToStepValue() : "$"); parameters.Add(Representation != null ? Representation.ToStepValue() : "$"); parameters.Add(Tag != null ? Tag.ToStepValue() : "$"); parameters.Add(SteelGrade != null ? SteelGrade.ToStepValue() : "$"); parameters.Add(PredefinedType.ToStepValue()); parameters.Add(NominalDiameter != null ? NominalDiameter.ToStepValue() : "$"); parameters.Add(CrossSectionArea != null ? CrossSectionArea.ToStepValue() : "$"); parameters.Add(TensionForce != null ? TensionForce.ToStepValue() : "$"); parameters.Add(PreStress != null ? PreStress.ToStepValue() : "$"); parameters.Add(FrictionCoefficient != null ? FrictionCoefficient.ToStepValue() : "$"); parameters.Add(AnchorageSlip != null ? AnchorageSlip.ToStepValue() : "$"); parameters.Add(MinCurvatureRadius != null ? MinCurvatureRadius.ToStepValue() : "$"); return(string.Join(", ", parameters.ToArray())); }
public static void NewPipe() { string strSpec = "CS300"; PlantProject proj = PlantApplication.CurrentProject; PipingProject prjpart = (PipingProject)proj.ProjectParts["Piping"]; // Current state of API does not include a .NET version of the spec // manager so the lower part's repository API must be used. // Use project to get spec folder, for now use CS300 spec PartRep.SpecPart specPart = null; string strSpecFileName = Path.Combine(prjpart.SpecSheetsDirectory, strSpec + ".pspx"); // Open the spec using (PartRep.PipePartSpecification spec = (PartRep.PipePartSpecification)PartRep.PipePartSpecification.OpenSpecification(strSpecFileName)) { NominalDiameter nd = new NominalDiameter("in", 10.0); using (PartQueryResults results = spec.SelectParts("Pipe", nd)) { if (results != null) { // use first row in spec for a 10inch pipe specPart = (PartRep.SpecPart)results.NextPart(); } } // Create the pipe and return the ObjectId ObjectId newPipeId = CreatePipe(); //try //{ // int cacheId = AddPartToProject(prjpart, strSpec, newPipeId, specPart); // // if cacheId == -1 then AddPartToProject failed // if (cacheId == -1) // { // // Failed to add part to project // Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; // ed.WriteMessage("Error creating part in the project erasing the pipe entity"); // // Erase the pipe entity // Database db = HostApplicationServices.WorkingDatabase; // using (Transaction trans = db.TransactionManager.StartTransaction()) // { // PnP3d.Pipe p = trans.GetObject(newPipeId, OpenMode.ForWrite) as PnP3d.Pipe; // if (p != null) // { // p.Erase(); // trans.Commit(); // return; // } // } // return; // } // setPartGeometry(prjpart, newPipeId, cacheId); // int groupId = createUnassignedLineGroup(prjpart); // assignToLineGroup(prjpart, newPipeId, cacheId, groupId); //} //catch(Autodesk.AutoCAD.Runtime.Exception ex) //{ // // Some other problem occurred // Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; // ed.WriteMessage("Error - erasing the pipe entity"); // ed.WriteMessage(ex.ToString()); // // Erase the pipe entity // Database db = HostApplicationServices.WorkingDatabase; // using (Transaction trans = db.TransactionManager.StartTransaction()) // { // PnP3d.Pipe p = trans.GetObject(newPipeId, OpenMode.ForWrite) as PnP3d.Pipe; // if (p != null) // { // p.Erase(); // trans.Commit(); // } // } //} spec.Close(); } }